auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean allowedStorageDomain ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > sourceActiveStorageDomains , boolean shouldFilterBySourceType , org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel templateDisk , org.ovirt.engine.core.common.businessentities.StorageDomain sd ) { if ( sourceActiveStorageDomains.contains ( sd ) ) { return false ; } return super . allowedStorageDomain ( sourceActiveStorageDomains , shouldFilterBySourceType , diskImage , templateDisk , sd ) ; }

Target:
protected boolean allowedStorageDomain ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > sourceActiveStorageDomains , org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel templateDisk , org.ovirt.engine.core.common.businessentities.StorageDomain sd ) { if ( sourceActiveStorageDomains.contains ( sd ) ) { return false ; } return super . allowedStorageDomain ( sourceActiveStorageDomains , diskImage , templateDisk , sd ) ; }
Source:
public void runMultipleActionFailed ( org.ovirt.engine.core.common.action.VdcActionType action , java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { java.util.List < org.ovirt.engine.core.common.action.VdcActionType > actions = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionType > ( returnValues.size ( ) ) ; java.util.Collections.fill ( actions , action ) ; runMultipleActionsFailed ( actions , returnValues ) ; }

Target:
public void runMultipleActionFailed ( org.ovirt.engine.core.common.action.VdcActionType action , java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { java.util.List < org.ovirt.engine.core.common.action.VdcActionType > actions = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionType > ( ) ; for ( int i = 0 ; i < ( returnValues.size ( ) ) ; i ++ ) { actions.add ( action ) ; } runMultipleActionsFailed ( actions , returnValues ) ; }
Source:
public void validateSpaceNotEnough ( ) throws java.lang.Exception { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; mockGetAllSnapshots ( ) ; org.junit.Assert.assertFalse ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void validateSpaceNotEnough ( ) throws java.lang.Exception { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; mockGetAllSnapshots ( ) ; org.junit.Assert.assertFalse ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public void showForm ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model ) { this . model = model ; formPanel.clear ( ) ; for ( org.ovirt.engine.ui.common.widget.form.FormItem item : formItems ) { if ( ( item.getIsAvailable ( ) ) && ( item.isVisible ( ) ) ) { formPanel.addFormItem ( item ) ; } } model.getPropertyChangedEvent ( ) . removeListener ( propertyChangedEventListener ) ; model.getPropertyChangedEvent ( ) . addListener ( propertyChangedEventListener ) ; }

Target:
public void showForm ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model ) { if ( ( this . model ) != null ) { this . model.getPropertyChangedEvent ( ) . removeListener ( propertyChangedEventListener ) ; } this . model = model ; model.getPropertyChangedEvent ( ) . addListener ( propertyChangedEventListener ) ; formPanel.clear ( ) ; for ( org.ovirt.engine.ui.common.widget.form.FormItem item : formItems ) { if ( ( item.getIsAvailable ( ) ) && ( item.isVisible ( ) ) ) { formPanel.addFormItem ( item ) ; } } }
Source:
public void testGetAllConnectionsOfIscsiDomain ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = dao.getAllForDomain ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ) ; org.junit.Assert.assertEquals ( connections.size ( ) , 2 ) ; org.junit.Assert.assertTrue ( ( ( connections.get ( 0 ) . getid ( ) . equals ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePk" ) ) || ( connections.get ( 0 ) . getid ( ) . equals ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ) ) ) ; }

Target:
public void testGetAllConnectionsOfIscsiDomain ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = dao.getAllForDomain ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ) ; org.junit.Assert.assertEquals ( connections.size ( ) , 2 ) ; org.junit.Assert.assertTrue ( ( ( connections.get ( 0 ) . getId ( ) . equals ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePk" ) ) || ( connections.get ( 0 ) . getId ( ) . equals ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ) ) ) ; }
Source:
void initMemorySizeLabels ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { this . physicalMemory = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Integer > ( constants ) ; this . usedMemory = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Integer > ( constants ) ; this . freeMemory = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Integer > ( constants ) ; this . swapTotal = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Long > ( constants ) ; this . usedSwap = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Long > ( constants ) ; this . swapFree = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Long > ( constants ) ; this . maxSchedulingMemory = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Float > ( constants ) ; }

Target:
void initMemorySizeLabels ( ) { this . physicalMemory = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Integer > ( constants ) ; this . usedMemory = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Integer > ( constants ) ; this . freeMemory = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Integer > ( constants ) ; this . swapTotal = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Long > ( constants ) ; this . usedSwap = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Long > ( constants ) ; this . swapFree = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Long > ( constants ) ; this . maxSchedulingMemory = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Float > ( constants ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VDS get ( org.ovirt.engine.core.compat.NGuid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { return getCallsHandler ( ) . executeRead ( "GetVdsByVdsId" , org.ovirt.engine.core.dao.VdsDAODbFacadeImpl.VdsRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "vds_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.VDS get ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { return getCallsHandler ( ) . executeRead ( "GetVdsByVdsId" , org.ovirt.engine.core.dao.VdsDAODbFacadeImpl.VdsRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "vds_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotaList = org.ovirt.engine.core.bll.GetQuotasConsumptionForCurrentUserQuery.getDbFacade ( ) . getQuotaDao ( ) . getQuotaByAdElementId ( org.ovirt.engine.core.bll.GetQuotasConsumptionForCurrentUserQuery.getUser ( ) . getUserId ( ) , null , true ) ; org.ovirt.engine.core.bll.GetQuotasConsumptionForCurrentUserQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . generatePerUserUsageReport ( quotaList ) ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotaList = org.ovirt.engine.core.bll.GetQuotasConsumptionForCurrentUserQuery.getDbFacade ( ) . getQuotaDao ( ) . getQuotaByAdElementId ( org.ovirt.engine.core.bll.GetQuotasConsumptionForCurrentUserQuery.getUser ( ) . getId ( ) , null , true ) ; org.ovirt.engine.core.bll.GetQuotasConsumptionForCurrentUserQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . generatePerUserUsageReport ( quotaList ) ) ; }
Source:
protected void endActionOnVmConfiguration ( ) { if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) ) != null ) { if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.VmHandler.unlockVm ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) , org.ovirt.engine.core.bll.VmCommand.getCompensationContext ( ) ) ; } throw new java.lang.RuntimeException ( "asd" ) ; } else { org.ovirt.engine.core.bll.VmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "VmCommand::EndVmCommand: Vm is null - not performing EndAction on Vm" ) ; } }

Target:
protected void unlockVm ( ) { if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) ) != null ) { if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.VmHandler.unlockVm ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) , org.ovirt.engine.core.bll.VmCommand.getCompensationContext ( ) ) ; } } else { org.ovirt.engine.core.bll.VmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "VmCommand::EndVmCommand: Vm is null - not performing EndAction on Vm" ) ; } }
Source:
public void validateFails ( ) { org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( ) ; params.setActionType ( "InvalidActionType" ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( params , null ) ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; params.setClusterId ( null ) ; params.setServerId ( null ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFails ( ) { cmd.getParameters ( ) . setActionType ( "InvalidActionType" ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void isConnWithSameDetailsExistSameConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection1 = newNFSConnection ; connections.add ( connection1 ) ; org.mockito.Mockito.when ( storageConnDao.getAllForStorage ( newNFSConnection.getconnection ( ) ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newNFSConnection ) ; org.junit.Assert.assertFalse ( isExists ) ; }

Target:
public void isConnWithSameDetailsExistSameConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection1 = newNFSConnection ; connections.add ( connection1 ) ; org.mockito.Mockito.when ( storageConnDao.getAllForStorage ( newNFSConnection.getconnection ( ) ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newNFSConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }
Source:
default void inputDetail ( ) { org.ovirt.api.metamodel.language.ApiLanguage.or ( org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( cluster ( ) . id ( ) ) , org.ovirt.api.metamodel.language.ApiLanguage.mandatory ( cluster ( ) . name ( ) ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( clone ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( exclusive ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( template ( ) . name ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( registrationConfiguration ( ) ) ; }

Target:
default void inputDetail ( ) { org.ovirt.api.metamodel.language.ApiLanguage.or ( org.ovirt.api.metamodel.language.ApiLanguage.optional ( cluster ( ) . id ( ) ) , org.ovirt.api.metamodel.language.ApiLanguage.optional ( cluster ( ) . name ( ) ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( clone ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( exclusive ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( template ( ) . name ( ) ) ; org.ovirt.api.metamodel.language.ApiLanguage.optional ( registrationConfiguration ( ) ) ; }
Source:
public void onAsyncOperationStarted ( org.ovirt.engine.ui.frontend.communication.AsyncOperationStartedEvent event ) { if ( ( ( event.getTarget ( ) ) != ( getModel ( ) ) ) || ( ( ( getModel ( ) . getProgress ( ) ) != null ) && ( ( asyncOperationCounter ) == 0 ) ) ) { return ; } if ( ( asyncOperationCounter ) == 0 ) { getModel ( ) . startProgress ( null ) ; } ( asyncOperationCounter ) ++ ; }

Target:
public void onAsyncOperationStarted ( org.ovirt.engine.ui.frontend.communication.AsyncOperationStartedEvent event ) { if ( ( ( event.getTarget ( ) ) != ( getModel ( ) ) ) || ( ( getModel ( ) . getProgress ( ) ) != null ) ) { return ; } if ( ( asyncOperationCounter ) == 0 ) { startProgress ( null ) ; } ( asyncOperationCounter ) ++ ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareLocalStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( status , name , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( localDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return localDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareLocalStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( status , name , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( localDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return localDomain ; }
Source:
public void testFetchClusterWithUnlimitedGlobalLimitation ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByClusterGuid ( FixturesTool.CLUSTER_RHEL6_ISCSI , FixturesTool.QUOTA_SPECIFIC ) ; org.junit.Assert.assertEquals ( true , ( ( quotaClusterList.size ( ) ) == 1 ) ) ; org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster = quotaClusterList.get ( 0 ) ; org.junit.Assert.assertNotNull ( quotaCluster ) ; org.junit.Assert.assertEquals ( quotaCluster.getMemSizeMB ( ) , org.ovirt.engine.core.dao.QuotaDaoTest.unlimited ) ; org.junit.Assert.assertEquals ( true , quotaCluster.getVirtualCpu ( ) . equals ( 10 ) ) ; }

Target:
public void testFetchClusterWithUnlimitedGlobalLimitation ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByClusterGuid ( FixturesTool.CLUSTER_RHEL6_ISCSI , FixturesTool.QUOTA_SPECIFIC ) ; org.junit.Assert.assertEquals ( 1 , quotaClusterList.size ( ) ) ; org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster = quotaClusterList.get ( 0 ) ; org.junit.Assert.assertNotNull ( quotaCluster ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.QuotaDaoTest.unlimited , quotaCluster.getMemSizeMB ( ) ) ; org.junit.Assert.assertEquals ( 10 , ( ( int ) ( quotaCluster.getVirtualCpu ( ) ) ) ) ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { if ( ! ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMStopTaskVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) . equals ( Guid.Empty ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMStopTask , new org.ovirt.engine.core.vdsbroker.irsbroker.HSMTaskGuidBaseVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMStopTaskVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SPMStopTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ) ; } }

Target:
protected void ExecuteIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMStopTask , new org.ovirt.engine.core.vdsbroker.irsbroker.HSMTaskGuidBaseVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMStopTaskVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SPMStopTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ) ; }
Source:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getDistributedVolume ( volumeId1 ) ) . when ( volumeDao ) . getById ( volumeId1 ) ; org.mockito.Mockito.doReturn ( getDistributedVolume ( volumeId2 ) ) . when ( volumeDao ) . getById ( volumeId2 ) ; org.mockito.Mockito.doReturn ( syncJob ) . when ( cmd ) . getSyncJobInstance ( ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getDistributedVolume ( volumeId1 ) ) . when ( volumeDao ) . getById ( volumeId1 ) ; org.mockito.Mockito.doReturn ( getDistributedVolume ( volumeId2 ) ) . when ( volumeDao ) . getById ( volumeId2 ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetRoleActionGroupsByRoleId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , org.ovirt.engine.api.restapi.resource.BackendPermitsResourceTest.setUpActionGroups ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetRoleActionGroupsByRoleId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , org.ovirt.engine.api.restapi.resource.BackendPermitsResourceTest.setUpActionGroups ( ) , failure ) ; control.replay ( ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( ) { com.google.gwt.safehtml.shared.SafeHtml tooltip = null ; if ( ( getModel ( ) . isHotPlugAvailable ( ) ) && ( ! ( getModel ( ) . getIsDiskHotPlugSupported ( ) ) ) ) { tooltip = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( org.ovirt.engine.ui.common.widget.uicommon.vm.VmDiskListModelTable.constants.diskHotPlugNotSupported ( ) ) ; } return tooltip ; }

Target:
public java.lang.String getTooltip ( ) { java.lang.String tooltip = null ; if ( ( getModel ( ) . isHotPlugAvailable ( ) ) && ( ! ( getModel ( ) . getIsDiskHotPlugSupported ( ) ) ) ) { tooltip = org.ovirt.engine.ui.common.widget.uicommon.vm.VmDiskListModelTable.constants.diskHotPlugNotSupported ( ) ; } return tooltip ; }
Source:
protected void verifyFault ( javax.ws.rs.WebApplicationException wae , java.lang.String reason , java.lang.String detail , int status ) { assertEquals ( status , wae.getResponse ( ) . getStatus ( ) ) ; assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; org.ovirt.engine.api.model.Fault fault = ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) ; assertEquals ( reason , fault.getReason ( ) ) ; assertEquals ( detail , fault.getDetail ( ) ) ; }

Target:
protected void verifyFault ( javax.ws.rs.WebApplicationException wae , java.lang.String reason , java.lang.String detail , int status ) { verifyFault ( wae , status ) ; org.ovirt.engine.api.model.Fault fault = ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) ; assertEquals ( reason , fault.getReason ( ) ) ; assertEquals ( detail , fault.getDetail ( ) ) ; }
Source:
public void createCommand ( ) { param = new org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters ( org.ovirt.engine.core.bll.network.host.UpdateHostNicVfsConfigCommandTest.NIC_ID , org.ovirt.engine.core.bll.network.host.UpdateHostNicVfsConfigCommandTest.NUM_OF_VFS , false ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.host.UpdateHostNicVfsConfigCommand ( param , null ) ) ; org.mockito.Mockito.doReturn ( validator ) . when ( command ) . getVfsConfigValidator ( ) ; org.mockito.Mockito.doReturn ( vfsConfigDao ) . when ( command ) . getVfsConfigDao ( ) ; org.mockito.Mockito.doReturn ( interfaceDao ) . when ( command ) . getInterfaceDao ( ) ; }

Target:
public void createCommand ( ) { param = new org.ovirt.engine.core.common.action.UpdateHostNicVfsConfigParameters ( org.ovirt.engine.core.bll.network.host.UpdateHostNicVfsConfigCommandTest.NIC_ID , org.ovirt.engine.core.bll.network.host.UpdateHostNicVfsConfigCommandTest.NUM_OF_VFS , false ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.host.UpdateHostNicVfsConfigCommand ( param , null ) ) ; org.mockito.Mockito.doReturn ( validator ) . when ( command ) . getVfsConfigValidator ( ) ; org.mockito.Mockito.doReturn ( vfsConfigDao ) . when ( command ) . getVfsConfigDao ( ) ; }
Source:
public org.springframework.jdbc.core.namedparam.MapSqlParameterSource addValue ( java.lang.String paramName , java.lang.Object value ) { java.lang.Object tmpValue = value ; if ( tmpValue != null ) { if ( tmpValue.getClass ( ) . isEnum ( ) ) { tmpValue = org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource.extractEnumValue ( tmpValue ) ; } else if ( ( tmpValue instanceof org.ovirt.engine.core.compat.NGuid ) || ( tmpValue instanceof org.ovirt.engine.core.compat.Version ) ) { tmpValue = value.toString ( ) ; } } return super . addValue ( ( ( dialect.getParamNamePrefix ( ) ) + paramName ) , tmpValue ) ; }

Target:
public org.springframework.jdbc.core.namedparam.MapSqlParameterSource addValue ( java.lang.String paramName , java.lang.Object value ) { java.lang.Object tmpValue = value ; if ( tmpValue != null ) { if ( tmpValue.getClass ( ) . isEnum ( ) ) { tmpValue = org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource.extractEnumValue ( tmpValue ) ; } else if ( ( tmpValue instanceof org.ovirt.engine.core.compat.Guid ) || ( tmpValue instanceof org.ovirt.engine.core.compat.Version ) ) { tmpValue = value.toString ( ) ; } } return super . addValue ( ( ( dialect.getParamNamePrefix ( ) ) + paramName ) , tmpValue ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Quota > getQuotaByAdElementId ( org.ovirt.engine.core.compat.Guid adElementId , org.ovirt.engine.core.compat.Guid storagePoolId , boolean recursive ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource ( ) ; quotaParameterSource.addValue ( "ad_element_id" , adElementId ) ; quotaParameterSource.addValue ( "storage_pool_id" , storagePoolId ) ; quotaParameterSource.addValue ( "recursive" , recursive ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotaEntityList = getCallsHandler ( ) . executeReadList ( "GetQuotaByAdElementId" , getQuotaMetaDataFromResultSet ( ) , quotaParameterSource ) ; return quotaEntityList ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Quota > getQuotaByAdElementId ( org.ovirt.engine.core.compat.Guid adElementId , org.ovirt.engine.core.compat.Guid storagePoolId , boolean recursive ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource ( ) ; quotaParameterSource.addValue ( "ad_element_id" , adElementId ) ; quotaParameterSource.addValue ( "storage_pool_id" , storagePoolId ) ; quotaParameterSource.addValue ( "recursive" , recursive ) ; return getCallsHandler ( ) . executeReadList ( "GetQuotaByAdElementId" , getQuotaMetaDataFromResultSet ( ) , quotaParameterSource ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VM getVm ( ) { if ( ( ( diskVm ) == null ) && ( ( getDisk ( ) ) != null ) ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : org.ovirt.engine.core.bll.GetDiskAlignmentCommand.getVmDAO ( ) . getVmsListForDisk ( getDisk ( ) . getId ( ) ) ) { diskVm = vm ; break ; } } return diskVm ; }

Target:
public org.ovirt.engine.core.common.businessentities.VM getVm ( ) { if ( ( ( diskVm ) == null ) && ( ( getDisk ( ) ) != null ) ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : org.ovirt.engine.core.bll.GetDiskAlignmentCommand.getVmDAO ( ) . getVmsListForDisk ( getDisk ( ) . getId ( ) , false ) ) { diskVm = vm ; break ; } } return diskVm ; }
Source:
private void applyStyles ( ) { hostCpuEditor.addContentWidgetStyleName ( style.longCheckboxContent ( ) ) ; allowConsoleReconnectEditor.addContentWidgetStyleName ( style.longCheckboxContent ( ) ) ; provisioningEditor.addContentWidgetStyleName ( style.provisioningEditorContent ( ) ) ; provisioningThinEditor.addContentWidgetStyleName ( style.provisioningRadioContent ( ) ) ; provisioningCloneEditor.addContentWidgetStyleName ( style.provisioningRadioContent ( ) ) ; cdAttachedEditor.addContentWidgetStyleName ( style.cdAttachedLabelWidth ( ) ) ; }

Target:
protected void applyStyles ( ) { hostCpuEditor.addContentWidgetStyleName ( style.longCheckboxContent ( ) ) ; allowConsoleReconnectEditor.addContentWidgetStyleName ( style.longCheckboxContent ( ) ) ; provisioningEditor.addContentWidgetStyleName ( style.provisioningEditorContent ( ) ) ; provisioningThinEditor.addContentWidgetStyleName ( style.provisioningRadioContent ( ) ) ; provisioningCloneEditor.addContentWidgetStyleName ( style.provisioningRadioContent ( ) ) ; cdAttachedEditor.addContentWidgetStyleName ( style.cdAttachedLabelWidth ( ) ) ; }
Source:
private void updateSnapshotsFromExport ( ) { if ( ( getVm ( ) . getSnapshots ( ) ) == null ) { return ; } for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getVm ( ) . getSnapshots ( ) ) { if ( org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . exists ( getVm ( ) . getId ( ) , snapshot.getId ( ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . update ( snapshot ) ; } else { org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . save ( snapshot ) ; } } }

Target:
private void updateSnapshotsFromExport ( ) { if ( ( org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) . getSnapshots ( ) ) == null ) { return ; } for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) . getSnapshots ( ) ) { if ( org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . exists ( org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) . getId ( ) , snapshot.getId ( ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . update ( snapshot ) ; } else { org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . save ( snapshot ) ; } } }
Source:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute sync getIsUserLoggedIn: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.OnFailure ( null ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute sync getIsUserLoggedIn: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.onFailure ( null ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > ) ( returnValue ) ) ; providers.add ( 0 , null ) ; getProviders ( ) . setItems ( providers ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > providers ) { stopProgress ( ) ; providers.add ( 0 , null ) ; getProviders ( ) . setItems ( providers ) ; }
Source:
private java.lang.String extractRpmVersion ( java.lang.String rpmName ) { java.util.regex.Matcher matchToolPattern = org.ovirt.engine.core.compat.RpmVersion.rpmCompiled.matcher ( rpmName ) ; java.lang.String rawString = null ; if ( ( matchToolPattern.find ( ) ) && ( ( matchToolPattern.groupCount ( ) ) > 1 ) ) { rawString = matchToolPattern.group ( 2 ) ; return org.ovirt.engine.core.compat.RpmVersion.extractRpmVersion ( rawString.toCharArray ( ) ) ; } return null ; }

Target:
private java.lang.String extractRpmVersion ( java.lang.String rpmName ) { if ( ( rpmName == null ) || ( rpmName.isEmpty ( ) ) ) { return rpmName ; } java.util.regex.Matcher matchToolPattern = org.ovirt.engine.core.compat.RpmVersion.rpmCompiled.matcher ( rpmName ) ; java.lang.String rawString = null ; if ( ( matchToolPattern.find ( ) ) && ( ( matchToolPattern.groupCount ( ) ) > 1 ) ) { rawString = matchToolPattern.group ( 2 ) ; return extractRpmVersion ( rawString.toCharArray ( ) ) ; } return null ; }
Source:
private org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand < org.ovirt.engine.core.common.vdscommands.SetupNetworksVdsCommandParameters > createCommand ( org.ovirt.engine.core.common.vdscommands.SetupNetworksVdsCommandParameters parameters ) { final org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacade = org.mockito.Mockito.mock ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class ) ; final org.ovirt.engine.core.dao.VdsDAO vdsDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDAO.class ) ; org.mockito.Mockito.when ( dbFacade.getVdsDAO ( ) ) . thenReturn ( vdsDao ) ; return org.mockito.Mockito.spy ( new org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand < org.ovirt.engine.core.common.vdscommands.SetupNetworksVdsCommandParameters > ( parameters ) { @ java.lang.Override protected org.ovirt.engine.core.vdsbroker.vdsbroker.IVdsServer initializeVdsBroker ( org.ovirt.engine.core.compat.Guid vdsId ) { return server ; } @ java.lang.Override protected org.ovirt.engine.core.dal.dbbroker.DbFacade getDbFacade ( ) { return dbFacade ; } } ) ; }

Target:
private org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand < org.ovirt.engine.core.common.vdscommands.SetupNetworksVdsCommandParameters > createCommand ( org.ovirt.engine.core.common.vdscommands.SetupNetworksVdsCommandParameters parameters ) { final org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacade = org.mockito.Mockito.mock ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class ) ; final org.ovirt.engine.core.dao.VdsDAO vdsDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDAO.class ) ; org.mockito.Mockito.when ( dbFacade.getVdsDAO ( ) ) . thenReturn ( vdsDao ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand < org.ovirt.engine.core.common.vdscommands.SetupNetworksVdsCommandParameters > ( parameters ) { @ java.lang.Override protected org.ovirt.engine.core.vdsbroker.vdsbroker.IVdsServer initializeVdsBroker ( org.ovirt.engine.core.compat.Guid vdsId ) { return server ; } @ java.lang.Override protected org.ovirt.engine.core.dal.dbbroker.DbFacade getDbFacade ( ) { return dbFacade ; } } ; }
Source:
private void addContentToWestPanel ( org.ovirt.engine.ui.webadmin.uicommon.model.SystemTreeModelProvider treeModelProvider , org.ovirt.engine.ui.webadmin.uicommon.model.BookmarkModelProvider bookmarkModelProvider , org.ovirt.engine.ui.webadmin.uicommon.model.TagModelProvider tagModelProvider , final com.google.gwt.user.client.ui.StackLayoutPanel panel , org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { panel.insert ( new org.ovirt.engine.ui.webadmin.widget.tree.SystemTree ( treeModelProvider , constants ) , treeHeader , org.ovirt.engine.ui.webadmin.section.main.view.MainSectionView.SECTION_HEADER_HEIGHT , panel.getWidgetCount ( ) ) ; panel.insert ( new org.ovirt.engine.ui.webadmin.widget.bookmark.BookmarkList ( bookmarkModelProvider , constants ) , bookmarksHeader , org.ovirt.engine.ui.webadmin.section.main.view.MainSectionView.SECTION_HEADER_HEIGHT , panel.getWidgetCount ( ) ) ; panel.insert ( new org.ovirt.engine.ui.webadmin.widget.tags.TagList ( tagModelProvider , constants ) , tagsHeader , org.ovirt.engine.ui.webadmin.section.main.view.MainSectionView.SECTION_HEADER_HEIGHT , panel.getWidgetCount ( ) ) ; }

Target:
private void addContentToWestPanel ( org.ovirt.engine.ui.webadmin.uicommon.model.SystemTreeModelProvider treeModelProvider , org.ovirt.engine.ui.webadmin.uicommon.model.BookmarkModelProvider bookmarkModelProvider , org.ovirt.engine.ui.webadmin.uicommon.model.TagModelProvider tagModelProvider , final com.google.gwt.user.client.ui.StackLayoutPanel panel ) { panel.insert ( new org.ovirt.engine.ui.webadmin.widget.tree.SystemTree ( treeModelProvider ) , treeHeader , org.ovirt.engine.ui.webadmin.section.main.view.MainSectionView.SECTION_HEADER_HEIGHT , panel.getWidgetCount ( ) ) ; panel.insert ( new org.ovirt.engine.ui.webadmin.widget.bookmark.BookmarkList ( bookmarkModelProvider ) , bookmarksHeader , org.ovirt.engine.ui.webadmin.section.main.view.MainSectionView.SECTION_HEADER_HEIGHT , panel.getWidgetCount ( ) ) ; panel.insert ( new org.ovirt.engine.ui.webadmin.widget.tags.TagList ( tagModelProvider ) , tagsHeader , org.ovirt.engine.ui.webadmin.section.main.view.MainSectionView.SECTION_HEADER_HEIGHT , panel.getWidgetCount ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < > ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) . getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) . getActualSize ( ) ) ) ; return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < > ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) . getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getDiskImage ( ) . getActualSize ( ) ) ) ; return list ; }
Source:
private org.ovirt.engine.core.searchbackend.SqlInjectionChecker getSqlInjectionChecker ( ) throws java.lang.Exception { if ( ( ( java.lang.String ) ( org.ovirt.engine.core.common.config.Config.GetValue ( ConfigValues.DBEngine ) ) ) . equalsIgnoreCase ( "postgres" ) ) { return new org.ovirt.engine.core.searchbackend.PostgresSqlInjectionChecker ( ) ; } else { throw new java.lang.IllegalStateException ( ( "Failed to get correct sql injection checker instance name :" + ( org.ovirt.engine.core.searchbackend.SqlInjectionChecker.class ) ) ) ; } }

Target:
private org.ovirt.engine.core.searchbackend.SqlInjectionChecker getSqlInjectionChecker ( ) throws java.lang.Exception { if ( ( ( java.lang.String ) ( org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DBEngine ) ) ) . equalsIgnoreCase ( "postgres" ) ) { return new org.ovirt.engine.core.searchbackend.PostgresSqlInjectionChecker ( ) ; } else { throw new java.lang.IllegalStateException ( ( "Failed to get correct sql injection checker instance name :" + ( org.ovirt.engine.core.searchbackend.SqlInjectionChecker.class ) ) ) ; } }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected boolean validateSuffix ( java.lang.String suffix , org.ovirt.engine.ui.uicommonweb.models.EntityModel entityModel ) { for ( java.lang.Object object : objectsInSetupMap.values ( ) ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( object ) ) ; if ( ! ( validateName ( ( ( template.getname ( ) ) + suffix ) , template.getos ( ) , entityModel ) ) ) { return false ; } } return true ; }

Target:
protected boolean validateSuffix ( java.lang.String suffix , org.ovirt.engine.ui.uicommonweb.models.EntityModel entityModel ) { for ( java.lang.Object object : objectsInSetupMap.values ( ) ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( object ) ) ; if ( ! ( validateName ( ( ( template.getname ( ) ) + suffix ) , template , entityModel ) ) ) { return false ; } } return true ; }
Source:
public void testRemoveHost ( ) { java.lang.String plugin = "OVS" ; java.lang.String hostId = "bee5-1590d-bee5-15g00d" ; java.util.Map < java.lang.String , java.lang.Object > values = new java.util.HashMap ( ) ; values.put ( plugin , hostId ) ; dao.update ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 , values ) ; java.lang.String result = dao.get ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 , plugin ) ; org.junit.Assert.assertEquals ( result , hostId ) ; vdsStaticDao.remove ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 ) ; java.lang.String result2 = dao.get ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 , plugin ) ; org.junit.Assert.assertNull ( result2 ) ; }

Target:
public void testRemoveHost ( ) { java.lang.String plugin = "OVS" ; java.lang.String hostId = "bee5-1590d-bee5-15g00d" ; java.util.Map < java.lang.String , java.lang.Object > values = new java.util.HashMap ( ) ; values.put ( plugin , hostId ) ; dao.update ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 , values ) ; java.lang.String result = dao.get ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 , plugin ) ; org.junit.Assert.assertEquals ( hostId , result ) ; vdsStaticDao.remove ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 ) ; java.lang.String result2 = dao.get ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 , plugin ) ; org.junit.Assert.assertNull ( result2 ) ; }
Source:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue RunQuery ( org.ovirt.engine.core.common.queries.VdcQueryType search , org.ovirt.engine.core.common.queries.VdcQueryParametersBase searchParameters ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunQuery invoked!" ) ; debugQuery ( search , searchParameters ) ; searchParameters.setSessionId ( getSession ( ) . getId ( ) ) ; return getBackend ( ) . runQuery ( search , searchParameters ) ; }

Target:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue runQuery ( org.ovirt.engine.core.common.queries.VdcQueryType search , org.ovirt.engine.core.common.queries.VdcQueryParametersBase searchParameters ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunQuery invoked!" ) ; debugQuery ( search , searchParameters ) ; searchParameters.setSessionId ( getSession ( ) . getId ( ) ) ; return getBackend ( ) . runQuery ( search , searchParameters ) ; }
Source:
private org.ovirt.engine.core.dao.ClusterDao mockCluster ( ) { org.ovirt.engine.core.dao.ClusterDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.ClusterDao.class ) ; cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setEmulatedMachine ( "pc-1.0" ) ; cluster.getRequiredRngSources ( ) . add ( VmRngDevice.Source.RANDOM ) ; cluster.setCompatibilityVersion ( Version.v3_5 ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( cluster ) ; return mock ; }

Target:
private org.ovirt.engine.core.dao.ClusterDao mockCluster ( ) { org.ovirt.engine.core.dao.ClusterDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.ClusterDao.class ) ; cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setEmulatedMachine ( "pc-1.0" ) ; cluster.getRequiredRngSources ( ) . add ( VmRngDevice.Source.RANDOM ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( cluster ) ; return mock ; }
Source:
public void hostProviderTypeMatches ( ) { org.mockito.Mockito.when ( host.getHostProviderId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.Provider provider = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Provider.class ) ; org.mockito.Mockito.when ( provider.getType ( ) ) . thenReturn ( ProviderType.FOREMAN ) ; org.mockito.Mockito.when ( providerDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( provider ) ; org.junit.Assert.assertThat ( validator.hostProviderTypeMatches ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void hostProviderTypeMatches ( ) { org.mockito.Mockito.when ( host.getHostProviderId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.Provider provider = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Provider.class ) ; org.mockito.Mockito.when ( provider.getType ( ) ) . thenReturn ( ProviderType.FOREMAN ) ; org.mockito.Mockito.when ( providerDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( provider ) ; org.junit.Assert.assertThat ( validator.hostProviderTypeMatches ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static void isAnyHostUpInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( ( source != null ) && ( ( ( ( java.util.List ) ( source ) ) . size ( ) ) > 0 ) ) { return true ; } return false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , 1 ) ; }

Target:
public static void isAnyHostUpInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( ( source != null ) && ( ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ) ) { return true ; } return false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , 1 ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . removeQuotaFromCache ( getQuota ( ) . getStoragePoolId ( ) , getQuota ( ) . getId ( ) ) ; setQuotaParameter ( ) ; org.ovirt.engine.core.dao.QuotaDAO dao = getQuotaDAO ( ) ; dao.update ( getParameters ( ) . getQuota ( ) ) ; getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
protected void removeQuotaFromCache ( ) { org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . removeQuotaFromCache ( getQuota ( ) . getStoragePoolId ( ) , getQuota ( ) . getId ( ) ) ; }