auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testExecuteQueryCommand ( ) { org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( networkId ) ; setupVdsDao ( ) ; setupVdsNetworkInterfaceDao ( ) ; setupNetworkDao ( ) ; setupHostNetworkQosDao ( ) ; org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > vdsInterfaceVdsPair = new org.ovirt.engine.core.common.utils.PairQueryable ( vdsNetworkInterface , vds ) ; java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > > expected = java.util.Collections.singletonList ( vdsInterfaceVdsPair ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( "Wrong result returned" , expected , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testExecuteQueryCommand ( ) { org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( networkId ) ; setupVdsDao ( ) ; setupVdsNetworkInterfaceDao ( ) ; setupNetworkDao ( ) ; org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > vdsInterfaceVdsPair = new org.ovirt.engine.core.common.utils.PairQueryable ( vdsNetworkInterface , vds ) ; java.util.List < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > > expected = java.util.Collections.singletonList ( vdsInterfaceVdsPair ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( "Wrong result returned" , expected , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
public void initialize ( ) { org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Start initializing {}" , getClass ( ) . getSimpleName ( ) ) ; java.lang.Integer backupCheckPeriodInHours = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.BackupCheckPeriodInHours ) ; if ( backupCheckPeriodInHours > 0 ) { org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( this , "backupCheck" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , backupCheckPeriodInHours , backupCheckPeriodInHours , java.util.concurrent.TimeUnit.HOURS ) ; org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Finished initializing {}" , getClass ( ) . getSimpleName ( ) ) ; } }

Target:
private void initialize ( ) { org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Start initializing {}" , getClass ( ) . getSimpleName ( ) ) ; java.lang.Integer backupCheckPeriodInHours = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.BackupCheckPeriodInHours ) ; if ( backupCheckPeriodInHours > 0 ) { org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( this , "backupCheck" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , backupCheckPeriodInHours , backupCheckPeriodInHours , java.util.concurrent.TimeUnit.HOURS ) ; org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Finished initializing {}" , getClass ( ) . getSimpleName ( ) ) ; } }
Source:
public void testManualFence ( ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.FenceVdsManualy , org.ovirt.engine.core.common.action.FenceVdsManualyParameters.class , new java.lang.String [ ] { "VdsId" , "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 0 ] , GUIDS [ 1 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setFenceType ( FenceType.MANUAL.value ( ) ) ; verifyActionResponse ( resource.fence ( action ) ) ; }

Target:
public void testManualFence ( ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.FenceVdsManualy , org.ovirt.engine.core.common.action.FenceVdsManualyParameters.class , new java.lang.String [ ] { "VdsId" , "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 0 ] , GUIDS [ 1 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setFenceType ( FenceType.MANUAL.value ( ) ) ; verifyActionResponse ( resource.fence ( action ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDeviceList , org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostStorageResourceTest.HOST_GUID } , setUpLuns ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDeviceList , org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostStorageResourceTest.HOST_GUID } , setUpLuns ( ) , failure ) ; }
Source:
protected boolean canDoAction ( ) { boolean autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.isUserCanBeAuthenticated ( ) ; if ( autheticated ) { autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.getCurrentUser ( ) . isAdmin ( ) ; if ( ! autheticated ) { addCanDoActionMessage ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } else { autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.attachUserToSession ( ) ; } } if ( ! autheticated ) { org.ovirt.engine.core.bll.LoginAdminUserCommand.logAutheticationFailure ( ) ; } return autheticated ; }

Target:
protected boolean canDoAction ( ) { boolean autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.isUserCanBeAuthenticated ( ) ; if ( autheticated ) { autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.getCurrentUser ( ) . isAdmin ( ) ; if ( ! autheticated ) { addCanDoActionMessage ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } } if ( ! autheticated ) { org.ovirt.engine.core.bll.LoginAdminUserCommand.logAutheticationFailure ( ) ; } return autheticated ; }
Source:
protected boolean canDoAction ( ) { boolean retVal = true ; java.util.List < java.lang.String > canDoActionMessages = getReturnValue ( ) . getCanDoActionMessages ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > domainsMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; retVal = canDoAction_beforeCloneVm ( canDoActionMessages , domainsMap ) ; if ( retVal && ( getParameters ( ) . isImportAsNewEntity ( ) ) ) { initImportClonedVm ( ) ; } return retVal && ( canDoAction_afterCloneVm ( retVal , canDoActionMessages , domainsMap ) ) ; }

Target:
protected boolean canDoAction ( ) { boolean retVal = true ; java.util.List < java.lang.String > canDoActionMessages = getReturnValue ( ) . getCanDoActionMessages ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > domainsMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; retVal = canDoAction_beforeCloneVm ( domainsMap ) ; if ( retVal && ( getParameters ( ) . isImportAsNewEntity ( ) ) ) { initImportClonedVm ( ) ; } return retVal && ( canDoAction_afterCloneVm ( retVal , canDoActionMessages , domainsMap ) ) ; }
Source:
private static java.util.Set < java.lang.String > getHostEmulatedMachines ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return new java.util.HashSet ( java.util.Arrays.asList ( vds.getSupportedEmulatedMachines ( ) . split ( "," ) ) ) ; }

Target:
private static java.util.Set < java.lang.String > getHostEmulatedMachines ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( vds.getSupportedEmulatedMachines ( ) ) == null ) { return new java.util.HashSet < > ( ) ; } else { return new java.util.HashSet ( java.util.Arrays.asList ( vds.getSupportedEmulatedMachines ( ) . split ( "," ) ) ) ; } }
Source:
private boolean isRemoveCommandAvailable ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { boolean isTemplateDisk = ( disk.getVmEntityType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.TEMPLATE ) ; boolean isImageLocked = ( disk.getimageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ; if ( isTemplateDisk || isImageLocked ) { return false ; } } return true ; }

Target:
private boolean isRemoveCommandAvailable ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { boolean isImageLocked = ( disk.getimageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ; if ( isImageLocked ) { return false ; } } return true ; }
Source:
public void diskImagesExist ( ) { org.mockito.Mockito.doReturn ( true ) . when ( validator ) . isDiskExists ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . isDiskExists ( disk2.getId ( ) ) ; org.junit.Assert.assertEquals ( validator.diskImagesNotExist ( ) , ValidationResult.VALID ) ; }

Target:
public void diskImagesExist ( ) { org.mockito.Mockito.doReturn ( true ) . when ( validator ) . isDiskExists ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . isDiskExists ( disk2.getId ( ) ) ; org.junit.Assert.assertEquals ( ValidationResult.VALID , validator.diskImagesNotExist ( ) ) ; }
Source:
public void copyClientsFrom ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails volumeAdvancedDetails ) { for ( org.ovirt.engine.core.common.businessentities.gluster.BrickDetails newBrickDetails : volumeAdvancedDetails.getBrickDetails ( ) ) { org.ovirt.engine.core.compat.Guid newBrickId = newBrickDetails.getBrickProperties ( ) . getBrickId ( ) ; if ( newBrickId == null ) { continue ; } for ( org.ovirt.engine.core.common.businessentities.gluster.BrickDetails brickDetails : getBrickDetails ( ) ) { if ( newBrickId.equals ( brickDetails.getBrickProperties ( ) . getBrickId ( ) ) ) { brickDetails.setClients ( newBrickDetails.getClients ( ) ) ; break ; } } } }

Target:
public void copyClientsFrom ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails volumeAdvancedDetails ) { for ( org.ovirt.engine.core.common.businessentities.gluster.BrickDetails newBrickDetails : volumeAdvancedDetails.getBrickDetails ( ) ) { org.ovirt.engine.core.compat.Guid newBrickId = newBrickDetails.getBrickProperties ( ) . getBrickId ( ) ; if ( newBrickId != null ) { for ( org.ovirt.engine.core.common.businessentities.gluster.BrickDetails brickDetails : getBrickDetails ( ) ) { if ( newBrickId.equals ( brickDetails.getBrickProperties ( ) . getBrickId ( ) ) ) { brickDetails.setClients ( newBrickDetails.getClients ( ) ) ; break ; } } } } }
Source:
private org.ovirt.engine.core.common.businessentities.ServerCpu getVdsGroupServerCpu ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel model , org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup ) { org.ovirt.engine.core.common.businessentities.ServerCpu retVal = null ; for ( org.ovirt.engine.core.common.businessentities.ServerCpu cpu : model.getCPU ( ) . getItems ( ) ) { if ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( cpu.getCpuName ( ) , vdsGroup.getcpu_name ( ) ) ) { retVal = cpu ; break ; } } return retVal ; }

Target:
private org.ovirt.engine.core.common.businessentities.ServerCpu getVdsGroupServerCpu ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel model , org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup ) { org.ovirt.engine.core.common.businessentities.ServerCpu retVal = null ; for ( org.ovirt.engine.core.common.businessentities.ServerCpu cpu : model.getCPU ( ) . getItems ( ) ) { if ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( cpu.getCpuName ( ) , vdsGroup.getCpuName ( ) ) ) { retVal = cpu ; break ; } } return retVal ; }
Source:
private static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > getClusterByServiceList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list , boolean supportsVirtService , boolean supportsGlusterService ) { final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : list ) { if ( ( supportsVirtService && ( cluster.supportsVirtService ( ) ) ) || ( supportsGlusterService && ( cluster.supportsGlusterService ( ) ) ) ) { filteredList.add ( cluster ) ; } } java.util.Collections.sort ( filteredList , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return filteredList ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > getClusterByServiceList ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > list , boolean supportsVirtService , boolean supportsGlusterService ) { final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : list ) { if ( ( supportsVirtService && ( cluster.supportsVirtService ( ) ) ) || ( supportsGlusterService && ( cluster.supportsGlusterService ( ) ) ) ) { filteredList.add ( cluster ) ; } } java.util.Collections.sort ( filteredList , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return filteredList ; }
Source:
public static void getStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.GetStorageDomainsByVmTemplateIdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
private boolean isLocalDataCenterEmpty ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter ) { if ( ( ( dataCenter != null ) && ( ( dataCenter.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) && ( ( dataCenter.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Uninitialized ) ) ) { return true ; } return false ; }

Target:
private boolean isLocalDataCenterEmpty ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter ) { if ( ( ( dataCenter != null ) && ( ( dataCenter.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) && ( ( dataCenter.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Uninitialized ) ) ) { return true ; } return false ; }
Source:
protected void executeCommand ( ) { java.lang.String connectionId = org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getid ( ) ; getStorageServerConnectionDao ( ) . remove ( connectionId ) ; log.info ( "Removing connection '{}' from database " , connectionId ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) ) ) { log.info ( "No vdsId passed - hosts will not be disconnected." ) ; } else { org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.disconnectStorage ( ) ; } org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { java.lang.String connectionId = org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getid ( ) ; org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getStorageServerConnectionDao ( ) . remove ( connectionId ) ; log.info ( "Removing connection '{}' from database " , connectionId ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) ) ) { log.info ( "No vdsId passed - hosts will not be disconnected." ) ; } else { org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.disconnectStorage ( ) ; } org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.setSucceeded ( true ) ; }
Source:
private void setupMock ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( expected.getId ( ) ) ; glusterVolumeDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDao.class ) ; org.mockito.Mockito.when ( glusterVolumeDaoMock.getById ( expected.getId ( ) ) ) . thenReturn ( expected ) ; org.mockito.Mockito.doReturn ( glusterVolumeDaoMock ) . when ( getQuery ( ) ) . getGlusterVolumeDao ( ) ; }

Target:
private void setupMock ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( expected.getId ( ) ) ; org.mockito.Mockito.when ( glusterVolumeDaoMock.getById ( expected.getId ( ) ) ) . thenReturn ( expected ) ; }
Source:
public void initialize ( ) { super . initialize ( ) ; getStorageDomain ( ) . setIsChangeable ( ( limitToStorageDomainId == null ) ) ; getDataCenter ( ) . setIsChangeable ( ( limitToStorageDomainId == null ) ) ; getHost ( ) . setIsChangeable ( false ) ; getStorageType ( ) . setIsChangeable ( false ) ; }

Target:
public void initialize ( ) { super . initialize ( ) ; getStorageDomain ( ) . setIsChangeable ( ( limitToStorageDomainId == null ) ) ; getDataCenter ( ) . setIsChangeable ( ( limitToStorageDomainId == null ) ) ; getStorageType ( ) . setIsChangeable ( false ) ; }
Source:
public static void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { 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.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { 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.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }
Source:
static < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > org.ovirt.engine.core.bll.ValidationResult validateCoherentIdentification ( java.lang.String violatingEntityId , org.ovirt.engine.core.compat.Guid referringId , java.lang.String referringName , org.ovirt.engine.core.common.errors.EngineMessage message , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { boolean bothIdentificationSet = ( referringId != null ) && ( referringName != null ) ; java.lang.String [ ] replacements = org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.createIncoherentIdentificationErrorReplacements ( violatingEntityId , referringId , referringName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( message , replacements ) . when ( ( bothIdentificationSet && ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.isNameAndIdIncoherent ( referringId , referringName , map ) ) ) ) ; }

Target:
private < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > org.ovirt.engine.core.bll.ValidationResult validateCoherentIdentification ( java.lang.String violatingEntityId , org.ovirt.engine.core.compat.Guid referringId , java.lang.String referringName , org.ovirt.engine.core.common.errors.EngineMessage message , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { boolean bothIdentificationSet = ( referringId != null ) && ( referringName != null ) ; java.lang.String [ ] replacements = createIncoherentIdentificationErrorReplacements ( violatingEntityId , referringId , referringName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( message , replacements ) . when ( ( bothIdentificationSet && ( isNameAndIdIncoherent ( referringId , referringName , map ) ) ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ManageGlusterSwiftModel innerGlusterSwiftModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ManageGlusterSwiftModel ) ( result.getState ( ) ) ) ; innerGlusterSwiftModel.stopProgress ( ) ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase : result.getReturnValue ( ) ) { } cancel ( ) ; updateGlusterDetails ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ManageGlusterSwiftModel innerGlusterSwiftModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ManageGlusterSwiftModel ) ( result.getState ( ) ) ) ; innerGlusterSwiftModel.stopProgress ( ) ; cancel ( ) ; updateGlusterDetails ( ) ; }
Source:
public void validateFailsWhenGlusterHostHasVolumes ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }

Target:
public void validateFailsWhenGlusterHostHasVolumes ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) , null ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( actionType ) * prime ) ; result = ( prime * result ) + ( ( clusterMinimalVersion ) == null ? 0 : clusterMinimalVersion.hashCode ( ) ) ; result = ( prime * result ) + ( ( storagePoolMinimalVersion ) == null ? 0 : storagePoolMinimalVersion.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( actionType ) ; result = ( prime * result ) + ( ( clusterMinimalVersion ) == null ? 0 : clusterMinimalVersion.hashCode ( ) ) ; result = ( prime * result ) + ( ( storagePoolMinimalVersion ) == null ? 0 : storagePoolMinimalVersion.hashCode ( ) ) ; return result ; }
Source:
private void mockStoragePoolDao ( org.ovirt.engine.core.common.businessentities.StoragePool pool ) { org.ovirt.engine.core.compat.Guid storagePoolId = getQueryParameters ( ) . getStoragePoolId ( ) ; if ( pool != null ) { pool.setId ( storagePoolId ) ; } org.ovirt.engine.core.dao.StoragePoolDao storagePoolDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDaoMock.get ( storagePoolId , getUser ( ) . getId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( pool ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStoragePoolDao ( ) ) . thenReturn ( storagePoolDaoMock ) ; }

Target:
private void mockStoragePoolDao ( org.ovirt.engine.core.common.businessentities.StoragePool pool ) { org.ovirt.engine.core.compat.Guid storagePoolId = getQueryParameters ( ) . getStoragePoolId ( ) ; if ( pool != null ) { pool.setId ( storagePoolId ) ; } org.mockito.Mockito.when ( storagePoolDaoMock.get ( storagePoolId , getUser ( ) . getId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( pool ) ; }
Source:
private boolean activateOrDeactivateNic ( org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.action.PlugAction plugAction , boolean newNic ) { org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters parameters = new org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters ( nic , plugAction , newNic ) ; parameters.setVmId ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.ActivateDeactivateVmNic , parameters , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { propagateFailure ( returnValue ) ; } return returnValue.getSucceeded ( ) ; }

Target:
protected boolean activateOrDeactivateNic ( org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.action.PlugAction plugAction , boolean newNic ) { org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters parameters = new org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters ( nic , plugAction , newNic ) ; parameters.setVmId ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.ActivateDeactivateVmNic , parameters , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { propagateFailure ( returnValue ) ; } return returnValue.getSucceeded ( ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( ( ( java.lang.Boolean ) ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ) ) ; param.setConsoleEnabled ( ( ( java.lang.Boolean ) ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; param.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }
Source:
public static boolean setDiskAlias ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , org.ovirt.engine.core.common.businessentities.VM vm ) { if ( disk == null ) { org.ovirt.engine.core.bll.ImagesHandler.log.errorFormat ( "Disk object is null" ) ; return false ; } java.lang.String vmName = "" ; int count = 1 ; if ( vm != null ) { vmName = vm.getVmName ( ) ; count = ( vm.getDiskMapCount ( ) ) + 1 ; } disk.setDiskAlias ( org.ovirt.engine.core.bll.ImagesHandler.getSuggestedDiskAlias ( disk , vmName , count ) ) ; return true ; }

Target:
public static boolean setDiskAlias ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , org.ovirt.engine.core.common.businessentities.VM vm ) { if ( disk == null ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Disk object is null" ) ; return false ; } java.lang.String vmName = "" ; int count = 1 ; if ( vm != null ) { vmName = vm.getVmName ( ) ; count = ( vm.getDiskMapCount ( ) ) + 1 ; } disk.setDiskAlias ( org.ovirt.engine.core.bll.ImagesHandler.getSuggestedDiskAlias ( disk , vmName , count ) ) ; return true ; }
Source:
private void unplug ( ) { final org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; model.startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.HotUnPlugDiskFromVm , createHotPlugDiskToVmParameters ( false ) , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { model.stopProgress ( ) ; setWindow ( null ) ; } } , this ) ; }

Target:
private void unplug ( ) { final org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; model.startProgress ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.HotUnPlugDiskFromVm , createHotPlugDiskToVmParameters ( false ) , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { model.stopProgress ( ) ; setWindow ( null ) ; } } , this ) ; }
Source:
private void composeCoresAndSocketsWhenDontFitInto ( int totalCpuCores ) { java.util.List < java.lang.Integer > possibleSockets = findIndependentPossibleValues ( maxNumOfSockets ) ; java.util.List < java.lang.Integer > possibleCoresPerSocket = findIndependentPossibleValues ( maxCpusPerSocket ) ; java.util.Collections.reverse ( possibleSockets ) ; for ( java.lang.Integer socket : possibleSockets ) { for ( java.lang.Integer coresPerSocket : possibleCoresPerSocket ) { if ( ( socket * coresPerSocket ) == totalCpuCores ) { getModel ( ) . getCoresPerSocket ( ) . setSelectedItem ( coresPerSocket ) ; getModel ( ) . getNumOfSockets ( ) . setSelectedItem ( socket ) ; return ; } } } }

Target:
protected void composeCoresAndSocketsWhenDontFitInto ( int totalCpuCores ) { java.util.List < java.lang.Integer > possibleSockets = findIndependentPossibleValues ( maxNumOfSockets ) ; java.util.List < java.lang.Integer > possibleCoresPerSocket = findIndependentPossibleValues ( maxCpusPerSocket ) ; java.util.Collections.reverse ( possibleSockets ) ; for ( java.lang.Integer socket : possibleSockets ) { for ( java.lang.Integer coresPerSocket : possibleCoresPerSocket ) { if ( ( socket * coresPerSocket ) == totalCpuCores ) { getModel ( ) . getCoresPerSocket ( ) . setSelectedItem ( coresPerSocket ) ; getModel ( ) . getNumOfSockets ( ) . setSelectedItem ( socket ) ; return ; } } } }
Source:
protected org.ovirt.engine.core.common.action.VdcActionParametersBase getParametersForTask ( org.ovirt.engine.core.common.action.VdcActionType parentCommandType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters ) { if ( parentCommandType == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) { return parameters ; } org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = parameters.getParentParameters ( ) ; if ( parentParameters == null ) { java.lang.String msg = "No parameters exist for " + parentCommandType ; log.error ( msg ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.NO_PARAMETERS_FOR_TASK , msg ) ; } parentParameters.setExecutionReason ( parameters.getExecutionReason ( ) ) ; return parentParameters ; }

Target:
protected org.ovirt.engine.core.common.action.VdcActionParametersBase getParametersForTask ( org.ovirt.engine.core.common.action.VdcActionType parentCommandType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = parameters.getParentParameters ( ) ; if ( ( parentCommandType == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) || ( parentParameters == null ) ) { return parameters ; } parentParameters.setExecutionReason ( parameters.getExecutionReason ( ) ) ; return parentParameters ; }
Source:
protected void addDetailItem ( com.google.gwt.safehtml.shared.SafeHtml label , java.lang.String value , com.google.gwt.dom.client.DListElement parent ) { com.google.gwt.dom.client.Element dt = com.google.gwt.dom.client.Document.get ( ) . createElement ( "dt" ) ; dt.setInnerSafeHtml ( label ) ; parent.appendChild ( dt ) ; com.google.gwt.dom.client.Element dd = com.google.gwt.dom.client.Document.get ( ) . createElement ( "dd" ) ; dd.setInnerText ( value ) ; parent.appendChild ( dd ) ; }

Target:
protected void addDetailItem ( com.google.gwt.safehtml.shared.SafeHtml label , com.google.gwt.safehtml.shared.SafeHtml value , com.google.gwt.dom.client.DListElement parent ) { com.google.gwt.dom.client.Element dt = com.google.gwt.dom.client.Document.get ( ) . createElement ( "dt" ) ; dt.setInnerSafeHtml ( label ) ; parent.appendChild ( dt ) ; com.google.gwt.dom.client.Element dd = com.google.gwt.dom.client.Document.get ( ) . createElement ( "dd" ) ; dd.setInnerSafeHtml ( value ) ; parent.appendChild ( dd ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel runOnceModel = new org.ovirt.engine.ui.uicommonweb.models.vms.WebadminRunOnceModel ( ( ( org.ovirt.engine.core.common.businessentities.VM ) ( result ) ) , getCustomPropertiesKeysList ( ) . get ( ( ( org.ovirt.engine.core.common.businessentities.VM ) ( result ) ) . getVdsGroupCompatibilityVersion ( ) ) , this ) ; setWindow ( runOnceModel ) ; runOnceModel.init ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel runOnceModel = new org.ovirt.engine.ui.uicommonweb.models.vms.WebadminRunOnceModel ( ( ( org.ovirt.engine.core.common.businessentities.VM ) ( result ) ) , this ) ; setWindow ( runOnceModel ) ; runOnceModel.init ( ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.InternalMigrateVmCommand.getVm ( ) . getMigrationSupport ( ) ) == ( org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE ) ) { return super . canDoAction ( ) ; } return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NON_MIGRTABLE ) ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.InternalMigrateVmCommand.getVm ( ) . getMigrationSupport ( ) ) != ( org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NON_MIGRTABLE ) ; } return true ; }
Source:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.doReturn ( client ) . when ( glusterUtil ) . getSSHClient ( ) ; org.mockito.Mockito.doNothing ( ) . when ( glusterUtil ) . connect ( client , org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.USER , org.ovirt.engine.core.bll.utils.GlusterUtilTest.WRONG_PASSWORD ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) . when ( client ) . getHostFingerprint ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.OUTPUT_XML ) . when ( glusterUtil ) . executePeerStatusCommand ( client ) ; org.mockito.Mockito.doThrow ( javax.naming.AuthenticationException.class ) . when ( glusterUtil ) . authenticate ( client ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.doNothing ( ) . when ( glusterUtil ) . connect ( client , org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.USER , org.ovirt.engine.core.bll.utils.GlusterUtilTest.WRONG_PASSWORD ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.OUTPUT_XML ) . when ( glusterUtil ) . executePeerStatusCommand ( client ) ; org.mockito.Mockito.doThrow ( javax.naming.AuthenticationException.class ) . when ( glusterUtil ) . authenticate ( client ) ; }
Source:
private org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > spySearchQuery ( org.ovirt.engine.core.common.queries.SearchParameters searchParam ) { org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > ( searchParam ) ) ; org.mockito.Mockito.doReturn ( mockDAO ( ) ) . when ( searchQuery ) . getDbFacade ( ) ; return searchQuery ; }

Target:
private org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > spySearchQuery ( org.ovirt.engine.core.common.queries.SearchParameters searchParam ) { org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > ( searchParam ) ) ; return searchQuery ; }
Source:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( geoRepDao ) . when ( cmd ) . getGlusterGeoRepDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( startedVolumeId ) ) . when ( volumeDao ) . getById ( startedVolumeId ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( stoppedVolumeId ) ) . when ( volumeDao ) . getById ( stoppedVolumeId ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( startedVolumeId ) ) . when ( volumeDao ) . getById ( startedVolumeId ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( stoppedVolumeId ) ) . when ( volumeDao ) . getById ( stoppedVolumeId ) ; }
Source:
protected java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , org.ovirt.engine.core.common.queries.DiskImageList > setUpTemplates ( boolean notFound ) { java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , org.ovirt.engine.core.common.queries.DiskImageList > ret = new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , org.ovirt.engine.core.common.queries.DiskImageList > ( ) ; if ( notFound ) { return ret ; } for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { ret.put ( getEntity ( i ) , new org.ovirt.engine.core.common.queries.DiskImageList ( ) ) ; } return ret ; }

Target:
protected java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > setUpTemplates ( boolean notFound ) { java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > ret = new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; if ( notFound ) { return ret ; } for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { ret.put ( getEntity ( i ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) ; } return ret ; }
Source:
public void testOpenConnection ( ) throws java.sql.SQLException { javax.sql.DataSource ds = new org.ovirt.engine.core.tools.common.db.StandaloneDataSource ( ) ; java.sql.Connection connection = null ; try { connection = ds.getConnection ( ) ; org.junit.Assert.assertNotNull ( connection ) ; } finally { connection.close ( ) ; } }

Target:
public void testOpenConnection ( ) throws java.sql.SQLException { javax.sql.DataSource ds = new org.ovirt.engine.core.tools.common.db.StandaloneDataSource ( ) ; java.sql.Connection connection = null ; try { connection = ds.getConnection ( ) ; org.junit.Assert.assertNotNull ( connection ) ; } finally { if ( connection != null ) { connection.close ( ) ; } } }
Source:
public void setupMocks ( ) { org.mockito.Mockito.when ( clusterDao.get ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) . thenReturn ( getCluster ( ) ) ; org.mockito.Mockito.doReturn ( clusterDao ) . when ( cmd ) . getClusterDao ( ) ; org.mockito.Mockito.when ( cmd.getSyncJobInstance ( ) ) . thenReturn ( hookSyncJob ) ; }

Target:
public void setupMocks ( ) { org.mockito.Mockito.when ( clusterDao.get ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) . thenReturn ( getCluster ( ) ) ; org.mockito.Mockito.doReturn ( hookSyncJob ) . when ( cmd ) . getSyncJobInstance ( ) ; }
Source:
public void setUp ( ) { diskImage.setDiskProfileId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class , dbFacade ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.setInstance ( dbFacade ) ; org.mockito.Mockito.when ( dbFacade.getStorageQosDao ( ) ) . thenReturn ( storageQosDao ) ; qos = new org.ovirt.engine.core.common.businessentities.qos.StorageQos ( ) ; qos.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; }

Target:
public void setUp ( ) { diskImage.setDiskProfileId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( dbFacade.getStorageQosDao ( ) ) . thenReturn ( storageQosDao ) ; qos = new org.ovirt.engine.core.common.businessentities.qos.StorageQos ( ) ; qos.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; }
Source:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > filterStoragesByDatacenterId ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains , org.ovirt.engine.core.compat.NGuid diskDatacenterId ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains storage : storageDomains ) { if ( storage.getstorage_pool_id ( ) . equals ( diskDatacenterId ) ) { storages.add ( storage ) ; } } return storages ; }

Target:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStoragesByDatacenterId ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains , org.ovirt.engine.core.compat.NGuid diskDatacenterId ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storage : storageDomains ) { if ( storage.getstorage_pool_id ( ) . equals ( diskDatacenterId ) ) { storages.add ( storage ) ; } } return storages ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageServerConnections populateBasicConnectionDetails ( org.ovirt.engine.core.compat.Guid id , java.lang.String connection , org.ovirt.engine.core.common.businessentities.storage.StorageType type ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; if ( id != null ) { connectionDetails.setid ( id.toString ( ) ) ; } connectionDetails.setconnection ( connection ) ; connectionDetails.setstorage_type ( type ) ; return connectionDetails ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageServerConnections populateBasicConnectionDetails ( org.ovirt.engine.core.compat.Guid id , java.lang.String connection , org.ovirt.engine.core.common.businessentities.storage.StorageType type ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; if ( id != null ) { connectionDetails.setId ( id.toString ( ) ) ; } connectionDetails.setconnection ( connection ) ; connectionDetails.setstorage_type ( type ) ; return connectionDetails ; }