auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetStorageConnectionNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingStorageConnection ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.STORAGE_CONNECTION_ID.toString ( ) } , null ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetStorageConnectionNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingStorageConnection ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.STORAGE_CONNECTION_ID.toString ( ) } , null ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void networkBelongsToClusterDataCenterValid ( ) throws java.lang.Exception { org.mockito.Mockito.when ( cluster.getStoragePoolId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.TEST_DC_ID1 ) ; org.mockito.Mockito.when ( network.getDataCenterId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.TEST_DC_ID1 ) ; org.junit.Assert.assertThat ( validator.networkBelongsToClusterDataCenter ( cluster , network ) , org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.isValid ( ) ) ; }

Target:
public void networkBelongsToClusterDataCenterValid ( ) throws java.lang.Exception { cluster.setStoragePoolId ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.TEST_DC_ID1 ) ; network.setDataCenterId ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.TEST_DC_ID1 ) ; org.junit.Assert.assertThat ( validator.networkBelongsToClusterDataCenter ( cluster , network ) , org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.isValid ( ) ) ; }
Source:
protected org.ovirt.engine.api.restapi.resource.BackendDeviceResource < org.ovirt.engine.api.model.WatchDog , org.ovirt.engine.api.model.WatchDogs , org.ovirt.engine.core.common.businessentities.VmWatchdog > getNotFoundResource ( ) { org.ovirt.engine.api.restapi.resource.BackendDeviceResource < org.ovirt.engine.api.model.WatchDog , org.ovirt.engine.api.model.WatchDogs , org.ovirt.engine.core.common.businessentities.VmWatchdog > ret = getResource ( GUIDS [ 2 ] ) ; ret.setUriInfo ( setUpBasicUriExpectations ( ) ) ; initResource ( ret ) ; initResource ( ret.getCollection ( ) ) ; return ret ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.WatchDog watchDog = resource.get ( ) ; verifyModel ( watchDog , 0 ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getPrimarySources ( org.ovirt.engine.core.common.businessentities.Cluster cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { final int highUtilization = tryParseWithDefault ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionBalancePolicyUnit.HIGH_UTILIZATION ) , getHighUtilizationDefaultValue ( ) ) ; final int cpuOverCommitDurationMinutes = tryParseWithDefault ( parameters.get ( "CpuOverCommitDurationMinutes" ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.CpuOverCommitDurationMinutes ) ) ; return getOverUtilizedCPUHosts ( candidateHosts , highUtilization , cpuOverCommitDurationMinutes ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getPrimarySources ( org.ovirt.engine.core.common.businessentities.Cluster cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { final int highUtilization = tryParseWithDefault ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionBalancePolicyUnit.HIGH_UTILIZATION ) , getHighUtilizationDefaultValue ( ) ) ; final int cpuOverCommitDurationMinutes = tryParseWithDefault ( parameters.get ( PolicyUnitParameter.CPU_OVERCOMMIT_DURATION_MINUTES.getDbName ( ) ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.CpuOverCommitDurationMinutes ) ) ; return getOverUtilizedCPUHosts ( candidateHosts , highUtilization , cpuOverCommitDurationMinutes ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > labelResolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetLabelById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.api.restapi.resource.Label entity = getEntity ( labelResolver , true ) ; org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > parent = constructor.create ( ) ; parent.setId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( parentId ) ) ; org.ovirt.engine.api.restapi.resource.Label updatedLabel = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( entity ) . removeEntity ( parent ) . build ( ) ; return performAction ( ActionType.UpdateLabel , new org.ovirt.engine.core.common.action.LabelActionParameters ( updatedLabel ) ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > labelResolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.QueryType.GetLabelById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.api.restapi.resource.Label entity = getEntity ( labelResolver , true ) ; org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > parent = constructor.create ( ) ; parent.setId ( org.ovirt.engine.api.restapi.utils.GuidUtils.asGuid ( parentId ) ) ; org.ovirt.engine.api.restapi.resource.Label updatedLabel = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( entity ) . removeEntity ( parent ) . build ( ) ; return performAction ( ActionType.UpdateLabel , new org.ovirt.engine.core.common.action.LabelActionParameters ( updatedLabel ) ) ; }
Source:
public void canMigrateMacsToAnotherMacPoolWhenThereIsAnyDuplicityAndThisIsAllowedValidationSucceeds ( ) { org.mockito.Mockito.when ( targetMacPool.isDuplicateMacAddressesAllowed ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( vmNicDao.getAllMacsByClusterId ( cluster.getId ( ) ) ) . thenReturn ( macsToMigrate ) ; org.junit.Assert.assertThat ( underTest.canMigrateMacsToAnotherMacPool ( cluster , targetMacPoolId ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void canMigrateMacsToAnotherMacPoolWhenThereIsAnyDuplicityAndThisIsAllowedValidationSucceeds ( ) { org.mockito.Mockito.when ( targetMacPool.isDuplicateMacAddressesAllowed ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( vmNicDao.getAllMacsByClusterId ( cluster.getId ( ) ) ) . thenReturn ( macsToMigrate ) ; org.hamcrest.MatcherAssert.assertThat ( underTest.canMigrateMacsToAnotherMacPool ( cluster , targetMacPoolId ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageDomainDynamicDAO ( ) ) ; staticDao = prepareDAO ( dbFacade.getStorageDomainStaticDAO ( ) ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.storage_domain_static ( ) ; newStaticDomain.setstorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.storage_domain_dynamic ( ) ; newDynamicDomain.setavailable_disk_size ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.USED_DISK_SIZE ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageDomainDynamicDao ( ) ) ; staticDao = prepareDAO ( dbFacade.getStorageDomainStaticDao ( ) ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.storage_domain_static ( ) ; newStaticDomain.setstorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.storage_domain_dynamic ( ) ; newDynamicDomain.setavailable_disk_size ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.USED_DISK_SIZE ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportNetworkData importData = importModel.getNetworkImportData ( object.getMacAddress ( ) ) ; java.util.ArrayList < java.lang.String > networkList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : importModel.getNetworks ( ) ) { networkList.add ( network.getName ( ) ) ; } ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( networkList ) ; return networkList.isEmpty ( ) ? "" : networkList.get ( 0 ) ; }

Target:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { destClusterEditor.setLabel ( constants.importVm_destCluster ( ) ) ; destClusterQuotaEditor.setLabel ( constants.importVm_destClusterQuota ( ) ) ; destStorageEditor.setLabel ( constants.storageDomainDisk ( ) ) ; cpuProfileEditor.setLabel ( constants.cpuProfileLabel ( ) ) ; disksAllocationEditor.setLabel ( constants.allocationDisk ( ) ) ; }
Source:
protected boolean canDoAction ( ) { disk = org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getParameters ( ) . getDiskId ( ) ) ; return ( ( ( ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmUpOrDown ( ) ) ) && ( isDiskExist ( disk ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( validate ( getSnapshotsValidator ( ) . vmNotDuringSnapshot ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVmId ( ) ) ) ) ; }

Target:
protected boolean canDoAction ( ) { disk = org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getParameters ( ) . getDiskId ( ) ) ; return ( ( ( ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmInUpPausedDownStatus ( ) ) ) && ( isDiskExist ( disk ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( validate ( getSnapshotsValidator ( ) . vmNotDuringSnapshot ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVmId ( ) ) ) ) ; }
Source:
protected org.ovirt.engine.api.model.Network postPopulate ( org.ovirt.engine.api.model.Network model ) { model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.NetworkStatus.class ) ) ) ; return super . postPopulate ( model ) ; }

Target:
protected org.ovirt.engine.api.model.Network postPopulate ( org.ovirt.engine.api.model.Network model ) { model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.NetworkStatus.class ) ) ) ; model.setUsages ( new org.ovirt.engine.api.model.Usages ( ) ) ; model.getUsages ( ) . getUsages ( ) . add ( "aaa" ) ; return super . postPopulate ( model ) ; }
Source:
private void auditLogHotSetCpusCandos ( ) { if ( ! ( setNumberOfCpusResult.getCanDoAction ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand ( new org.ovirt.engine.core.common.action.VmManagementParametersBase ( newVmStatic ) ) ; java.util.List < java.lang.String > canDos = org.ovirt.engine.core.bll.UpdateVmCommand.getBackend ( ) . getErrorsTranslator ( ) . TranslateErrorText ( setNumberOfCpusResult.getCanDoActionMessages ( ) ) ; logable.addCustomValue ( HotSetNumberOfCpusCommand.LOGABLE_FIELD_ERROR_MESSAGE , org.apache.commons.lang.StringUtils.join ( canDos , "," ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.FAILED_HOT_SET_NUMBER_OF_CPUS ) ; } }

Target:
private void auditLogHotSetCpusCandos ( org.ovirt.engine.core.common.action.HotSetNumerOfCpusParameters params ) { if ( ! ( setNumberOfCpusResult.getCanDoAction ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand ( params ) ; java.util.List < java.lang.String > canDos = org.ovirt.engine.core.bll.UpdateVmCommand.getBackend ( ) . getErrorsTranslator ( ) . TranslateErrorText ( setNumberOfCpusResult.getCanDoActionMessages ( ) ) ; logable.addCustomValue ( HotSetNumberOfCpusCommand.LOGABLE_FIELD_ERROR_MESSAGE , org.apache.commons.lang.StringUtils.join ( canDos , "," ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.FAILED_HOT_SET_NUMBER_OF_CPUS ) ; } }
Source:
private void addAuthenticationMethods ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.restapi.model.AuthenticationMethod [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_3 ) ) { version.setAuthenticationMethods ( new org.ovirt.engine.api.restapi.model.AuthenticationMethod ( ) ) ; for ( org.ovirt.engine.api.restapi.model.AuthenticationMethod authType : values ) { version.getAuthenticationMethods ( ) . getAuthenticationMethod ( ) . add ( authType.value ( ) ) ; } } }

Target:
private void addAuthenticationMethods ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.AuthenticationMethod [ ] values ) { version.setAuthenticationMethods ( new org.ovirt.engine.api.restapi.resource.AuthenticationMethods ( ) ) ; for ( org.ovirt.engine.api.model.AuthenticationMethod authType : values ) { version.getAuthenticationMethods ( ) . getAuthenticationMethod ( ) . add ( authType.value ( ) ) ; } }
Source:
public static void removeVmStatelessImages ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.bll.context.CommandContext context ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vmId , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.infoFormat ( "Deleting snapshot for stateless vm {0}" , vmId ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vmId ) , context ) ; } }

Target:
private void removeVmStatelessImages ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.bll.CommandContext context ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vmId , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.infoFormat ( "Deleting snapshot for stateless vm {0}" , vmId ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vmId ) , context ) ; core : Introducing = $missing$ ; org.ovirt.engine.core.bll.runInternalXXX at ; } }
Source:
public static void GetExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , java.lang.String path ) { 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_domains > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , aQuery ) ; }

Target:
public static void GetLocalFSPath ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RhevhLocalFSPath , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
private void verifyServiceOnServer2 ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_ID , service.getServiceId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_NAME , service.getServiceName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_TYPE , service.getServiceType ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.PID_2 , service.getPid ( ) ) ; org.junit.Assert.assertEquals ( GlusterServiceStatus.STOPPED , service.getStatus ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.VDS_NAME2 , service.getHostName ( ) ) ; }

Target:
private void verifyServiceOnServer2 ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service ) { org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_ID , service.getServiceId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_NAME , service.getServiceName ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_TYPE , service.getServiceType ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.PID_2 , service.getPid ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( GlusterServiceStatus.STOPPED , service.getStatus ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.VDS_NAME2 , service.getHostName ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; if ( org.ovirt.engine.core.bll.RunVmOnceCommand.isRunAsStateless ( ) ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( image.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , image.getStorageIds ( ) . get ( 0 ) , image.getActualSize ( ) ) ) ; } } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; if ( org.ovirt.engine.core.bll.RunVmOnceCommand.isRunAsStateless ( ) ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( image.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , image.getStorageIds ( ) . get ( 0 ) , image.getActualSize ( ) ) ) ; } } return list ; }
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST ) ; return false ; } if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) { addCanDoActionMessage ( VdcBllMessages.VM_CANNOT_CANCEL_MIGRATION_WHEN_VM_IS_NOT_MIGRATING ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST ) ; return false ; } if ( ! ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) { addCanDoActionMessage ( VdcBllMessages.VM_CANNOT_CANCEL_MIGRATION_WHEN_VM_IS_NOT_MIGRATING ) ; return false ; } return true ; }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue1 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue1 ) ) . getReturnValue ( ) ; java.util.Collections.sort ( vms , new org.ovirt.engine.ui.uicommonweb.Linq.VmComparator ( ) ) ; setItems ( ( ( java.util.ArrayList ) ( vms ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue1 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue1 ) ) . getReturnValue ( ) ; java.util.Collections.sort ( vms , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericNameableComparator ( ) ) ; setItems ( ( ( java.util.ArrayList ) ( vms ) ) ) ; }
Source:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmsWithNumaByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }

Target:
public void getHostNumaTopologyByHostId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNumaNode > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsNumaNodesByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , asyncQuery ) ; }
Source:
public org.ovirt.engine.core.utils.ovf.xml.XmlNode SelectSingleNode ( java.lang.String string ) { try { javax.xml.xpath.XPathFactory factory = javax.xml.xpath.XPathFactory.newInstance ( ) ; javax.xml.xpath.XPath xPath = factory.newXPath ( ) ; java.lang.Object o = xPath.evaluate ( string , doc , javax.xml.xpath.XPathConstants.NODE ) ; return new org.ovirt.engine.core.utils.ovf.xml.XmlNode ( ( ( org.w3c.dom.Node ) ( o ) ) ) ; } catch ( javax.xml.xpath.XPathExpressionException e ) { throw new java.lang.RuntimeException ( ( "Failed to evaluate xpath: " + string ) , e ) ; } }

Target:
public org.ovirt.engine.core.utils.ovf.xml.XmlNode selectSingleNode ( java.lang.String string ) { try { javax.xml.xpath.XPathFactory factory = javax.xml.xpath.XPathFactory.newInstance ( ) ; javax.xml.xpath.XPath xPath = factory.newXPath ( ) ; java.lang.Object o = xPath.evaluate ( string , doc , javax.xml.xpath.XPathConstants.NODE ) ; return new org.ovirt.engine.core.utils.ovf.xml.XmlNode ( ( ( org.w3c.dom.Node ) ( o ) ) ) ; } catch ( javax.xml.xpath.XPathExpressionException e ) { throw new java.lang.RuntimeException ( ( "Failed to evaluate xpath: " + string ) , e ) ; } }
Source:
public static void GetDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void GetClusterServerMemoryOverCommit ( 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.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers ) , aQuery ) ; }
Source:
public void testGetAllWithName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllWithName ( existingVds.getvds_name ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( existingVds.getvds_name ( ) , vds.getvds_name ( ) ) ; } }

Target:
public void testGetAllWithName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllWithName ( existingVds.getVdsName ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( existingVds.getVdsName ( ) , vds.getVdsName ( ) ) ; } }
Source:
protected boolean canRunVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { return getVmRunHandler ( ) . canRunVm ( vm , org.ovirt.engine.core.bll.RunVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVdsSelector ( ) , org.ovirt.engine.core.bll.RunVmCommand.getSnapshotsValidator ( ) , getVmPropertiesUtils ( ) ) ; }

Target:
protected org.ovirt.engine.core.bll.IsoDomainListSyncronizer getIsoDomainListSyncronizer ( ) { return org.ovirt.engine.core.bll.IsoDomainListSyncronizer.getInstance ( ) ; }
Source:
public void testChangeQuotaForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.ovirt.engine.core.compat.Guid quotaId = imageStorageDomainMap.getQuotaId ( ) ; if ( quotaId.equals ( FixturesTool.DEFAULT_QUOTA_GENERAL ) ) { org.junit.Assert.fail ( "Same source and dest quota id, cannot perform test" ) ; } dao.updateQuotaForImageAndSnapshots ( FixturesTool.IMAGE_GROUP_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , FixturesTool.DEFAULT_QUOTA_GENERAL ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; quotaId = imageStorageDomainMap.getQuotaId ( ) ; org.junit.Assert.assertEquals ( "quota wasn't changed" , FixturesTool.DEFAULT_QUOTA_GENERAL , quotaId ) ; }

Target:
public void testChangeQuotaForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.ovirt.engine.core.compat.Guid quotaId = imageStorageDomainMap.getQuotaId ( ) ; if ( quotaId.equals ( FixturesTool.DEFAULT_QUOTA_GENERAL ) ) { org.junit.jupiter.api.Assertions.fail ( "Same source and dest quota id, cannot perform test" ) ; } dao.updateQuotaForImageAndSnapshots ( FixturesTool.IMAGE_GROUP_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , FixturesTool.DEFAULT_QUOTA_GENERAL ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; quotaId = imageStorageDomainMap.getQuotaId ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.DEFAULT_QUOTA_GENERAL , quotaId , "quota wasn't changed" ) ; }
Source:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public void getIsGlusterVolumeSnapshotCliScheduleEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotCliScheduleFlag , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
protected boolean canDoAction ( ) { return ( super . canDoAction ( ) ) && ( validate ( networkClusterAttachmentExists ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator validator = new org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator ( getNetworkCluster ( ) ) ; return ( validate ( networkClusterAttachmentExists ( ) ) ) && ( ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isManagementNetwork ( getNetwork ( ) ) ) ) || ( validate ( validator.managementNetworkAttachment ( getNetworkName ( ) ) ) ) ) ; }
Source:
protected org.ovirt.engine.core.bll.IsoDomainListSyncronizer getIsoDomainListSyncronizer ( ) { return new org.ovirt.engine.core.bll.IsoDomainListSyncronizer ( ) { @ java.lang.Override protected void init ( ) { } @ java.lang.Override public org.ovirt.engine.core.compat.Guid findActiveISODomain ( org.ovirt.engine.core.compat.Guid storagePoolId ) { return new org.ovirt.engine.core.compat.Guid ( ) ; } } ; }

Target:
public void testVmNotDuringInitialization ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( false ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , true , null ) ; }
Source:
public void setHttpResponse ( javax.servlet.http.HttpServletResponse response , org.ovirt.engine.core.utils.PKIResources.Resource resource , org.ovirt.engine.core.utils.PKIResources.OutputType outputType , java.lang.String alias ) throws java.io.IOException { try ( java.io.PrintWriter out = response.getWriter ( ) ) { response.setContentType ( getContentType ( resource , outputType ) ) ; out.print ( getAsString ( resource , outputType , alias ) ) ; } }

Target:
public java.lang.String toString ( org.ovirt.engine.core.utils.PKIResources.Format format , java.lang.String alias ) { return ( format != null ? format : defaultFormat ) . toString ( cert , ( alias != null ? alias : defaultAlias ) ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result1.getState ( ) ) ) ; vmListModel1.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { vmListModel1.Cancel ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result1.getState ( ) ) ) ; vmListModel1.getWindow ( ) . stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { vmListModel1.cancel ( ) ; } }
Source:
public java.lang.String getVdsName ( ) { if ( ( vdsName ) == null ) { if ( ( getVdsNoLoad ( ) ) == null ) { if ( ( getVdsStatic ( ) ) != null ) { vdsName = getVdsStatic ( ) . getName ( ) ; } } else { if ( ( getVds ( ) ) != null ) { vdsName = getVds ( ) . getName ( ) ; } } } return vdsName ; }

Target:
public java.lang.String getVdsName ( ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( vdsName ) ) { if ( ( getVdsNoLoad ( ) ) == null ) { if ( ( getVdsStatic ( ) ) != null ) { vdsName = getVdsStatic ( ) . getName ( ) ; } } else { if ( ( getVds ( ) ) != null ) { vdsName = getVds ( ) . getName ( ) ; } } } return vdsName ; }
Source:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) ) ; }

Target:
public void validateSlaveHasNoLabelsHasNoOldNorNewLabelsValid ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) . setExistingInterfaces ( java.util.Arrays.asList ( slave ) ) . setHost ( host ) . build ( ) ; org.junit.Assert.assertThat ( validator.validateSlaveHasNoLabels ( slave.getName ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static void updateSpecificActionJobCompleted ( org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.common.action.VdcActionType actionType , boolean status ) { try { java.util.List < org.ovirt.engine.core.common.job.Job > jobs = org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . getJobsByEntityAndAction ( entityId , actionType ) ; for ( org.ovirt.engine.core.common.job.Job job : jobs ) { if ( ( job.getStatus ( ) ) == ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) job.markJobEnded ( status ) ; org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . updateCompletedJobAndSteps ( job ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.job.ExecutionHandler.log.error ( e ) ; } }

Target:
public static void updateSpecificActionJobCompleted ( org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.common.action.VdcActionType actionType , boolean status ) { try { java.util.List < org.ovirt.engine.core.common.job.Job > jobs = org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . getJobsByEntityAndAction ( entityId , actionType ) ; for ( org.ovirt.engine.core.common.job.Job job : jobs ) { if ( ( job.getStatus ( ) ) == ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) job.markJobEnded ( status ) ; org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . updateCompletedJobAndSteps ( job ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.job.ExecutionHandler.log.error ( "Exception" , e ) ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetPermissionsByAdElementIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetPermissionsByAdElementIdQuery.getDbFacade ( ) . getPermissionDao ( ) . getAllForAdElement ( org.ovirt.engine.core.bll.GetPermissionsByAdElementIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetPermissionsByAdElementIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetPermissionsByAdElementIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetPermissionsByAdElementIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetPermissionsByAdElementIdQuery.getDbFacade ( ) . getPermissionDao ( ) . getAllForAdElement ( org.ovirt.engine.core.bll.GetPermissionsByAdElementIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetPermissionsByAdElementIdQuery.getEngineSessionSeqId ( ) , org.ovirt.engine.core.bll.GetPermissionsByAdElementIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public boolean isCloudInitUsed ( ) { return ( ( getInitializationType ( ) ) == ( InitializationType.CloudInit ) ) && ( ! ( org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . isWindows ( getVmOsId ( ) ) ) ) ; }

Target:
public boolean isSysprepUsed ( ) { return ( ( ( getInitializationType ( ) ) == ( InitializationType.Sysprep ) ) && ( org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . isWindows ( getVmOsId ( ) ) ) ) && ( ( ( getFloppyPath ( ) ) == null ) || ( "" . equals ( getFloppyPath ( ) ) ) ) ; }
Source:
public void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > listOfRepoFiles = dao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOMAIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertTrue ( listOfRepoFiles.isEmpty ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.RepoImage newRepoFileMap = org.ovirt.engine.core.dao.RepoFileMetaDataDaoTest.getNewIsoRepoFile ( ) ; dao.addRepoFileMap ( newRepoFileMap ) ; listOfRepoFiles = dao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOMAIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.Assert.assertFalse ( listOfRepoFiles.isEmpty ( ) ) ; }

Target:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > listOfRepoFiles = dao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOMAIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.jupiter.api.Assertions.assertNotNull ( listOfRepoFiles ) ; org.junit.jupiter.api.Assertions.assertTrue ( listOfRepoFiles.isEmpty ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.RepoImage newRepoFileMap = org.ovirt.engine.core.dao.RepoFileMetaDataDaoTest.getNewIsoRepoFile ( ) ; dao.addRepoFileMap ( newRepoFileMap ) ; listOfRepoFiles = dao.getRepoListForStorageDomain ( FixturesTool.STORAGE_DOMAIN_NFS_ISO , ImageFileType.ISO ) ; org.junit.jupiter.api.Assertions.assertFalse ( listOfRepoFiles.isEmpty ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNic ( java.lang.String nicName , java.lang.String networkName ) { return createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , null , null , networkName , true , null , false , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNic ( java.lang.String nicName , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , null , null , networkName , true , null , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; mockCalculateBaseNicWhenBaseNicIsPassed ( nic ) ; return nic ; }
Source:
public void invalidPropertiesFormat ( ) { org.ovirt.engine.core.utils.customprop.DevicePropertiesUtils utils = mockDevicePropertiesUtils ( ) ; java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; map.put ( "bootable" , null ) ; java.util.List < org.ovirt.engine.core.utils.customprop.ValidationError > errors = utils.validateProperties ( Version.v3_3 , VmDeviceGeneralType.DISK , map ) ; org.ovirt.engine.core.utils.customprop.PropertiesUtilsTestHelper.validateFailure ( errors , ValidationFailureReason.SYNTAX_ERROR ) ; }

Target:
public void invalidPropertyValue1 ( ) { org.ovirt.engine.core.utils.customprop.DevicePropertiesUtils utils = mockDevicePropertiesUtils ( ) ; java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; map.put ( "bootable" , null ) ; java.util.List < org.ovirt.engine.core.utils.customprop.ValidationError > errors = utils.validateProperties ( Version.v3_3 , VmDeviceGeneralType.DISK , map ) ; org.ovirt.engine.core.utils.customprop.PropertiesUtilsTestHelper.validateFailure ( errors , ValidationFailureReason.INCORRECT_VALUE ) ; }
Source:
void addAddress ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { java.util.Map < java.lang.String , java.lang.String > addressMap = org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStringUtils.string2Map ( vmDevice.getAddress ( ) ) ; if ( ! ( addressMap.isEmpty ( ) ) ) { struct.put ( VdsProperties.Address , addressMap ) ; } }

Target:
void addAddress ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { java.util.Map < java.lang.String , java.lang.String > addressMap = org.ovirt.engine.core.utils.StringMapUtils.string2Map ( vmDevice.getAddress ( ) ) ; if ( ! ( addressMap.isEmpty ( ) ) ) { struct.put ( VdsProperties.Address , addressMap ) ; } }