auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testLogReturnLogsWhenLogLevelActiveAndNoExpandReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isInfoEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclassNoReturn ( ) , new java.lang.Object ( ) ) ; org.mockito.Mockito.verify ( log ) . info ( org.mockito.ArgumentMatchers.eq ( LoggedUtils.EXIT_LOG_VOID ) , new java.lang.Object [ ] { org.mockito.ArgumentMatchers.anyObject ( ) , org.mockito.ArgumentMatchers.eq ( id ) } ) ; }

Target:
public void testLogReturnLogsWhenLogLevelActiveAndNoExpandReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isInfoEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclassNoReturn ( ) , new java.lang.Object ( ) ) ; org.mockito.Mockito.verify ( log ) . info ( org.mockito.ArgumentMatchers.eq ( LoggedUtils.EXIT_LOG_VOID ) , new java.lang.Object [ ] { org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.eq ( id ) } ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isDomainExistAndActive ( ) { if ( ( storageDomain ) == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } if ( ( ( storageDomain.getstatus ( ) ) == null ) || ( ( storageDomain.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isDomainExistAndActive ( ) { if ( ( storageDomain ) == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } if ( ( ( storageDomain.getStatus ( ) ) == null ) || ( ( storageDomain.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void testGetRootDSENoReachableLdapServers ( ) throws java.lang.Exception { java.util.List < java.net.URI > urls = new java.util.ArrayList < java.net.URI > ( ) ; urls.add ( new java.net.URI ( org.ovirt.engine.core.bll.adbroker.DirectorySearcherTest.BAD_URL ) ) ; org.ovirt.engine.core.bll.adbroker.DirectorySearcher dirSearcher = mockDirectorySearcher ( urls ) ; try { org.ovirt.engine.core.bll.adbroker.DirectorySearcherTest.execute ( new org.ovirt.engine.core.bll.adbroker.GetRootDSETask ( dirSearcher , "mydomain" , urls.get ( 0 ) ) ) ; } catch ( java.util.concurrent.TimeoutException ok ) { return ; } org.junit.Assert.fail ( "Task ended with error which is not timout or no error at all" ) ; }

Target:
public void testGetRootDSENoReachableLdapServers ( ) throws java.lang.Exception { java.util.List < java.net.URI > urls = new java.util.ArrayList < java.net.URI > ( ) ; urls.add ( new java.net.URI ( org.ovirt.engine.core.bll.adbroker.DirectorySearcherTest.BAD_URL ) ) ; org.ovirt.engine.core.bll.adbroker.DirectorySearcher dirSearcher = mockDirectorySearcher ( urls ) ; org.ovirt.engine.core.bll.adbroker.DirectorySearcherTest.execute ( new org.ovirt.engine.core.bll.adbroker.GetRootDSETask ( dirSearcher , "mydomain" , urls.get ( 0 ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object returnValue ) { this . postInitQosList ( ( returnValue == null ? new java.util.ArrayList < Q > ( ) : ( ( java.util.List < Q > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { postInitQosList ( ( returnValue == null ? new java.util.ArrayList < Q > ( ) : ( ( java.util.List < Q > ) ( returnValue.getReturnValue ( ) ) ) ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool > dataCenters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool dataCenter : dataCenters ) { reportModel.addDataCenterID ( dataCenter.getId ( ) . toString ( ) ) ; } if ( reportModel == null ) { return ; } setWidgetModel ( reportModel ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool > dataCenters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool dataCenter : dataCenters ) { reportModel.addDataCenterID ( dataCenter.getId ( ) . toString ( ) ) ; } if ( reportModel == null ) { return ; } setWidgetModel ( reportModel ) ; }
Source:
public void testNonExistingSnapshotQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = setupQueryBySnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( snapshotDaoMock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = query.getQueryReturnValue ( ) ; org.ovirt.engine.core.common.businessentities.VM returnedVm = returnValue.getReturnValue ( ) ; org.junit.Assert.assertNull ( "Return value from non existent query should be null" , returnedVm ) ; }

Target:
public void testNonExistingSnapshotQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = setupQueryBySnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = query.getQueryReturnValue ( ) ; org.ovirt.engine.core.common.businessentities.VM returnedVm = returnValue.getReturnValue ( ) ; org.junit.Assert.assertNull ( "Return value from non existent query should be null" , returnedVm ) ; }
Source:
protected void EndMoveVmCommand ( ) { org.ovirt.engine.core.bll.MoveVmCommand.EndActionOnAllImageGroups ( ) ; if ( ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) ; UpdateVmImSpm ( ) ; } else { org.ovirt.engine.core.bll.MoveVmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveVmCommand::EndMoveVmCommand: Vm is null - not performing full EndAction" ) ; } org.ovirt.engine.core.bll.MoveVmCommand.setSucceeded ( true ) ; }

Target:
protected void EndMoveVmCommand ( ) { org.ovirt.engine.core.bll.MoveVmCommand.EndActionOnAllImageGroups ( ) ; if ( ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) ; UpdateVmImSpm ( ) ; } else { org.ovirt.engine.core.bll.MoveVmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveVmCommand::EndMoveVmCommand: Vm is null - not performing full EndAction" ) ; } org.ovirt.engine.core.bll.MoveVmCommand.setSucceeded ( true ) ; }
Source:
public void canDoActionPreallocatedSpaceCheckSucceeds ( ) { final int availableSize = 12 ; final int usedSize = 8 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; org.ovirt.engine.core.common.businessentities.storage_domains domains = mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; mockStorageDomainSpaceCheckerRequest ( domains , true ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void canDoActionPreallocatedSpaceCheckSucceeds ( ) { final int availableSize = 12 ; final int usedSize = 8 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; org.ovirt.engine.core.common.businessentities.storage_domains domains = mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }
Source:
public void prepareParams ( ) { parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; parameters.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.AddStorageServerConnectionCommand < org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase > ( parameters ) ) ; org.mockito.Mockito.doReturn ( storageConnDao ) . when ( command ) . getStorageConnDao ( ) ; }

Target:
public void prepareParams ( ) { parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.AddStorageServerConnectionCommand < org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase > ( parameters ) ) ; org.mockito.Mockito.doReturn ( storageConnDao ) . when ( command ) . getStorageConnDao ( ) ; }
Source:
public void setUp ( ) { super . setUp ( ) ; org.mockito.Mockito.doNothing ( ) . when ( cmd ) . initTemplateDisks ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . checkNumberOfMonitors ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateCustomProperties ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; initCommandMethods ( ) ; initDestSDs ( ) ; generateStorageToDisksMap ( ) ; cmd.init ( ) ; }

Target:
public void setUp ( ) { super . setUp ( ) ; org.mockito.Mockito.doNothing ( ) . when ( cmd ) . initTemplateDisks ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . checkNumberOfMonitors ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateCustomProperties ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; initCommandMethods ( ) ; initDestSDs ( ) ; generateStorageToDisksMap ( ) ; cmd.init ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.List < java.lang.String > images = ( ( java.util.List < java.lang.String > ) ( returnValue ) ) ; getIso ( ) . setItems ( images ) ; getIso ( ) . setSelectedItem ( tryToFindVirtioTools ( images ) ) ; }

Target:
public void onSuccess ( java.util.List < java.lang.String > images ) { getIso ( ) . setItems ( images ) ; getIso ( ) . setSelectedItem ( tryToFindVirtioTools ( images ) ) ; }
Source:
protected boolean CheckStoragePoolStatusNotEqual ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus status , org.ovirt.engine.core.dal.VdcBllMessages onFailMessage ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ; if ( storagePool != null ) { returnValue = ( storagePool.getstatus ( ) ) != status ; if ( ( ! returnValue ) && ( ! ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( onFailMessage.name ( ) ) ) ) ) { addCanDoActionMessage ( onFailMessage ) ; } } return returnValue ; }

Target:
protected boolean CheckStoragePoolStatusNotEqual ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus status , org.ovirt.engine.core.dal.VdcBllMessages onFailMessage ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ; if ( storagePool != null ) { returnValue = ( storagePool.getstatus ( ) ) != status ; if ( ( ! returnValue ) && ( ! ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( onFailMessage.name ( ) ) ) ) ) { addCanDoActionMessage ( onFailMessage ) ; } } return returnValue ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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 ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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 ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void updateCustomPropertySheet ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; getModel ( ) . getCustomPropertySheet ( ) . setKeyValueString ( getModel ( ) . getCustomPropertiesKeysList ( ) . get ( cluster.getcompatibility_version ( ) ) ) ; }

Target:
protected void updateCustomPropertySheet ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; if ( ( getModel ( ) . getCustomPropertiesKeysList ( ) ) != null ) { getModel ( ) . getCustomPropertySheet ( ) . setKeyValueString ( getModel ( ) . getCustomPropertiesKeysList ( ) . get ( cluster.getcompatibility_version ( ) ) ) ; } }
Source:
public void setUp ( ) { initializeOsRepository ( 1 , DiskInterface.VirtIO ) ; disk = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createDiskImage ( ) ; disk.setDiskAlias ( "disk1" ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( validator ) . getVmDao ( ) ; }

Target:
public void setUp ( ) { initializeOsRepository ( 1 , DiskInterface.VirtIO ) ; disk = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createDiskImage ( ) ; disk.setDiskAlias ( "disk1" ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( validator ) . getVmDao ( ) ; }
Source:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { nameEditor.setLabel ( constants.import_newName ( ) ) ; suffixEditor.setLabel ( constants.import_cloneSuffix ( ) ) ; selectLabelEditor.setText ( constants.cloneSelect ( ) ) ; applyToAllEditor.setLabel ( constants.cloneApplyToAll ( ) ) ; noCloneEditor.setLabel ( constants.cloneDontImport ( ) ) ; cloneEditor.setLabel ( constants.clone ( ) ) ; }

Target:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { nameEditor.setLabel ( constants.import_newName ( ) ) ; selectLabelEditor.setText ( constants.cloneSelect ( ) ) ; applyToAllEditor.setLabel ( constants.cloneApplyToAll ( ) ) ; noCloneEditor.setLabel ( constants.cloneDontImport ( ) ) ; }
Source:
public void checkExecuteCommandWithVdsId ( ) { parameters.setStorageServerConnection ( NFSConnection ) ; org.mockito.Mockito.doNothing ( ) . when ( storageServerConnectionDao ) . remove ( NFSConnection.getId ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . disconnectStorage ( ) ; command.executeCommand ( ) ; }

Target:
public void checkExecuteCommandWithVdsId ( ) { parameters.setStorageServerConnection ( NFSConnection ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . disconnectStorage ( ) ; command.executeCommand ( ) ; }
Source:
public void unmanagedNetworkNotSynced ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , "net" ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( nic ) ) ; validateAndExpectNoViolations ( helper ) ; junit.framework.Assert.assertTrue ( helper.getNetworks ( ) . isEmpty ( ) ) ; }

Target:
public void unmanagedNetworkNotSynced ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , "net" ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( nic ) ) ; validateAndExpectNoViolations ( helper ) ; junit.framework.Assert.assertTrue ( helper.getNetworks ( ) . isEmpty ( ) ) ; }
Source:
protected void updateCpuProfile ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion , org.ovirt.engine.core.compat.Guid cpuProfileId ) { if ( java.lang.Boolean.TRUE.equals ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.CpuQosSupported , clusterCompatibilityVersion.getValue ( ) ) ) ) { getModel ( ) . getCpuProfiles ( ) . setIsAvailable ( true ) ; fetchCpuProfiles ( clusterId , cpuProfileId ) ; } else { getModel ( ) . getCpuProfiles ( ) . setIsAvailable ( false ) ; } }

Target:
protected void updateCpuProfile ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid cpuProfileId ) { getModel ( ) . getCpuProfiles ( ) . setIsAvailable ( true ) ; fetchCpuProfiles ( clusterId , cpuProfileId ) ; }
Source:
public void testSelfAndIdentifyEquality ( ) { org.ovirt.engine.core.compat.Guid vmId = new org.ovirt.engine.core.compat.Guid ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2463" ) ; org.ovirt.engine.core.compat.Guid deviceId = new org.ovirt.engine.core.compat.Guid ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2464" ) ; org.ovirt.engine.core.common.businessentities.VmDevice device1 = createVmDevice ( deviceId , vmId ) ; org.junit.Assert.assertTrue ( ( ( device1.compareTo ( device1 ) ) == 0 ) ) ; org.ovirt.engine.core.common.businessentities.VmDevice device2 = createVmDevice ( deviceId , vmId ) ; org.junit.Assert.assertTrue ( ( ( device1.compareTo ( device2 ) ) == 0 ) ) ; }

Target:
public void testSelfAndIdentifyEquality ( ) { org.ovirt.engine.core.compat.Guid vmId = new org.ovirt.engine.core.compat.Guid ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2463" ) ; org.ovirt.engine.core.compat.Guid deviceId = new org.ovirt.engine.core.compat.Guid ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2464" ) ; org.ovirt.engine.core.common.businessentities.VmDevice device1 = createVmDevice ( deviceId , vmId ) ; org.junit.Assert.assertEquals ( 0 , device1.compareTo ( device1 ) ) ; org.ovirt.engine.core.common.businessentities.VmDevice device2 = createVmDevice ( deviceId , vmId ) ; org.junit.Assert.assertEquals ( 0 , device1.compareTo ( device2 ) ) ; }
Source:
public void setItems ( java.util.Collection value ) { if ( value == null ) { super . setItems ( null ) ; return ; } java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.Disk > cast ( value ) ; super . setItems ( disks ) ; }

Target:
public void setItems ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { if ( disks == null ) { super . setItems ( null ) ; return ; } super . setItems ( disks ) ; }
Source:
public void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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 ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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 ) { return source != null ? new java.util.ArrayList < > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private void checkVmNetworkIsSoleAssignedInterface ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , org.ovirt.engine.core.common.businessentities.network.Network ... networks ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure = new java.util.ArrayList ( networks.length ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : networks ) { attachmentsToConfigure.add ( createNetworkAttachment ( "a" , network ) ) ; } org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator validator = new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( attachmentsToConfigure , networkMap ) ; org.junit.Assert.assertThat ( validator.validateNetworkExclusiveOnNics ( ) , matcher ) ; }

Target:
private void checkVmNetworkIsSoleAssignedInterface ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , org.ovirt.engine.core.common.businessentities.network.Network ... networks ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure = new java.util.ArrayList ( networks.length ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : networks ) { attachmentsToConfigure.add ( createNetworkAttachment ( nic.getName ( ) , network ) ) ; } org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator validator = new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( attachmentsToConfigure , networkMap ) ; org.junit.Assert.assertThat ( validator.validateNetworkExclusiveOnNics ( ) , matcher ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > mapHosts ( java.util.List < org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost > foremanHosts ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( foremanHosts.size ( ) ) ; for ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost host : foremanHosts ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsName ( host.getName ( ) ) ; vds.setHostName ( host.getName ( ) ) ; hosts.add ( vds ) ; } return hosts ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > mapHosts ( java.util.List < org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost > foremanHosts ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = new java.util.ArrayList ( foremanHosts.size ( ) ) ; for ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost host : foremanHosts ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsName ( host.getName ( ) ) ; vds.setHostName ( host.getName ( ) ) ; hosts.add ( vds ) ; } return hosts ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetAllRelevantQuotasForVdsGroupQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetAllRelevantQuotasForVdsGroupQuery.getDbFacade ( ) . getQuotaDao ( ) . getAllRelevantQuotasForVdsGroup ( org.ovirt.engine.core.bll.GetAllRelevantQuotasForVdsGroupQuery.getParameters ( ) . getVdsGroupId ( ) , org.ovirt.engine.core.bll.GetAllRelevantQuotasForVdsGroupQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllRelevantQuotasForVdsGroupQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetAllRelevantQuotasForVdsGroupQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetAllRelevantQuotasForVdsGroupQuery.getDbFacade ( ) . getQuotaDao ( ) . getAllRelevantQuotasForVdsGroup ( org.ovirt.engine.core.bll.GetAllRelevantQuotasForVdsGroupQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetAllRelevantQuotasForVdsGroupQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllRelevantQuotasForVdsGroupQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public void setup ( ) { org.mockito.Mockito.doReturn ( diskValidator ) . when ( command ) . getDiskValidator ( disk ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskValidator ) . isDiskExists ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskValidator ) . isDiskAttachedToVm ( vmId ) ; }

Target:
public void setup ( ) { org.mockito.Mockito.doReturn ( diskValidator ) . when ( command ) . getDiskValidator ( disk ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskValidator ) . isDiskExists ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( diskValidator ) . isDiskAttachedToVm ( vm ) ; }
Source:
public void unsyncedNetworkModified ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBridged ( ( ! ( net.isVmNetwork ( ) ) ) ) ; nic.setBootProtocol ( NetworkBootProtocol.None ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; nic.setBootProtocol ( NetworkBootProtocol.Dhcp ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORKS_NOT_IN_SYNC ) ; }

Target:
public void unsyncedNetworkModified ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBridged ( ( ! ( net.isVmNetwork ( ) ) ) ) ; nic.setBootProtocol ( NetworkBootProtocol.None ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; nic.setBootProtocol ( NetworkBootProtocol.Dhcp ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORKS_NOT_IN_SYNC , net.getName ( ) ) ; }
Source:
public void testFetchVmDisks ( ) throws java.io.IOException { try { org.ovirt.engine.core.utils.ovf.xml.XmlDocument xmlDocument = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( getXmlOvfData ( ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > disks = org.ovirt.engine.core.utils.OvfUtils.fetchVmDisks ( xmlDocument ) ; org.junit.Assert.assertNotNull ( "The list of disks should not be null" , disks ) ; org.junit.Assert.assertTrue ( "The list of disks should not be empty" , ( ! ( disks.isEmpty ( ) ) ) ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; } }

Target:
public void testFetchVmDisks ( ) throws java.lang.Exception { org.ovirt.engine.core.utils.ovf.xml.XmlDocument xmlDocument = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( getXmlOvfData ( ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > disks = org.ovirt.engine.core.utils.OvfUtils.fetchVmDisks ( xmlDocument ) ; org.junit.Assert.assertNotNull ( "The list of disks should not be null" , disks ) ; org.junit.Assert.assertTrue ( "The list of disks should not be empty" , ( ! ( disks.isEmpty ( ) ) ) ) ; }
Source:
public boolean getIsDiskHotPlugSupported ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; boolean isVmStatusApplicableForHotPlug = ( vm != null ) && ( ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) | ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) ) ; return ( privateIsDiskHotPlugSupported ) && isVmStatusApplicableForHotPlug ; }

Target:
public boolean getIsDiskHotPlugSupported ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; boolean isVmStatusApplicableForHotPlug = ( vm != null ) && ( ( ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) ) ; return ( privateIsDiskHotPlugSupported ) && isVmStatusApplicableForHotPlug ; }
Source:
private void mockStorageDomainDAOGetForStoragePool ( int domainSpaceGB ) { org.mockito.Mockito.when ( sdDAO.getForStoragePool ( org.mockito.Matchers.< org.ovirt.engine.core.compat.Guid > any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.< org.ovirt.engine.core.compat.NGuid > any ( org.ovirt.engine.core.compat.NGuid.class ) ) ) . thenReturn ( createStorageDomain ( domainSpaceGB ) ) ; }

Target:
private void mockStorageDomainDAOGetForStoragePool ( int domainSpaceGB ) { org.mockito.Mockito.when ( sdDAO.getForStoragePool ( org.mockito.Matchers.< org.ovirt.engine.core.compat.Guid > any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.< org.ovirt.engine.core.compat.Guid > any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( createStorageDomain ( domainSpaceGB ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus parse ( java.lang.CharSequence text ) throws java.text.ParseException { return org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus.valueOf ( text.toString ( ) . toUpperCase ( ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus parse ( java.lang.CharSequence text ) throws java.text.ParseException { if ( ( text == null ) || ( text.toString ( ) . isEmpty ( ) ) ) { return null ; } else { return org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus.valueOf ( text.toString ( ) . toUpperCase ( ) ) ; } }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetStorageDomainsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ ( ( NAMES.length ) - 1 ) ] } , setUpStorageDomains ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetStorageDomainsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ ( ( NAMES.length ) - 1 ) ] } , setUpStorageDomains ( ) , failure ) ; control.replay ( ) ; }
Source:
public void testAllDomainsHaveSpaceForNewDisksSuccess ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }

Target:
public void testAllDomainsHaveSpaceForNewDisksSuccess ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public void removeAll ( boolean removeFromMacPool , org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > interfaces = getVmNetworkInterfaceDAO ( ) . getAllForVm ( vmId ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : interfaces ) { if ( removeFromMacPool ) { getMacPoolManager ( ) . freeMac ( iface.getMacAddress ( ) ) ; } getVmNetworkInterfaceDAO ( ) . remove ( iface.getId ( ) ) ; getVmNetworkStatisticsDAO ( ) . remove ( iface.getId ( ) ) ; } } }

Target:
public void removeAll ( org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > interfaces = getVmNetworkInterfaceDAO ( ) . getAllForVm ( vmId ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : interfaces ) { getMacPoolManager ( ) . freeMac ( iface.getMacAddress ( ) ) ; getVmNetworkInterfaceDAO ( ) . remove ( iface.getId ( ) ) ; getVmNetworkStatisticsDAO ( ) . remove ( iface.getId ( ) ) ; } } }
Source:
private static void updateSmartcardDevice ( org.ovirt.engine.core.common.businessentities.VM oldVm , org.ovirt.engine.core.common.businessentities.VmBase newVm ) { if ( ( newVm.isSmartcardEnabled ( ) ) == ( oldVm.isSmartcardEnabled ( ) ) ) { return ; } org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateSmartcardDevice ( newVm.getId ( ) , newVm.isSmartcardEnabled ( ) ) ; }

Target:
private void updateSmartcardDevice ( org.ovirt.engine.core.common.businessentities.VM oldVm , org.ovirt.engine.core.common.businessentities.VmBase newVm ) { if ( ( newVm.isSmartcardEnabled ( ) ) == ( oldVm.isSmartcardEnabled ( ) ) ) { return ; } updateSmartcardDevice ( newVm.getId ( ) , newVm.isSmartcardEnabled ( ) ) ; }
Source:
protected void executeQueryCommand ( ) { final org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.GetDbGroupByIdQuery.getParameters ( ) . getId ( ) ; final org.ovirt.engine.core.dao.DbGroupDao dao = org.ovirt.engine.core.bll.GetDbGroupByIdQuery.getDbFacade ( ) . getDbGroupDao ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbGroup group = dao.get ( id ) ; org.ovirt.engine.core.bll.GetDbGroupByIdQuery.getQueryReturnValue ( ) . setReturnValue ( group ) ; }

Target:
protected void executeQueryCommand ( ) { final org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.GetDbGroupByIdQuery.getParameters ( ) . getId ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbGroup group = dao.get ( id ) ; org.ovirt.engine.core.bll.GetDbGroupByIdQuery.getQueryReturnValue ( ) . setReturnValue ( group ) ; }
Source:
protected void onGetClusterList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > clusterList ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel > items = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusterList ) { items.add ( createNetworkClusterModel ( cluster ) ) ; } getNetworkClusterList ( ) . setItems ( items ) ; if ( firstInit ) { firstInit = false ; addCommands ( ) ; } }

Target:
protected void onGetClusterList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > clusterList ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel > items = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusterList ) { items.add ( createNetworkClusterModel ( cluster ) ) ; } getNetworkClusterList ( ) . setItems ( items ) ; }
Source:
private static void mockStorageDomainStatic ( org.ovirt.engine.core.bll.exportimport.ImportVmTemplateCommand command , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { final org.ovirt.engine.core.dao.StorageDomainStaticDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainStaticDao.class ) ; final org.ovirt.engine.core.common.businessentities.StorageDomainStatic domain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; domain.setStorageType ( storageType ) ; org.mockito.Mockito.when ( dao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; org.mockito.Mockito.doReturn ( dao ) . when ( command ) . getStorageDomainStaticDao ( ) ; }

Target:
private void mockStorageDomainStatic ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { final org.ovirt.engine.core.dao.StorageDomainStaticDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainStaticDao.class ) ; final org.ovirt.engine.core.common.businessentities.StorageDomainStatic domain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; domain.setStorageType ( storageType ) ; org.mockito.Mockito.when ( dao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; org.mockito.Mockito.doReturn ( dao ) . when ( command ) . getStorageDomainStaticDao ( ) ; }
Source:
private boolean networkAttachedToVds ( java.lang.String networkName , org.ovirt.engine.core.compat.Guid vdsId ) { if ( networkName != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > listOfInterfaces = getInterfaceDao ( ) . getAllInterfacesForVds ( vdsId ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface vdsNetworkInterface : listOfInterfaces ) { if ( networkName.equals ( vdsNetworkInterface.getNetworkName ( ) ) ) { return true ; } } } return false ; }

Target:
private boolean networkAttachedToVds ( java.lang.String networkName , org.ovirt.engine.core.compat.Guid vdsId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > listOfInterfaces = getInterfaceDao ( ) . getAllInterfacesForVds ( vdsId ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface vdsNetworkInterface : listOfInterfaces ) { if ( networkName.equals ( vdsNetworkInterface.getNetworkName ( ) ) ) { return true ; } } return false ; }
Source:
private static org.ovirt.engine.core.common.businessentities.GraphicsType deriveGraphicsType ( java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > graphicsInfos ) { if ( graphicsInfos != null ) { if ( graphicsInfos.containsKey ( GraphicsType.SPICE ) ) { return org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE ; } if ( graphicsInfos.containsKey ( GraphicsType.VNC ) ) { return org.ovirt.engine.core.common.businessentities.GraphicsType.VNC ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.GraphicsType deriveGraphicsType ( java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > graphicsInfos ) { if ( graphicsInfos != null ) { if ( graphicsInfos.containsKey ( GraphicsType.SPICE ) ) { return org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE ; } if ( graphicsInfos.containsKey ( GraphicsType.VNC ) ) { return org.ovirt.engine.core.common.businessentities.GraphicsType.VNC ; } } return null ; }
Source:
private void setupMock ( ) throws java.lang.Exception { commandMock = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.EndExternalJobCommand ( parameters , null ) ) ; org.mockito.Mockito.when ( commandMock.getParameters ( ) ) . thenReturn ( parameters ) ; org.mockito.Mockito.doReturn ( jobDaoMock ) . when ( commandMock ) . getJobDao ( ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.jobId ) ) . thenReturn ( makeExternalTestJob ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.jobId ) ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.nonExternalJobId ) ) . thenReturn ( makeNonExternalTestJob ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.nonExternalJobId ) ) ; }

Target:
private void setupMock ( ) throws java.lang.Exception { org.mockito.Mockito.doReturn ( jobDaoMock ) . when ( commandMock ) . getJobDao ( ) ; }
Source:
private void buidExclusiveLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms ) { if ( ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getParameters ( ) . getDiskInfo ( ) . isBoot ( ) ) && ( listVms != null ) ) && ( ! ( listVms.isEmpty ( ) ) ) ) { exclusiveLockMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { exclusiveLockMap.put ( vm.getId ( ) , LockingGroup.VM_DISK_BOOT.name ( ) ) ; } } }

Target:
private void buidExclusiveLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms ) { if ( ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getParameters ( ) . getDiskInfo ( ) . isBoot ( ) ) && ( listVms != null ) ) && ( ! ( listVms.isEmpty ( ) ) ) ) { exclusiveLockMap = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { exclusiveLockMap.put ( vm.getId ( ) . toString ( ) , LockingGroup.VM_DISK_BOOT.name ( ) ) ; } } }
Source:
public void label ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkLabelModel labelModel ) { labelModel.setInterface ( this ) ; getLabels ( ) . add ( labelModel ) ; java.util.Set < java.lang.String > labels = getIface ( ) . getLabels ( ) ; if ( labels == null ) { labels = new java.util.HashSet < > ( ) ; getIface ( ) . setLabels ( labels ) ; } labels.add ( labelModel.getName ( ) ) ; }

Target:
public void label ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkLabelModel labelModel ) { labelModel.setInterface ( this ) ; getLabels ( ) . add ( labelModel ) ; }
Source:
public void updateItemsAvailability ( ) { if ( ! ( org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getQueryStartedEvent ( ) . getListeners ( ) . contains ( this ) ) ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getQueryStartedEvent ( ) . addListener ( this ) ; } if ( ! ( org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getQueryCompleteEvent ( ) . getListeners ( ) . contains ( this ) ) ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getQueryCompleteEvent ( ) . addListener ( this ) ; } }

Target:
public abstract void updateItemsAvailability ( ) ;
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.CpuProfile model = createIncompleteCpuProfile ( ) ; setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendCpuProfilesResourceTest.setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendCpuProfilesResourceTest.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "CpuProfile" , "validateParameters" , getIncompleteFields ( ) ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.CpuProfile model = createIncompleteCpuProfile ( ) ; setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendCpuProfilesResourceTest.setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendCpuProfilesResourceTest.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "CpuProfile" , "validateParameters" , getIncompleteFields ( ) ) ; } }