auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static org.jboss.shrinkwrap.api.spec.JavaArchive createDeployment ( ) { return org.jboss.shrinkwrap.api.ShrinkWrap.create ( org.jboss.shrinkwrap.api.spec.JavaArchive.class ) . addClasses ( org.ovirt.engine.core.bll.scheduling.CommonTestMocks.class , org.ovirt.engine.core.bll.scheduling.SchedulingManager.class , org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscovery.class , org.ovirt.engine.core.bll.scheduling.BasicMigrationHandler.class ) . addAsManifestResource ( EmptyAsset.INSTANCE , org.jboss.shrinkwrap.api.ArchivePaths.create ( "beans.xml" ) ) ; }

Target:
public static org.jboss.shrinkwrap.api.spec.JavaArchive deploy ( ) { java.lang.Class < ? > [ ] classes = new java.lang.Class < ? > [ ] { org.ovirt.engine.core.bll.scheduling.SchedulingManager.class , org.ovirt.engine.core.bll.scheduling.SchedulingManagerTest.Mocks.class , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.class , org.ovirt.engine.core.bll.scheduling.MigrationHandler.class , org.ovirt.engine.core.bll.scheduling.BasicMigrationHandler.class , org.ovirt.engine.core.bll.CpuFlagsManagerHandler.class , org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscovery.class } ; return createDeployment ( classes ) ; }
Source:
protected void refreshBootParameters ( org.ovirt.engine.core.common.action.RunVmParams runVmParameters ) { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setBootSequence ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDefaultBootSequence ( ) ) ; org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setRunOnce ( false ) ; }

Target:
protected void init ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) == null ) { return ; } super . init ( ) ; setStoragePoolId ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getStoragePoolId ( ) ) ; loadPayloadDevice ( ) ; needsHostDevices = hostDeviceManager.checkVmNeedsDirectPassthrough ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) ; loadVmInit ( ) ; fetchVmDisksFromDb ( ) ; org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setBootSequence ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDefaultBootSequence ( ) ) ; org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setRunOnce ( false ) ; }
Source:
public void setUp ( ) { underTest = new org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelper ( mockNetworkClusterDao , mockVmDao , mockNetworkCluster , org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_NETWORK_NAME , mockAuditLogDirector ) ; org.mockito.Mockito.when ( mockNetworkCluster.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_NETWORK_CLUSTER_ID ) ; org.mockito.Mockito.when ( mockNetworkClusterDao.get ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_NETWORK_CLUSTER_ID ) ) . thenReturn ( mockNetworkClusterBeforeUpdate ) ; }

Target:
public void setUp ( ) { underTest = new org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelper ( mockNetworkClusterDao , mockVmDao , mockClusterDao , mockNetworkCluster , org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_NETWORK_NAME , mockAuditLogDirector ) ; org.mockito.Mockito.when ( mockNetworkCluster.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_NETWORK_CLUSTER_ID ) ; org.mockito.Mockito.when ( mockNetworkClusterDao.get ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_NETWORK_CLUSTER_ID ) ) . thenReturn ( mockNetworkClusterBeforeUpdate ) ; org.mockito.Mockito.when ( mockClusterDao.get ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_CLUSTER_ID ) ) . thenReturn ( createCluster ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_CLUSTER_NAME ) ) ; }
Source:
public void thpDefaultTrueTest ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setVersion ( new org.ovirt.engine.api.restapi.types.Version ( ) { { setMajor ( 3 ) ; setMinor ( 0 ) ; } } ) ; org.ovirt.engine.core.common.businessentities.Cluster transform = getMapper ( ) . map ( cluster , null ) ; assertEquals ( transform.getTransparentHugepages ( ) , true ) ; }

Target:
public void thpDefaultTrueTest ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setVersion ( new org.ovirt.engine.api.restapi.types.Version ( ) { { setMajor ( 3 ) ; setMinor ( 0 ) ; } } ) ; org.ovirt.engine.core.common.businessentities.Cluster transform = getMapper ( ) . map ( cluster , null ) ; assertTrue ( transform.getTransparentHugepages ( ) ) ; }
Source:
public void sufficientDiskSpace ( ) { final int extraDiskSpaceRequired = 0 ; final org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > c = setupDiskSpaceTest ( extraDiskSpaceRequired ) ; org.junit.Assert.assertTrue ( c.canDoAction ( ) ) ; }

Target:
public void insufficientDiskSpaceWithSnapshots ( ) { final org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > command = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.when ( command.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.Matchers.anyCollection ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.VmOsType o1 , org.ovirt.engine.core.common.businessentities.VmOsType o2 ) { if ( o1.name ( ) . equals ( VmOsType.Unassigned.name ( ) ) ) { return - 1 ; } if ( o2.name ( ) . equals ( VmOsType.Unassigned.name ( ) ) ) { return 1 ; } return o1.name ( ) . compareTo ( o2.name ( ) ) ; }

Target:
private void initOSType ( ) { getOSType ( ) . setItems ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getOsIds ( ) ) ; getOSType ( ) . setSelectedItem ( OsRepository.DEFAULT_OS ) ; }
Source:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
private void removeMemoryFromActiveSnapshot ( ) { java.lang.String memory = org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( memory ) ) { return ; } org.ovirt.engine.core.bll.RunVmCommand.getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; if ( ( org.ovirt.engine.core.bll.RunVmCommand.getSnapshotDao ( ) . getNumOfSnapshotsByMemory ( memory ) ) == 0 ) { org.ovirt.engine.core.bll.RunVmCommand.removeMemoryDisks ( memory ) ; } }

Target:
private void removeMemoryFromActiveSnapshot ( ) { java.lang.String memory = org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( memory ) ) { return ; } snapshotDao.removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; if ( ( snapshotDao.getNumOfSnapshotsByMemory ( memory ) ) == 0 ) { org.ovirt.engine.core.bll.RunVmCommand.removeMemoryDisks ( memory ) ; } }
Source:
private void setUpGetDomainExpectations ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , boolean succeed ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetStorageDomainByIdAndStoragePoolId , org.ovirt.engine.core.common.queries.StorageDomainAndPoolQueryParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } , ( succeed ? setUpDomainExpectations ( storageType ) : null ) ) ; }

Target:
private void setUpGetDomainExpectations ( org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , boolean succeed ) throws java.lang.Exception { setUpGetEntityExpectations ( QueryType.GetStorageDomainByIdAndStoragePoolId , org.ovirt.engine.core.common.queries.StorageDomainAndPoolQueryParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } , ( succeed ? setUpDomainExpectations ( storageType ) : null ) ) ; }
Source:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { asyncQuery.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.GetAllVmsWithNumaByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }

Target:
public void getHostNumaTopologyByHostId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.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.VdsNumaNode > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsNumaNodesByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , asyncQuery ) ; }
Source:
protected void RemoveNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDAO ( ) . getAllForTemplate ( getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDAO ( ) . remove ( iface.getId ( ) ) ; } }

Target:
protected void removeNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . getAllForTemplate ( getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . remove ( iface.getId ( ) ) ; } }
Source:
private org.ovirt.engine.core.compat.Guid getHostId ( org.ovirt.engine.api.model.Host host ) { return host.isSetId ( ) ? new org.ovirt.engine.core.compat.Guid ( host.getId ( ) ) : host.isSetName ( ) ? getEntity ( org.ovirt.engine.core.common.businessentities.VDS.class , SearchType.VDS , ( "Hosts: name=" + ( host.getName ( ) ) ) ) . getId ( ) : null ; }

Target:
private org.ovirt.engine.core.compat.Guid getHostId ( org.ovirt.engine.api.model.Host host ) { return host.isSetId ( ) ? new org.ovirt.engine.core.compat.Guid ( host.getId ( ) ) : host.isSetName ( ) ? getEntity ( org.ovirt.engine.core.common.businessentities.VdsStatic.class , VdcQueryType.GetVdsStaticByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( host.getName ( ) ) , ( "Hosts: name=" + ( host.getName ( ) ) ) ) . getId ( ) : null ; }
Source:
public double getActualDiskWithSnapshotsSize ( ) { if ( ( ( _actualDiskWithSnapthotsSize ) == 0 ) && ( ( getDiskMap ( ) ) != null ) ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : getDiskMap ( ) . values ( ) ) { if ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) == ( disk.getDiskStorageType ( ) ) ) { _actualDiskWithSnapthotsSize += ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . getActualDiskWithSnapshotsSize ( ) ; } } } return _actualDiskWithSnapthotsSize ; }

Target:
public double getActualDiskWithSnapshotsSize ( ) { if ( ( ( _actualDiskWithSnapthotsSize ) == 0 ) && ( ( getDiskMap ( ) ) != null ) ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : getDiskMap ( ) . values ( ) ) { if ( ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) == ( disk.getDiskStorageType ( ) ) ) { _actualDiskWithSnapthotsSize += ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) . getActualDiskWithSnapshotsSize ( ) ; } } } return _actualDiskWithSnapthotsSize ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVmPoolDao ( ) ; existingVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDAOTest.EXISTING_VM_POOL_ID ) ; deletableVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDAOTest.DELETABLE_VM_POOL_ID ) ; newVmPool = new org.ovirt.engine.core.common.businessentities.vm_pools ( ) ; newVmPool.setvm_pool_name ( "New VM Pool" ) ; newVmPool.setvm_pool_description ( "This is a new VM pool." ) ; newVmPool.setvds_group_id ( org.ovirt.engine.core.dao.VmPoolDAOTest.VDS_GROUP_ID ) ; existingVmPoolMap = dao.getVmPoolMapByVmGuid ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4355" ) ) ; newVmPoolMap = new org.ovirt.engine.core.common.businessentities.VmPoolMap ( org.ovirt.engine.core.dao.VmPoolDAOTest.FREE_VM_ID , existingVmPool.getvm_pool_id ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVmPoolDao ( ) ; existingVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDAOTest.EXISTING_VM_POOL_ID ) ; deletableVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDAOTest.DELETABLE_VM_POOL_ID ) ; newVmPool = new org.ovirt.engine.core.common.businessentities.VmPool ( ) ; newVmPool.setvm_pool_name ( "New VM Pool" ) ; newVmPool.setvm_pool_description ( "This is a new VM pool." ) ; newVmPool.setvds_group_id ( org.ovirt.engine.core.dao.VmPoolDAOTest.VDS_GROUP_ID ) ; existingVmPoolMap = dao.getVmPoolMapByVmGuid ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4355" ) ) ; newVmPoolMap = new org.ovirt.engine.core.common.businessentities.VmPoolMap ( org.ovirt.engine.core.dao.VmPoolDAOTest.FREE_VM_ID , existingVmPool.getvm_pool_id ( ) ) ; }
Source:
protected void onReveal ( ) { super . onReveal ( ) ; roleModelProvider.getModel ( ) . search ( ) ; systemPermissionModelProvider.refresh ( ) ; systemPermissionModelProvider.getModel ( ) . search ( ) ; }

Target:
protected void onReveal ( ) { super . onReveal ( ) ; roleModelProvider.getModel ( ) . search ( ) ; systemPermissionModelProvider.refresh ( ) ; systemPermissionModelProvider.getModel ( ) . search ( ) ; if ( org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.isModeSupported ( ApplicationMode.VirtOnly ) ) { clusterPolicyModelProvider.getModel ( ) . search ( ) ; } else { getView ( ) . hideClusterPolicyTab ( ) ; } }
Source:
protected void storageType_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.storage.StorageType storageType = getAvailableStorageTypeItems ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomainType storageDomainType = getAvailableStorageDomainTypeItems ( ) . getSelectedItem ( ) ; updateStorageSelectedItem ( storageType , storageDomainType ) ; if ( ( getCurrentStorageItem ( ) ) != null ) { updateFormat ( ) ; updateHost ( ) ; } updateWipeAfterDelete ( ) ; }

Target:
public void updateStorageTypesByDomainType ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainType storageDomainType = getAvailableStorageDomainTypeItems ( ) . getSelectedItem ( ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.storage.StorageType > filteredStorageTypes = new java.util.LinkedHashSet < > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel currModel : getStorageModels ( ) ) { if ( ( currModel.getRole ( ) ) == storageDomainType ) { filteredStorageTypes.add ( currModel.getType ( ) ) ; } } getAvailableStorageTypeItems ( ) . setItems ( filteredStorageTypes ) ; }
Source:
public void updateTasksInCluster ( ) { org.mockito.Mockito.doReturn ( getTasks ( ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( jobRepository , org.mockito.Mockito.times ( 1 ) ) . updateStep ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; org.mockito.Mockito.verify ( tasksSyncJob , org.mockito.Mockito.times ( 1 ) ) . endStepJob ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; }

Target:
public void updateTasksInCluster ( ) { org.mockito.Mockito.doReturn ( getTasks ( ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( jobRepository , org.mockito.Mockito.times ( 1 ) ) . updateStep ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 1 ) ) . endStepJob ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; }
Source:
public boolean hasSpaceForSnapthosts ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.Integer minSnapshotSize = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.InitStorageSparseSizeInGB ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.common.businessentities.storage_domains , java.lang.Integer > e : mapStorageDomainsToNumOfDisks ( vm ) . entrySet ( ) ) { if ( ! ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.hasSpaceForRequest ( e.getKey ( ) , ( minSnapshotSize * ( e.getValue ( ) ) ) ) ) ) { org.ovirt.engine.core.bll.VmRunHandler.log.error ( ( "not enough space to create snapshot on domain " + ( e.getKey ( ) . getId ( ) ) ) ) ; return false ; } } return true ; }

Target:
public boolean hasSpaceForSnapshots ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.ArrayList < java.lang.String > message ) { java.lang.Integer minSnapshotSize = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.InitStorageSparseSizeInGB ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.common.businessentities.storage_domains , java.lang.Integer > e : mapStorageDomainsToNumOfDisks ( vm ) . entrySet ( ) ) { if ( ! ( destinationHasSpace ( e.getKey ( ) , ( minSnapshotSize * ( e.getValue ( ) ) ) , message ) ) ) { return false ; } } return true ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepStatus ( volumeName , slaveHost , slaveVolumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc glusterVolumeGeoRepSessionStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String userName ) { try { java.util.Map < java.lang.String , java.lang.Object > response = vdsServer.glusterVolumeGeoRepSessionStatus ( volumeName , slaveHost , slaveVolumeName , userName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusDetailForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , setUpVDSGroups ( ) , null ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVdsGroup , org.ovirt.engine.core.common.action.VdsGroupParametersBase.class , new java.lang.String [ ] { "VdsGroupId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , setUpClusters ( ) , null ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveCluster , org.ovirt.engine.core.common.action.ClusterParametersBase.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , false ) ; control.replay ( ) ; org.ovirt.engine.api.model.VnicProfile model = org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , false ) ; control.replay ( ) ; org.ovirt.engine.api.model.VnicProfile model = org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource resource = ( ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource ) ( this . resource ) ) ; resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
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 ( ) ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult a ) { stopProgress ( a.getState ( ) ) ; cancel ( ) ; } } , 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 ( ( ( java.lang.Boolean ) ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallbacks.NetworkUpdateFrontendAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM getVmForNonShareableDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { if ( ! ( disk.isShareable ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.RemoveImageCommand.getVmDAO ( ) . getVmsListForDisk ( disk.getId ( ) , false ) ; if ( ! ( vms.isEmpty ( ) ) ) { return vms.get ( 0 ) ; } } return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM getVmForNonShareableDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { if ( ! ( disk.isShareable ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.RemoveImageCommand.getVmDao ( ) . getVmsListForDisk ( disk.getId ( ) , false ) ; if ( ! ( vms.isEmpty ( ) ) ) { return vms.get ( 0 ) ; } } return null ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpUpdateExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( getRestModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpUpdateExpectations ( ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( getRestModel ( 0 ) ) , 0 ) ; }
Source:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
private void InitCdImage ( ) { getModel ( ) . getCdImage ( ) . setSelectedItem ( template.getiso_path ( ) ) ; boolean hasCd = ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( template.getiso_path ( ) ) ) ; getModel ( ) . getCdImage ( ) . setIsChangable ( hasCd ) ; getModel ( ) . getCdAttached ( ) . setEntity ( hasCd ) ; UpdateCdImage ( ) ; }

Target:
private void InitCdImage ( ) { getModel ( ) . getCdImage ( ) . setSelectedItem ( template.getIsoPath ( ) ) ; boolean hasCd = ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( template.getIsoPath ( ) ) ) ; getModel ( ) . getCdImage ( ) . setIsChangable ( hasCd ) ; getModel ( ) . getCdAttached ( ) . setEntity ( hasCd ) ; UpdateCdImage ( ) ; }
Source:
public void syncNetworkQosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; org.ovirt.engine.core.compat.Guid qosId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.when ( qosDao.get ( qosId ) ) . thenReturn ( createQos ( ) ) ; network.setQosId ( qosId ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( iface ) ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
public void testSimple ( ) { java.util.List < java.lang.String > array = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogHelper.getCustomLogFields ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.BaseClass.class , true ) ; assertEquals ( "size should be 1" , 1 , array.size ( ) ) ; array = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogHelper.getCustomLogFields ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.BaseClass.class , false ) ; assertEquals ( "Not Inherited size should be 1" , 1 , array.size ( ) ) ; }

Target:
public void testSimple ( ) { java.util.Set < java.lang.String > array = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogHelper.getCustomLogFields ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.BaseClass.class , true ) ; assertEquals ( "size should be 1" , 1 , array.size ( ) ) ; array = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogHelper.getCustomLogFields ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.BaseClass.class , false ) ; assertEquals ( "Not Inherited size should be 1" , 1 , array.size ( ) ) ; }
Source:
private void setDetailList ( final org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel vmGeneralModel , final org.ovirt.engine.ui.uicommonweb.models.vms.VmImportInterfaceListModel vmImportInterfaceListModel , final org.ovirt.engine.ui.uicommonweb.models.vms.VmAppListModel vmAppListModel ) { getClusterQuota ( ) . setIsAvailable ( false ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( vmGeneralModel ) ; list.add ( vmImportInterfaceListModel ) ; list.add ( importDiskListModel ) ; list.add ( vmAppListModel ) ; setDetailModels ( list ) ; }

Target:
private void setDetailList ( final org.ovirt.engine.ui.uicommonweb.models.vms.VmImportGeneralModel vmImportGeneralModel , final org.ovirt.engine.ui.uicommonweb.models.vms.VmImportInterfaceListModel vmImportInterfaceListModel , final org.ovirt.engine.ui.uicommonweb.models.vms.VmImportAppListModel vmImportAppListModel ) { getClusterQuota ( ) . setIsAvailable ( false ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( vmImportGeneralModel ) ; list.add ( vmImportInterfaceListModel ) ; list.add ( importDiskListModel ) ; list.add ( vmImportAppListModel ) ; setDetailModels ( list ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > scores = new java.util.ArrayList < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hosts ) { scores.add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > ( vds.getId ( ) , vds.getUsageCpuPercent ( ) ) ) ; } return scores ; }

Target:
private double calcDistributeMetric ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VM vm , int hostCores ) { int vcpu = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VcpuConsumptionPercentage ) ; int spmCpu = ( ( vds.getSpmStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ) ? 0 : org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.SpmVCpuConsumption ) ; double hostCpu = vds.getUsageCpuPercent ( ) ; double pendingVcpus = vds.getPendingVcpusCount ( ) ; return ( hostCpu / vcpu ) + ( ( ( pendingVcpus + ( vm.getNumOfCpus ( ) ) ) + spmCpu ) / hostCores ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotunplugDisk ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotunplugDisk ( info.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc snapshot ( java.lang.String vmId , java.util.Map < java.lang.String , java.lang.String > [ ] disks ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.snapshot ( vmId , disks ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Disk > getAllForVm ( org.ovirt.engine.core.compat.Guid id , boolean onlyPluggedDisks , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_guid" , id ) . addValue ( "only_plugged" , onlyPluggedDisks ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetDisksVmGuid" , org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.DiskRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Disk > getAllForVm ( org.ovirt.engine.core.compat.Guid id , boolean onlyPluggedDisks , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_guid" , id ) . addValue ( "only_plugged" , onlyPluggedDisks ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetDisksVmGuid" , org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.DiskForVmRowMapper.instance , parameterSource ) ; }
Source:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean doRefresh ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.SearchParameters params = new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , ( doRefresh ? params : params.withoutRefresh ( ) ) , aQuery ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addManagedDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , org.ovirt.engine.core.common.utils.VmDeviceType type , org.ovirt.engine.core.common.utils.VmDeviceType device , java.util.Map < java.lang.String , java.lang.Object > specParams , boolean plugged , boolean readOnly , java.lang.String address ) { org.ovirt.engine.core.common.businessentities.VmDevice managedDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , type , device , specParams , plugged , readOnly ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { managedDevice.setAddress ( address ) ; } return managedDevice ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmDevice addManagedDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type , org.ovirt.engine.core.common.utils.VmDeviceType device , java.util.Map < java.lang.String , java.lang.Object > specParams , boolean plugged , boolean readOnly , java.lang.String address , java.util.Map < java.lang.String , java.lang.String > customProp ) { org.ovirt.engine.core.common.businessentities.VmDevice managedDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , type , device , specParams , plugged , readOnly , customProp ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { managedDevice.setAddress ( address ) ; } return managedDevice ; }
Source:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public void getAncestorImagesByImagesIds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.util.List < org.ovirt.engine.core.compat.Guid > imagesIds ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) { @ java.lang.Override public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.IdsQueryParameters params = new org.ovirt.engine.core.common.queries.IdsQueryParameters ( imagesIds ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAncestorImagesByImagesIds , params , aQuery ) ; }
Source:
private void mockVdsDao ( final org.ovirt.engine.core.dao.VdsDao vdsDao ) { org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter search = new org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter ( ) ; org.mockito.Mockito.when ( vdsDao.getAllWithQuery ( org.mockito.Matchers.matches ( org.ovirt.engine.core.bll.SearchQueryTest.getVdsRegexString ( search ) ) ) ) . thenReturn ( vdsResultList ) ; }

Target:
private void mockVdsDao ( final org.ovirt.engine.core.dao.VdsDao vdsDao ) { org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter search = new org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter ( ) ; org.mockito.Mockito.when ( vdsDao.getAllWithQuery ( org.mockito.Matchers.matches ( org.ovirt.engine.core.bll.SearchQueryTest.getVdsRegexString ( search ) ) ) ) . thenReturn ( vdsResultList ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setCpuFlags ( "flag" ) ; vds.setVdsGroupCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; vdsResultList.add ( vds ) ; }
Source:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void countAllTemplates ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { 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.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private void setupVmDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > expectedVm = java.util.Collections.singletonList ( vm ) ; org.ovirt.engine.core.dao.VmDAO vmDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDAO.class ) ; org.mockito.Mockito.when ( vmDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVm ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmDao ( ) ) . thenReturn ( vmDaoMock ) ; }

Target:
private void setupVmDao ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > expectedVms ) { org.ovirt.engine.core.dao.VmDAO vmDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDAO.class ) ; org.mockito.Mockito.when ( vmDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVms ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmDao ( ) ) . thenReturn ( vmDaoMock ) ; }