auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testUpdateUnregisteredDisksWithVMsWithEmptyUnregDisks ( ) throws java.io.IOException { try { org.ovirt.engine.core.utils.ovf.xml.XmlDocument xmlDocument = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( getXmlOvfData ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregDisks = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.utils.OvfUtils.updateUnregisteredDisksWithVMs ( unregDisks , org.ovirt.engine.core.compat.Guid.newGuid ( ) , "TestVM" , xmlDocument ) ; org.junit.Assert.assertTrue ( "The list of disks should not be empty" , unregDisks.isEmpty ( ) ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; } }

Target:
public void testUpdateUnregisteredDisksWithVMsWithEmptyUnregDisks ( ) throws java.lang.Exception { org.ovirt.engine.core.utils.ovf.xml.XmlDocument xmlDocument = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( getXmlOvfData ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregDisks = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.utils.OvfUtils.updateUnregisteredDisksWithVMs ( unregDisks , org.ovirt.engine.core.compat.Guid.newGuid ( ) , "TestVM" , xmlDocument ) ; org.junit.Assert.assertTrue ( "The list of disks should not be empty" , unregDisks.isEmpty ( ) ) ; }
Source:
public void testAttachedStorageDomainLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; storageDomain.setDataCenter ( new org.ovirt.engine.api.model.DataCenter ( ) ) ; storageDomain.getDataCenter ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.DATA_CENTER_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , storageDomain ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.ATTACHED_STORAGE_DOMAIN_HREF , storageDomain.getHref ( ) ) ; }

Target:
public void testAttachedStorageDomainLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; storageDomain.setDataCenter ( new org.ovirt.engine.api.model.DataCenter ( ) ) ; storageDomain.getDataCenter ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.DATA_CENTER_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( storageDomain ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.ATTACHED_STORAGE_DOMAIN_HREF , storageDomain.getHref ( ) ) ; }
Source:
public static void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) . scheduleAFixedDelayJob ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance , "performLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }

Target:
public void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) . scheduleAFixedDelayJob ( this , "performLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }
Source:
private boolean isEditCommandExecutionAllowed ( java.util.List items ) { if ( items == null ) { return false ; } if ( ( items.size ( ) ) != 1 ) { return false ; } org.ovirt.engine.core.common.businessentities.VM selectedItem = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( items.get ( 0 ) ) ) ; return ( selectedItem.getVmPoolId ( ) ) == null ; }

Target:
private boolean isEditCommandExecutionAllowed ( java.util.List items ) { if ( items == null ) { return false ; } if ( ( items.size ( ) ) != 1 ) { return false ; } return true ; }
Source:
public void validateSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) ) ; setupMocks ( ) ; org.mockito.Mockito.doReturn ( getServer ( ) ) . when ( cmd ) . getUpServer ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validateSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) , null ) ) ; setupMocks ( ) ; org.mockito.Mockito.doReturn ( getServer ( ) ) . when ( cmd ) . getUpServer ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
public static void getNetworkLabelsByDataCenterId ( org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.ui.frontend.AsyncQuery query ) { query.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.SortedSet < java.lang.String > > ( ) { @ java.lang.Override public java.util.SortedSet < java.lang.String > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.SortedSet < java.lang.String > sortedSet = new java.util.TreeSet < java.lang.String > ( new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; sortedSet.addAll ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; return sortedSet ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworkLabelsByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , query ) ; }

Target:
public void getNetworkLabelsByDataCenterId ( org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.ui.frontend.AsyncQuery query ) { query.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.SortedSet < java.lang.String > > ( ) { @ java.lang.Override public java.util.SortedSet < java.lang.String > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.SortedSet < java.lang.String > sortedSet = new java.util.TreeSet < java.lang.String > ( new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; sortedSet.addAll ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; return sortedSet ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworkLabelsByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , query ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel ) ( vmListModel.getWindow ( ) ) ) ; model.setEntity ( returnValue ) ; org.ovirt.engine.ui.uicommonweb.UICommand tempVar = new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , vmListModel ) ; tempVar.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . configureLaterTitle ( ) ) ; tempVar.setIsDefault ( true ) ; tempVar.setIsCancel ( true ) ; model.getCommands ( ) . add ( tempVar ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel ) ( vmListModel.getWindow ( ) ) ) ; model.setEntity ( returnValue ) ; org.ovirt.engine.ui.uicommonweb.UICommand tempVar = new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , vmListModel ) ; tempVar.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . configureLaterTitle ( ) ) ; tempVar.setIsDefault ( true ) ; tempVar.setIsCancel ( true ) ; model.getCommands ( ) . add ( tempVar ) ; }
Source:
public void calculateFreeVirtualMemory ( ) { if ( ( ( ( getmem_commited ( ) ) != null ) && ( ( getphysical_mem_mb ( ) ) != null ) ) && ( ( getreserved_mem ( ) ) != null ) ) { maxSchedulingMemory = ( ( ( getmax_vds_memory_over_commit ( ) ) * ( getphysical_mem_mb ( ) ) ) / 100.0F ) - ( ( getmem_commited ( ) ) + ( getreserved_mem ( ) ) ) ; } }

Target:
public void calculateFreeVirtualMemory ( ) { if ( ( ( ( getmem_commited ( ) ) != null ) && ( ( getphysical_mem_mb ( ) ) != null ) ) && ( ( getreserved_mem ( ) ) != null ) ) { maxSchedulingMemory = ( ( ( getmax_vds_memory_over_commit ( ) ) * ( getphysical_mem_mb ( ) ) ) / 100.0F ) - ( ( getmem_commited ( ) ) + ( getreserved_mem ( ) ) ) ; maxSchedulingMemory = ( ( maxSchedulingMemory ) > 0 ) ? maxSchedulingMemory : 0 ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Boolean isFloppySupported = ( ( java.lang.Boolean ) ( returnValue ) ) ; if ( ! ( isFloppySupported.booleanValue ( ) ) ) { getAttachFloppy ( ) . setIsAvailable ( false ) ; getFloppyImage ( ) . setIsAvailable ( false ) ; } }

Target:
public void onSuccess ( java.lang.Boolean isFloppySupported ) { if ( ! isFloppySupported ) { getAttachFloppy ( ) . setIsAvailable ( false ) ; getFloppyImage ( ) . setIsAvailable ( false ) ; } }
Source:
protected org.ovirt.engine.core.common.errors.VdcBllErrors GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc xmlRpcStatus ) { try { org.ovirt.engine.core.common.errors.VdcBllErrors bllErrors = org.ovirt.engine.core.common.errors.VdcBllErrors.forValue ( xmlRpcStatus.mCode ) ; if ( bllErrors == null ) { org.ovirt.engine.core.vdsbroker.vdsbroker.BrokerCommandBase.log.warn ( ( "Weird return value: " + xmlRpcStatus ) ) ; bllErrors = org.ovirt.engine.core.common.errors.VdcBllErrors.unexpected ; } return bllErrors ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.core.common.errors.VdcBllErrors.unexpected ; } }

Target:
protected org.ovirt.engine.core.common.errors.VdcBllErrors GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc xmlRpcStatus ) { try { org.ovirt.engine.core.common.errors.VdcBllErrors bllErrors = org.ovirt.engine.core.common.errors.VdcBllErrors.forValue ( xmlRpcStatus.mCode ) ; if ( bllErrors == null ) { log.warn ( ( "Weird return value: " + xmlRpcStatus ) ) ; bllErrors = org.ovirt.engine.core.common.errors.VdcBllErrors.unexpected ; } return bllErrors ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.core.common.errors.VdcBllErrors.unexpected ; } }
Source:
private void initVirtResources ( ) { if ( InitializeStorage ( ) ) { processFencing ( ) ; processStoragePoolStatus ( ) ; } else { java.util.Map < java.lang.String , java.lang.String > customLogValues = java.util.Collections.singletonMap ( "StoragePoolName" , org.ovirt.engine.core.bll.InitVdsOnUpCommand.getStoragePoolName ( ) ) ; setNonOperational ( NonOperationalReason.STORAGE_DOMAIN_UNREACHABLE , customLogValues ) ; } }

Target:
private boolean initVirtResources ( ) { if ( InitializeStorage ( ) ) { processFencing ( ) ; processStoragePoolStatus ( ) ; } else { java.util.Map < java.lang.String , java.lang.String > customLogValues = java.util.Collections.singletonMap ( "StoragePoolName" , org.ovirt.engine.core.bll.InitVdsOnUpCommand.getStoragePoolName ( ) ) ; setNonOperational ( NonOperationalReason.STORAGE_DOMAIN_UNREACHABLE , customLogValues ) ; return false ; } return true ; }
Source:
private void mockNullVm ( ) { org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; mockGetForDisk ( null ) ; mockGetVmsListForDisk ( null ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( null ) ; }

Target:
private void mockNullVm ( ) { org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; mockGetForDisk ( ( ( org.ovirt.engine.core.common.businessentities.VM ) ( null ) ) ) ; mockGetVmsListForDisk ( null ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( null ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.SetDataCenter ( model , list ) ; getPoolModelBehaviorInitializedEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.SetDataCenter ( model , list ) ; getPoolModelBehaviorInitializedEvent ( ) . raise ( this , EventArgs.Empty ) ; }
Source:
public void nameIsAlreadyUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.any ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ) ) ; org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CLUSTER_CANNOT_DO_ACTION_NAME_IN_USE ) ) ; }

Target:
public void nameIsAlreadyUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ) ) ; org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CLUSTER_CANNOT_DO_ACTION_NAME_IN_USE ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentResourceTest.setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , true ) ; control.replay ( ) ; try { resource.get ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentResourceTest.setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , true ) ; try { resource.get ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.UpdateVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "DiskId" , "DiskInfo.WipeAfterDelete" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID , java.lang.Boolean.FALSE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.UpdateVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "DiskInfo.WipeAfterDelete" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.FALSE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }
Source:
public static void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; }
Source:
protected void updateIncomingId ( org.ovirt.engine.api.model.QuotaStorageLimit incoming , org.ovirt.engine.core.common.businessentities.Quota entity ) { if ( ( incoming.isSetStorageDomain ( ) ) && ( incoming.getStorageDomain ( ) . isSetId ( ) ) ) { incoming.setId ( incoming.getStorageDomain ( ) . getId ( ) ) ; } else { incoming.setId ( entity.getId ( ) . toString ( ) ) ; } }

Target:
private void updateIncomingId ( org.ovirt.engine.api.model.QuotaStorageLimit incoming , org.ovirt.engine.core.common.businessentities.Quota entity ) { if ( ( incoming.isSetStorageDomain ( ) ) && ( incoming.getStorageDomain ( ) . isSetId ( ) ) ) { incoming.setId ( incoming.getStorageDomain ( ) . getId ( ) ) ; } else { incoming.setId ( entity.getId ( ) . toString ( ) ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > createSlaves ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond ) { int slaveCount = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( 2 , 100 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( slaveCount ) ; for ( int i = 0 ; i < slaveCount ; i ++ ) { slaves.add ( createNic ( ( "eth" + i ) , bond.getName ( ) , null , null ) ) ; } return slaves ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > createSlaves ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond ) { int slaveCount = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( 2 , 100 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( slaveCount ) ; for ( int i = 0 ; i < slaveCount ; i ++ ) { slaves.add ( createNic ( ( "eth" + i ) , bond.getName ( ) , null , null ) ) ; } return slaves ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.StorageDomain a ) { return ( ( ! ( a.getStorageDomainType ( ) . isIsoOrImportExportDomain ( ) ) ) && ( ( a.getStatus ( ) ) != null ) ) && ( ( a.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.StorageDomain a ) { return ( ! ( a.getStorageDomainType ( ) . isIsoOrImportExportDomain ( ) ) ) && ( ( a.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNicSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , network.getVlanId ( ) , network.getName ( ) , network.isVmNetwork ( ) , network.getAddr ( ) ) ; return nic ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNicSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , network.getVlanId ( ) , network.getName ( ) , network.isVmNetwork ( ) , network.getAddr ( ) , null ) ; return nic ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( ( ( getQuota ( ) . getId ( ) ) == null ? null : getQuota ( ) . getId ( ) . getValue ( ) ) , org.ovirt.engine.core.common.VdcObjectType.Quota , getActionType ( ) . getActionGroup ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getQuota ( ) . getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Quota , getActionType ( ) . getActionGroup ( ) ) ) ; }
Source:
public void validateFailedGuestOsIsNotSupported ( ) { mockInterfaceList ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( 15 ) ; createVirtIODisk ( ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getOsName ( 15 ) ) . thenReturn ( "RHEL3x64" ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getDiskHotpluggableInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( java.util.Collections.emptySet ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; }

Target:
public void validateFailedGuestOsIsNotSupported ( ) { mockInterfaceList ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( 15 ) ; createVirtIODisk ( ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getOsName ( 15 ) ) . thenReturn ( "RHEL3x64" ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getDiskHotpluggableInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( ) ) ) . thenReturn ( java.util.Collections.emptySet ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > clusters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( returnValue ) ) ; dataCenterGuideModel.clusters = clusters ; dataCenterGuideModel.updateOptionsLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; dataCenterGuideModel.clusters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( returnValue ) ) ; dataCenterGuideModel.updateOptionsLocalFS ( ) ; }
Source:
public void testExecuteQueryCommand ( ) { org.ovirt.engine.core.common.queries.IdQueryParameters params = getQueryParameters ( ) ; org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( storageDoaminId ) ; org.ovirt.engine.core.bll.snapshots.GetAllDiskSnapshotsByStorageDomainIdQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = getQuery ( ) ; query.executeQueryCommand ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = query.getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertEquals ( "There should be two images returned" , diskImages.size ( ) , 2 ) ; org.junit.Assert.assertEquals ( "DiskImage should contain the VmSnapshotDescription" , diskImages.get ( 0 ) . getVmSnapshotDescription ( ) , org.ovirt.engine.core.bll.snapshots.GetAllDiskSnapshotsByStorageDomainIdQueryTest.snapshotDescription ) ; }

Target:
public void testExecuteQueryCommand ( ) { org.ovirt.engine.core.common.queries.IdQueryParameters params = getQueryParameters ( ) ; org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( storageDoaminId ) ; org.ovirt.engine.core.bll.snapshots.GetAllDiskSnapshotsByStorageDomainIdQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = getQuery ( ) ; query.executeQueryCommand ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = query.getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertEquals ( "There should be two images returned" , 2 , diskImages.size ( ) ) ; org.junit.Assert.assertEquals ( "DiskImage should contain the VmSnapshotDescription" , org.ovirt.engine.core.bll.snapshots.GetAllDiskSnapshotsByStorageDomainIdQueryTest.snapshotDescription , diskImages.get ( 0 ) . getVmSnapshotDescription ( ) ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "testAddIncompleteParameters" , "format" , "interface" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "testAddIncompleteParameters" , "interface" ) ; } }
Source:
private void attachStorageToDataCenter ( org.ovirt.engine.core.compat.Guid storageId , org.ovirt.engine.core.compat.Guid dataCenterId , java.lang.Boolean activateDomain ) { org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters params = new org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters ( storageId , dataCenterId ) ; params.setActivate ( activateDomain ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.AttachStorageDomainToPool , params , null , this ) ; }

Target:
private void attachStorageToDataCenter ( org.ovirt.engine.core.compat.Guid storageId , org.ovirt.engine.core.compat.Guid dataCenterId , java.lang.Boolean activateDomain ) { org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters params = new org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters ( storageId , dataCenterId ) ; if ( activateDomain != null ) { params.setActivate ( activateDomain ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.AttachStorageDomainToPool , params , null , this ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getDbFacade ( ) . getVmDao ( ) . getAllVmsRelatedToQuotaId ( org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getParameters ( ) . getQuotaId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( vm ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskImageByDiskAliasComparator ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.fillImagesBySnapshots ( vm ) ; } org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vms ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getDbFacade ( ) . getVmDao ( ) . getAllVmsRelatedToQuotaId ( org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getParameters ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( vm ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskImageByDiskAliasComparator ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.fillImagesBySnapshots ( vm ) ; } org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vms ) ; }
Source:
public void testConnectionWithValidMountOptionsSucceeds ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.NFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( getCommand ( ) ) . validateMountOptions ( ) ; org.mockito.Mockito.when ( getCommand ( ) . getStorageConnDao ( ) . get ( newPosixConnection.getId ( ) ) ) . thenReturn ( newPosixConnection ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( getCommand ( ) ) ; }

Target:
public void testConnectionWithValidMountOptionsSucceeds ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.NFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( command ) . validateMountOptions ( ) ; org.mockito.Mockito.when ( command.getStorageConnDao ( ) . get ( newPosixConnection.getId ( ) ) ) . thenReturn ( newPosixConnection ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public static void isPoolNameUnique ( 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 ! ( ( java.lang.Boolean ) ( source ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmPoolWithSameNameExists , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public void isPoolNameUnique ( 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 ! ( ( java.lang.Boolean ) ( source ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmPoolWithSameNameExists , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public static void getDataCenterList ( 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 ) { 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: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getDataCenterList ( 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 ) { 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: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public boolean validate ( ) { getName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation ( ) } ) ; return ( getName ( ) . getIsValid ( ) ) && ( getCustomPropertySheet ( ) . validate ( ) ) ; }

Target:
public boolean validate ( ) { getName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; return ( getName ( ) . getIsValid ( ) ) && ( getCustomPropertySheet ( ) . validate ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc vmUpdateDevice ( java.lang.String vmId , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct device ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.vmUpdateDevice ( vmId , device.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 vmUpdateDevice ( java.lang.String vmId , java.util.Map device ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.vmUpdateDevice ( vmId , device ) ; 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:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure , org.ovirt.engine.core.compat.Guid adElementId ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpPermissionsWithAdElementId ( adElementId ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure , org.ovirt.engine.core.compat.Guid adElementId ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpPermissionsWithAdElementId ( adElementId ) , failure ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.StorageConnection model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionsResourceTest.STORAGE_TYPES_MAPPED [ index ] . toString ( ) . toLowerCase ( ) , model.getType ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.StorageConnection model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionsResourceTest.STORAGE_TYPES_MAPPED [ index ] . toString ( ) . toLowerCase ( ) , model.getType ( ) . value ( ) ) ; verifyLinks ( model ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredClusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.filterByArchitecture ( clusters , vm.getClusterArch ( ) ) ; model.setDataCentersAndClusters ( model , java.util.Arrays.asList ( dataCenter ) , filteredClusters , vm.getVdsGroupId ( ) ) ; initTemplate ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredClusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterByArchitecture ( clusters , vm.getClusterArch ( ) ) ; model.setDataCentersAndClusters ( model , java.util.Arrays.asList ( dataCenter ) , filteredClusters , vm.getVdsGroupId ( ) ) ; initTemplate ( ) ; }
Source:
public void testMapHostId ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; entity.setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; entity.setRunOnVds ( guid ) ; org.ovirt.engine.api.restapi.utils.OsTypeMockUtils.mockOsTypes ( ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , null ) ; assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }

Target:
public void testMapHostId ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; entity.setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; entity.setRunOnVds ( guid ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , null ) ; assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; java.util.Collections.sort ( storageDomains , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; setStorageDomains ( storageDomains ) ; setDisks ( value ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { java.util.Collections.sort ( storageDomains , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; setStorageDomains ( storageDomains ) ; setDisks ( value ) ; }
Source:
public void initSelectedMacPool ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.MacPool > allMacPools = getMacPoolListModel ( ) . getItems ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool dc = getEntity ( ) ; if ( ( allMacPools != null ) && ( dc != null ) ) { org.ovirt.engine.core.compat.Guid macPoolId = dc.getMacPoolId ( ) ; for ( org.ovirt.engine.core.common.businessentities.MacPool macPool : allMacPools ) { if ( macPoolId == null ? macPool.isDefaultPool ( ) : macPoolId.equals ( macPool.getId ( ) ) ) { getMacPoolListModel ( ) . setSelectedItem ( macPool ) ; break ; } } } }

Target:
private void initSelectedMacPool ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.MacPool > allMacPools = getMacPoolListModel ( ) . getItems ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool dc = getEntity ( ) ; if ( ( allMacPools != null ) && ( dc != null ) ) { org.ovirt.engine.core.compat.Guid macPoolId = dc.getMacPoolId ( ) ; for ( org.ovirt.engine.core.common.businessentities.MacPool macPool : allMacPools ) { if ( macPool.getId ( ) . equals ( macPoolId ) ) { getMacPoolListModel ( ) . setSelectedItem ( macPool ) ; break ; } } } }
Source:
private boolean statusChanged ( org.ovirt.engine.core.common.businessentities.VM dbVm , org.ovirt.engine.core.common.businessentities.VmDynamic vdsmVm ) { return ( dbVm == null ) || ( ( ( dbVm.getStatus ( ) ) != ( vdsmVm.getStatus ( ) ) ) && ( ! ( ( ( dbVm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PreparingForHibernate ) ) && ( ( vdsmVm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) ) ) ; }

Target:
private boolean statusChanged ( org.ovirt.engine.core.common.businessentities.VM dbVm , org.ovirt.engine.core.common.businessentities.VmDynamic vdsmVm ) { return ( dbVm == null ) || ( ( dbVm.getStatus ( ) ) != ( vdsmVm.getStatus ( ) ) ) ; }
Source:
public void onChange ( com.google.gwt.event.dom.client.ChangeEvent event ) { java.util.List items = ( ( java.util.List ) ( object.getPmProxyPreferencesList ( ) . getItems ( ) ) ) ; java.lang.Object selectedItem = ( ( proxyListBox.getSelectedIndex ( ) ) >= 0 ) ? items.get ( proxyListBox.getSelectedIndex ( ) ) : null ; object.getPmProxyPreferencesList ( ) . setSelectedItem ( selectedItem ) ; }

Target:
public void onChange ( com.google.gwt.event.dom.client.ChangeEvent event ) { java.util.List < java.lang.String > items = ( ( java.util.List < java.lang.String > ) ( object.getPmProxyPreferencesList ( ) . getItems ( ) ) ) ; java.lang.String selectedItem = ( ( proxyListBox.getSelectedIndex ( ) ) >= 0 ) ? items.get ( proxyListBox.getSelectedIndex ( ) ) : null ; object.getPmProxyPreferencesList ( ) . setSelectedItem ( selectedItem ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; if ( ! ( qRetVal.getSucceeded ( ) ) ) { return null ; } return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( qRetVal.getReturnValue ( ) ) ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; return qRetVal.getSucceeded ( ) ? ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( qRetVal.getReturnValue ( ) ) ) : null ; }
Source:
public void testAddExistingBlockDomainSuccessfully ( ) { org.mockito.Mockito.when ( command.getStorageDomainStaticDAO ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( command.getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getSucceeded ( ) ) ; }

Target:
public void testAddExistingBlockDomainSuccessfully ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) . when ( command ) . getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getSucceeded ( ) ) ; }