auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean addOperation ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < ? , ? > operation , final boolean isPublic ) { final boolean isAllowedToExecute = ( loggedIn ) || isPublic ; final boolean operationCanBeAdded = ( ! ( operationQueue.contains ( operation ) ) ) || ( operation.allowDuplicates ( ) ) ; if ( isAllowedToExecute ) { if ( operationCanBeAdded && ( operationQueue.add ( operation ) ) ) { processor.processOperation ( this ) ; } } return isAllowedToExecute ; }

Target:
private boolean addOperation ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < ? , ? > operation , final boolean isPublic ) { final boolean isAllowedToExecute = ( loggedIn ) || isPublic ; final boolean operationCanBeAdded = ( ! ( operationQueue.contains ( operation ) ) ) || ( operation.allowDuplicates ( ) ) ; if ( isAllowedToExecute ) { if ( operationCanBeAdded && ( operationQueue.add ( operation ) ) ) { processor.processOperation ( this ) ; if ( engineSessionRefreshed ( operation ) ) { org.ovirt.engine.ui.frontend.communication.EngineSessionRefreshedEvent.fire ( eventBus ) ; } } } return isAllowedToExecute ; }
Source:
private static org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomain ( int availableSpace , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.setStorageDomainType ( StorageDomainType.Master ) ; sd.setStatus ( StorageDomainStatus.Active ) ; sd.setAvailableDiskSize ( availableSpace ) ; sd.setUsedDiskSize ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.USED_SPACE_GB ) ; sd.setId ( storageDomainId ) ; return sd ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomain ( int availableSpace , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.setStorageDomainType ( StorageDomainType.Master ) ; sd.setStatus ( StorageDomainStatus.Active ) ; sd.setAvailableDiskSize ( availableSpace ) ; sd.setUsedDiskSize ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.USED_SPACE_GB ) ; sd.setStoragePoolId ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_POOLD_ID ) ; sd.setId ( storageDomainId ) ; return sd ; }
Source:
public static void getStorageDomainList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.api.model.Tag lookupTagByName ( java.lang.String name ) { for ( org.ovirt.engine.core.common.businessentities.Tags tag : getBackendCollection ( org.ovirt.engine.core.common.businessentities.Tags.class , VdcQueryType.GetAllTags , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ) { if ( tag.gettag_name ( ) . equals ( name ) ) { return map ( tag ) ; } } return handleError ( new org.ovirt.engine.api.restapi.resource.EntityNotFoundException ( name ) , false ) ; }

Target:
protected org.ovirt.engine.api.model.Tag lookupTagByName ( java.lang.String name ) { for ( org.ovirt.engine.core.common.businessentities.Tags tag : getBackendCollection ( org.ovirt.engine.core.common.businessentities.Tags.class , VdcQueryType.GetAllTags , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ) { if ( tag.getTagName ( ) . equals ( name ) ) { return map ( tag ) ; } } return handleError ( new org.ovirt.engine.api.restapi.resource.EntityNotFoundException ( name ) , false ) ; }
Source:
protected void expectGetStorageDomainStatic ( org.ovirt.engine.core.compat.Guid domId ) { org.ovirt.engine.core.dao.StorageDomainStaticDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainStaticDAO.class ) ; org.mockito.Mockito.when ( db.getStorageDomainStaticDAO ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.get ( domId ) ) . thenReturn ( getStorageDomainStatic ( domId ) ) ; }

Target:
protected void expectGetStorageDomainStatic ( org.ovirt.engine.core.compat.Guid domId ) { org.ovirt.engine.core.dao.StorageDomainStaticDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainStaticDAO.class ) ; org.mockito.Mockito.when ( db.getStorageDomainStaticDao ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.get ( domId ) ) . thenReturn ( getStorageDomainStatic ( domId ) ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.storage.Disk o1 , org.ovirt.engine.core.common.businessentities.storage.Disk o2 ) { java.lang.Boolean boot1 = o1.isBoot ( ) ; java.lang.Boolean boot2 = o2.isBoot ( ) ; int bootResult = boot1.compareTo ( boot2 ) ; if ( ( bootResult == 0 ) && ( o1.isBoot ( ) ) ) { return java.lang.Boolean.compare ( o2.isDiskSnapshot ( ) , o1.isDiskSnapshot ( ) ) ; } return bootResult ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.storage.Disk o1 , org.ovirt.engine.core.common.businessentities.storage.Disk o2 ) { java.lang.Boolean boot1 = o1.getDiskVmElementForVm ( vmId ) . isBoot ( ) ; java.lang.Boolean boot2 = o2.getDiskVmElementForVm ( vmId ) . isBoot ( ) ; int bootResult = boot1.compareTo ( boot2 ) ; if ( ( bootResult == 0 ) && boot1 ) { return java.lang.Boolean.compare ( o2.isDiskSnapshot ( ) , o1.isDiskSnapshot ( ) ) ; } return bootResult ; }
Source:
private void Edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel.createInstance ( getEntityStronglyTyped ( ) , cluster.getcompatibility_version ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ) ( getItems ( ) ) ) , ( ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface ) ( getSelectedItem ( ) ) ) , this ) ; setWindow ( model ) ; }

Target:
private void Edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel.createInstance ( getEntityStronglyTyped ( ) , cluster.getcompatibility_version ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , ( ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ) ( getSelectedItem ( ) ) ) , this ) ; setWindow ( model ) ; }
Source:
protected boolean canAddVm ( java.util.List < java.lang.String > reasons , java.lang.String name , org.ovirt.engine.core.compat.Guid storagePoolId , int vmPriority ) { if ( isVmWithSameNameExists ( name , storagePoolId ) ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED.name ( ) ) ; return false ; } if ( ! ( verifyAddVM ( reasons , vmPriority ) ) ) { return false ; } if ( ! ( checkTemplateImages ( reasons ) ) ) { return false ; } return true ; }

Target:
protected boolean canAddVm ( java.util.List < java.lang.String > reasons , java.lang.String name , org.ovirt.engine.core.compat.Guid storagePoolId , int vmPriority ) { if ( isVmWithSameNameExists ( name , storagePoolId ) ) { reasons.add ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED.name ( ) ) ; return false ; } if ( ! ( verifyAddVM ( reasons , vmPriority ) ) ) { return false ; } if ( ! ( checkTemplateImages ( reasons ) ) ) { return false ; } return true ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > searchVMTemplates ( ) { return genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVmTemplateDAO ( ) , true , new org.ovirt.engine.core.common.utils.ListUtils.Filter < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > filter ( final java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > data ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable vmt_helper : data ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmt = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( vmt_helper ) ) ; org.ovirt.engine.core.bll.VmTemplateHandler.UpdateDisksFromDb ( vmt ) ; } return data ; } } ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > searchVMTemplates ( ) { return genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVmTemplateDao ( ) , true , new org.ovirt.engine.core.common.utils.ListUtils.Filter < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > filter ( final java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > data ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable vmt_helper : data ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmt = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( vmt_helper ) ) ; org.ovirt.engine.core.bll.VmTemplateHandler.UpdateDisksFromDb ( vmt ) ; } return data ; } } ) ; }
Source:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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 ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void write ( byte [ ] b , int off , int len ) { if ( ( count ) < ( this . max ) ) { super . write ( b , off , len ) ; } else { this . truncated = true ; } }

Target:
public void write ( byte [ ] b , int off , int len ) { if ( ( count ) < ( _max ) ) { super . write ( b , off , len ) ; } else { _truncated = true ; } }
Source:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { 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.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { 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.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createBondSlave ( org.ovirt.engine.core.common.businessentities.network.Bond bond , java.lang.String slaveName ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slaveA = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; slaveA.setName ( slaveName ) ; slaveA.setBondName ( bond.getName ( ) ) ; slaveA.setBonded ( true ) ; return slaveA ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createBondSlave ( org.ovirt.engine.core.common.businessentities.network.Bond bond , java.lang.String slaveName ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; slave.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; slave.setName ( slaveName ) ; slave.setBondName ( bond.getName ( ) ) ; slave.setBonded ( false ) ; return slave ; }
Source:
public static void IsDirectLUNDiskEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters params = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DirectLUNDiskEnabled ) ; params.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( params , aQuery ) ; }

Target:
public static void IsDirectLunDiskEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters params = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DirectLUNDiskEnabled ) ; params.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( params , aQuery ) ; }
Source:
public void correlationIdTooLong ( ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = new org.ovirt.engine.core.common.action.VdcActionParametersBase ( ) ; parameters.setCorrelationId ( org.apache.commons.lang.StringUtils.leftPad ( "" , ( ( org.ovirt.engine.core.common.businessentities.BusinessEntitiesDefinitions.CORRELATION_ID_SIZE ) + 1 ) , "A" ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.job.ExecutionHandler.evaluateCorrelationId ( parameters ) ; org.junit.Assert.assertNotNull ( "Correlation id exceeds max size" , result ) ; org.junit.Assert.assertFalse ( "Correlation id exceeds max size" , result.getSucceeded ( ) ) ; }

Target:
public void correlationIdTooLong ( ) { org.ovirt.engine.core.common.action.ActionParametersBase parameters = new org.ovirt.engine.core.common.action.ActionParametersBase ( ) ; parameters.setCorrelationId ( org.apache.commons.lang.StringUtils.leftPad ( "" , ( ( org.ovirt.engine.core.common.businessentities.BusinessEntitiesDefinitions.CORRELATION_ID_SIZE ) + 1 ) , "A" ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.job.ExecutionHandler.evaluateCorrelationId ( parameters ) ; org.junit.Assert.assertNotNull ( "Correlation id exceeds max size" , result ) ; org.junit.Assert.assertFalse ( "Correlation id exceeds max size" , result.getSucceeded ( ) ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > FindAllStorageDomainsBySharedStatus ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > items , org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus status ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain i : items ) { if ( ( i.getStorageDomainSharedStatus ( ) ) == status ) { ret.add ( i ) ; } } return ret ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > findAllStorageDomainsBySharedStatus ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > items , org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus status ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain i : items ) { if ( ( i.getStorageDomainSharedStatus ( ) ) == status ) { ret.add ( i ) ; } } return ret ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue currentVmsInPoolQuery = runInternalQuery ( VdcQueryType.GetAllPoolVms , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.bll.UpdateVmPoolCommand.getVmPool ( ) . getVmPoolId ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > poolVmsBeforeAdd = ( currentVmsInPoolQuery.getSucceeded ( ) ) ? currentVmsInPoolQuery.getReturnValue ( ) : null ; super . executeCommand ( ) ; org.ovirt.engine.core.bll.UpdateVmPoolCommand.getCompensationContext ( ) . cleanupCompensationDataAfterSuccessfulCommand ( ) ; if ( ( org.ovirt.engine.core.bll.UpdateVmPoolCommand.getSucceeded ( ) ) && ( isUpdateVmRequired ( poolVmsBeforeAdd ) ) ) { updatePoolVms ( poolVmsBeforeAdd ) ; } vmPoolMonitor.triggerPoolMonitoringJob ( ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue currentVmsInPoolQuery = runInternalQuery ( QueryType.GetAllPoolVms , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.bll.UpdateVmPoolCommand.getVmPool ( ) . getVmPoolId ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > poolVmsBeforeAdd = ( currentVmsInPoolQuery.getSucceeded ( ) ) ? currentVmsInPoolQuery.getReturnValue ( ) : null ; super . executeCommand ( ) ; org.ovirt.engine.core.bll.UpdateVmPoolCommand.getCompensationContext ( ) . cleanupCompensationDataAfterSuccessfulCommand ( ) ; if ( ( org.ovirt.engine.core.bll.UpdateVmPoolCommand.getSucceeded ( ) ) && ( isUpdateVmRequired ( poolVmsBeforeAdd ) ) ) { updatePoolVms ( poolVmsBeforeAdd ) ; } vmPoolMonitor.triggerPoolMonitoringJob ( ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VDS [ ] data ( ) { org.ovirt.engine.core.common.businessentities.VDS vds1 = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds2 = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds2.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds3 = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds3.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vds3.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return new org.ovirt.engine.core.common.businessentities.VDS [ ] { vds1 , vds2 , vds3 } ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VDS [ ] data ( ) { org.ovirt.engine.core.common.businessentities.VDS vds1 = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds2 = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds2.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds3 = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds3.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vds3.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return new org.ovirt.engine.core.common.businessentities.VDS [ ] { vds1 , vds2 , vds3 } ; }
Source:
public void onSuccess ( java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.String > idToIconMap ) { destination.getIcon ( ) . setEntity ( new org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault ( idToIconMap.get ( iconId ) , idToIconMap.get ( defaultIconId ) , source.getSmallIconId ( ) ) ) ; rest.head ( ) . build ( source , destination , rest.tail ( ) ) ; }

Target:
public void onSuccess ( java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.String > idToIconMap ) { destination.getIcon ( ) . setEntity ( new org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault ( idToIconMap.get ( iconId ) , idToIconMap.get ( defaultIconId ) , source.getSmallIconId ( ) , org.ovirt.engine.ui.uicommonweb.validation.ValidationResult.ok ( ) ) ) ; rest.head ( ) . build ( source , destination , rest.tail ( ) ) ; }
Source:
public void testNegativeAndPositiveAffinity ( ) throws java.lang.Exception { hosts = java.util.Arrays.asList ( host_positive_enforcing , host_negative_enforcing , host_not_in_affinity_group ) ; java.util.List < org.ovirt.engine.core.common.scheduling.AffinityGroup > affinityGroups = java.util.Arrays.asList ( positive_enforcing_group , negative_enforcing_group ) ; org.mockito.Mockito.doReturn ( affinityGroups ) . when ( affinityGroupDao ) . getAllAffinityGroupsByVmId ( org.mockito.Matchers.any ( ) ) ; org.assertj.core.api.Assertions.assertThat ( unit.filter ( cluster , hosts , vm , new java.util.HashMap < > ( ) , new org.ovirt.engine.core.common.scheduling.PerHostMessages ( ) ) ) . contains ( host_positive_enforcing ) . doesNotContain ( host_negative_enforcing ) ; }

Target:
public void testNegativeAndPositiveAffinity ( ) throws java.lang.Exception { hosts = java.util.Arrays.asList ( host_positive_enforcing , host_negative_enforcing , host_not_in_affinity_group ) ; java.util.List < org.ovirt.engine.core.common.scheduling.AffinityGroup > affinityGroups = java.util.Arrays.asList ( positive_enforcing_group , negative_enforcing_group ) ; org.mockito.Mockito.doReturn ( affinityGroups ) . when ( affinityGroupDao ) . getAllAffinityGroupsByVmId ( org.mockito.ArgumentMatchers.any ( ) ) ; org.assertj.core.api.Assertions.assertThat ( unit.filter ( cluster , hosts , vm , new java.util.HashMap < > ( ) , new org.ovirt.engine.core.common.scheduling.PerHostMessages ( ) ) ) . contains ( host_positive_enforcing ) . doesNotContain ( host_negative_enforcing ) ; }
Source:
public void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
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.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.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 ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateHostIsReadyToRun ( final org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { sb.append ( " VDS " ) . append ( vds.getvds_name ( ) ) . append ( " " ) . append ( vds.getId ( ) ) . append ( " " ) ; for ( org.ovirt.engine.core.bll.VdsSelector.HostValidator validator : this . hostValidators ) { org.ovirt.engine.core.bll.ValidationResult result = validator.validate ( vds , sb ) ; if ( result != null ) { return result ; } } return ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateHostIsReadyToRun ( final org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { sb.append ( " VDS " ) . append ( vds.getvds_name ( ) ) . append ( " " ) . append ( vds.getId ( ) ) . append ( " " ) ; for ( org.ovirt.engine.core.bll.VdsSelector.HostValidator validator : this . hostValidators ) { org.ovirt.engine.core.dal.VdcBllMessages result = validator.validate ( vds , sb ) ; if ( result != null ) { return new org.ovirt.engine.core.bll.ValidationResult ( result ) ; } } return ValidationResult.VALID ; }
Source:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
private static void constructGroupsMembershipTree ( org.ovirt.engine.api.extensions.ExtMap entity , org.ovirt.engine.api.extensions.ExtKey key , java.util.Map < java.lang.String , org.ovirt.engine.api.extensions.ExtMap > groupsCache ) { java.util.List < org.ovirt.engine.api.extensions.ExtMap > groups = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.extensions.ExtMap memberOf : entity.get ( key , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { org.ovirt.engine.core.aaa.AuthzUtils.constructGroupsMembershipTree ( memberOf , GroupRecord.GROUPS , groupsCache ) ; groups.add ( groupsCache.get ( memberOf.get ( GroupRecord.ID ) ) ) ; } entity.put ( key , groups ) ; }

Target:
private static org.ovirt.engine.api.extensions.ExtMap constructGroupsMembershipTree ( org.ovirt.engine.api.extensions.ExtMap entity , org.ovirt.engine.api.extensions.ExtKey key , java.util.Map < java.lang.String , org.ovirt.engine.api.extensions.ExtMap > groupsCache ) { java.util.List < org.ovirt.engine.api.extensions.ExtMap > groups = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.extensions.ExtMap memberOf : entity.get ( key , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { groups.add ( org.ovirt.engine.core.aaa.AuthzUtils.constructGroupsMembershipTree ( groupsCache.get ( memberOf.get ( GroupRecord.ID ) ) . clone ( ) , GroupRecord.GROUPS , groupsCache ) ) ; } entity.put ( key , groups ) ; return entity ; }
Source:
public static void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public static void getAllVnicProfiles ( 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVnicProfiles , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap saveImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . save ( diskImage.getImage ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( diskImage.getImageId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getQuotaId ( ) , diskImage.getDiskProfileId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . save ( imageStorageDomainMap ) ; return imageStorageDomainMap ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap saveImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { imageDao.save ( diskImage.getImage ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( diskImage.getImageId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getQuotaId ( ) , diskImage.getDiskProfileId ( ) ) ; imageStorageDomainMapDao.save ( imageStorageDomainMap ) ; return imageStorageDomainMap ; }
Source:
public static void getSpiceUsbAutoShare ( 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.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
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 ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > asImages ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { if ( disks == null ) { return null ; } java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > res = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.IMAGE ) ) { res.add ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ) ; } } return res ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > asImages ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { if ( disks == null ) { return null ; } java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > res = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { res.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ) ; } } return res ; }
Source:
private void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public void getExternalProviderComputeResourceList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalComputeResource > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetComputeResourceFromExternalProvider , params , aQuery ) ; }
Source:
public void testAdd ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpGetConsoleExpectations ( 0 , 0 , 1 ) ; setUpGetSoundcardExpectations ( 1 ) ; setUpGetBallooningExpectations ( 0 , 0 ) ; setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpVm ( GUIDS [ 1 ] ) ) ; super . testAdd ( ) ; }

Target:
public void testAdd ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpGetConsoleExpectations ( 0 , 0 , 1 ) ; setUpGetSoundcardExpectations ( 1 ) ; setUpGetBallooningExpectations ( 0 , 0 ) ; setUpGetEntityExpectations ( QueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpVm ( GUIDS [ 1 ] ) ) ; super . testAdd ( ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap saveImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . save ( diskImage.getImage ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( diskImage.getImageId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getQuotaId ( ) , diskImage.getDiskProfileId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . save ( imageStorageDomainMap ) ; return imageStorageDomainMap ; }

Target:
public void init ( ) { super . init ( ) ; if ( ( org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getParameters ( ) ) instanceof org.ovirt.engine.core.common.action.ImagesContainterParametersBase ) { initContainerDetails ( ( ( org.ovirt.engine.core.common.action.ImagesContainterParametersBase ) ( org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getParameters ( ) ) ) ) ; } }
Source:
public void hostStatusInvalid ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.UpdateHostValidator ( dbFacade , oldHost , host , false ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . isUpdateValid ( ) ; org.junit.Assert.assertThat ( validator.hostStatusValid ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.VDS_STATUS_NOT_VALID_FOR_UPDATE ) ) ; }

Target:
public void hostStatusInvalid ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.UpdateHostValidator ( dbFacade , oldHost , host , false ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . isUpdateValid ( ) ; org.junit.Assert.assertThat ( validator.hostStatusValid ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_STATUS_NOT_VALID_FOR_UPDATE ) ) ; }
Source:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackend ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE ) ; }
Source:
private void incrementVdsPendingVmsCount ( ) { synchronized ( _vds_pending_vm_count ) { if ( ! ( _vds_pending_vm_count.containsKey ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) ) ) ) { _vds_pending_vm_count.put ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) , 1 ) ; } else { int i = _vds_pending_vm_count.get ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) ) ; _vds_pending_vm_count.put ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) , ( i + 1 ) ) ; } } }

Target:
protected java.util.List < java.lang.Class < ? > > getValidationGroups ( ) { org.ovirt.engine.core.bll.RunVmCommand.addValidationGroup ( org.ovirt.engine.core.common.validation.group.StartEntity.class ) ; return super . getValidationGroups ( ) ; }
Source:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true , getEntity ( 0 ) ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true , getEntity ( 0 ) ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void executeCommand ( ) { setUpMocksForAdd ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 3 ) ) . removeGlusterServerHook ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_ADDED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommand ( ) { setUpMocksForAdd ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 3 ) ) . removeGlusterServerHook ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( AuditLogType.GLUSTER_HOOK_ADDED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void testVmsRule ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; model.setEnforcing ( true ) ; model.setPositive ( false ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.Assert.assertEquals ( EntityAffinityRule.NEGATIVE , entity.getVmAffinityRule ( ) ) ; org.junit.Assert.assertEquals ( true , entity.isVmEnforcing ( ) ) ; org.junit.Assert.assertEquals ( true , entity.isVmAffinityEnabled ( ) ) ; }

Target:
public void testVmsRule ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; model.setEnforcing ( true ) ; model.setPositive ( false ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.Assert.assertEquals ( EntityAffinityRule.NEGATIVE , entity.getVmAffinityRule ( ) ) ; org.junit.Assert.assertTrue ( entity.isVmEnforcing ( ) ) ; org.junit.Assert.assertTrue ( entity.isVmAffinityEnabled ( ) ) ; }