auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getNextAvailableDiskAliasNameByVMId ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.String > aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private boolean consumeForVdsQuota ( org.ovirt.engine.core.compat.Guid quotaId ) { org.ovirt.engine.core.bll.quota.QuotaConsumptionParametersWrapper parameters = null ; try { parameters = parametersWrapper.clone ( ) ; parameters.getParameters ( ) . add ( new org.ovirt.engine.core.bll.quota.QuotaVdsGroupConsumptionParameter ( quotaId , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID , 1 , 1 ) ) ; } catch ( java.lang.CloneNotSupportedException e ) { } return quotaManager.consume ( parameters ) ; }

Target:
private boolean consumeForVdsQuota ( org.ovirt.engine.core.compat.Guid quotaId ) { org.ovirt.engine.core.bll.quota.QuotaConsumptionParametersWrapper parameters = null ; try { parameters = parametersWrapper.clone ( ) ; parameters.getParameters ( ) . add ( new org.ovirt.engine.core.bll.quota.QuotaClusterConsumptionParameter ( quotaId , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID , 1 , 1 ) ) ; } catch ( java.lang.CloneNotSupportedException e ) { } return quotaManager.consume ( parameters ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames = ( ( java.util.HashMap < java.lang.Integer , java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { linuxOsIds = ( ( java.util.ArrayList < java.lang.Integer > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; }
Source:
private void CacheFencingAgentsOptionTypes ( ) { java.lang.String localfencingOptionTypes = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.VdsFenceOptionTypes ) ; java.lang.String [ ] types = localfencingOptionTypes.split ( org.ovirt.engine.core.compat.StringHelper.quote ( org.ovirt.engine.core.utils.pm.VdsFencingOptions.COMMA ) , ( - 1 ) ) ; for ( java.lang.String entry : types ) { java.lang.String [ ] optionKeyVal = entry.split ( org.ovirt.engine.core.compat.StringHelper.quote ( org.ovirt.engine.core.utils.pm.VdsFencingOptions.EQUAL ) , ( - 1 ) ) ; org.ovirt.engine.core.utils.pm.VdsFencingOptions.fencingOptionTypes.put ( optionKeyVal [ 0 ] , optionKeyVal [ 1 ] ) ; } }

Target:
private void CacheFencingAgentsOptionTypes ( ) { java.lang.String localfencingOptionTypes = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.VdsFenceOptionTypes ) ; java.lang.String [ ] types = localfencingOptionTypes.split ( org.ovirt.engine.core.compat.StringHelper.quote ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.COMMA ) , ( - 1 ) ) ; for ( java.lang.String entry : types ) { java.lang.String [ ] optionKeyVal = entry.split ( org.ovirt.engine.core.compat.StringHelper.quote ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.EQUAL ) , ( - 1 ) ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionTypes.put ( optionKeyVal [ 0 ] , optionKeyVal [ 1 ] ) ; } }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.ListModel model ) { edit ( model , null ) ; }

Target:
private void init ( ) { vnicProfiles = profilesModel.getItems ( ) ; if ( ( vnicProfiles ) == null ) { vnicProfiles = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } vnics.clear ( ) ; realEntryCount = 0 ; java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.vms.VnicInstanceType > values = vnicsModel.getItems ( ) ; if ( values != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.VnicInstanceType value : values ) { vnics.add ( value.getNetworkInterface ( ) ) ; } } updateHeaderLabel ( ) ; super . init ( vnicsModel ) ; }
Source:
public void getProviderCertificateChain ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetProviderCertificateChainText , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return java.util.Collections.< org.ovirt.engine.core.common.businessentities.CertificateInfo > emptyList ( ) ; } return source ; }
Source:
protected void processOutgoing ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final java.nio.ByteBuffer buff = outbox.peekLast ( ) ; if ( buff == null ) { return ; } write ( buff ) ; if ( ! ( buff.hasRemaining ( ) ) ) { outbox.removeLast ( ) ; } updateInterestedOps ( ) ; }

Target:
protected void processOutgoing ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final java.nio.ByteBuffer buff = outbox.peekLast ( ) ; if ( buff == null ) { return ; } write ( buff ) ; if ( ! ( buff.hasRemaining ( ) ) ) { outbox.removeLast ( ) ; } updateLastOutgoingHeartbeat ( ) ; updateInterestedOps ( ) ; }
Source:
protected void configure ( ) { bind ( org.ovirt.engine.ui.uicommonweb.ConsoleOptionsFrontendPersister.class ) . to ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.class ) . in ( com.google.inject.Singleton.class ) ; }

Target:
protected void configure ( ) { bind ( org.ovirt.engine.ui.uicommonweb.ConsoleOptionsFrontendPersister.class ) . to ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.ConsoleUtils.class ) . to ( org.ovirt.engine.ui.common.utils.ConsoleUtilsImpl.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.ConsoleManager.class ) . to ( org.ovirt.engine.ui.common.utils.ConsoleManagerImpl.class ) . in ( com.google.inject.Singleton.class ) ; }
Source:
public void testInvalidUpdateOfNonEditableFieldOnRunningVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; boolean updateIsValid = vmHandler.isUpdateValid ( src , dest ) ; org.junit.Assert.assertFalse ( "Update should be invalid for different IDs" , updateIsValid ) ; }

Target:
public void testInvalidUpdateOfNonEditableFieldOnRunningVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; boolean updateIsValid = vmHandler.isUpdateValid ( src , dest ) ; org.junit.jupiter.api.Assertions.assertFalse ( updateIsValid , "Update should be invalid for different IDs" ) ; }
Source:
public org.ovirt.engine.core.bll.network.macpool.MacPool createDecoratedPool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool , java.util.List < org.ovirt.engine.core.bll.network.macpool.MacPoolDecorator > decorators ) { org.ovirt.engine.core.bll.network.macpool.MacPool lockedPool = lockedObjectFactory.createLockingInstance ( macPool , org.ovirt.engine.core.bll.network.macpool.MacPool.class , lockForMacPool ( macPool.getId ( ) ) ) ; org.ovirt.engine.core.bll.network.macpool.MacPool decoratedPool = decoratePool ( lockedPool , decorators ) ; return decoratedPool ; }

Target:
public org.ovirt.engine.core.bll.network.macpool.MacPool createDecoratedPool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool , java.util.List < org.ovirt.engine.core.bll.network.macpool.MacPoolDecorator > decorators ) { org.ovirt.engine.core.bll.network.macpool.MacPool lockedPool = lockedObjectFactory.createLockingInstance ( macPool , org.ovirt.engine.core.bll.network.macpool.MacPool.class , lockForMacPool ( macPool.getId ( ) ) ) ; org.ovirt.engine.core.bll.network.macpool.MacPool decoratedPool = decoratePool ( lockedPool , decorators ) ; org.ovirt.engine.core.bll.network.macpool.DecoratedMacPoolFactory.log.debug ( "MacPool decorated as {}." , macPool , decoratedPool ) ; return decoratedPool ; }
Source:
protected final void executeValidatedCommands ( org.ovirt.engine.core.bll.CommandBase < ? > command ) { if ( command.getReturnValue ( ) . getCanDoAction ( ) ) { if ( ( ( executionContext ) == null ) || ( executionContext.isMonitored ( ) ) ) { org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , command.isInternalExecution ( ) , new java.lang.Boolean ( hasCorrelationIdMap.get ( command.getCommandId ( ) ) ) ) ; } org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setCorrelationId ( command.getCorrelationId ( ) ) ; command.ExecuteAction ( ) ; } }

Target:
protected final void executeValidatedCommands ( org.ovirt.engine.core.bll.CommandBase < ? > command ) { if ( command.getReturnValue ( ) . getCanDoAction ( ) ) { if ( ( ( executionContext ) == null ) || ( executionContext.isMonitored ( ) ) ) { org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , command.isInternalExecution ( ) , new java.lang.Boolean ( hasCorrelationIdMap.get ( command.getCommandId ( ) ) ) ) ; } org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setCorrelationId ( command.getCorrelationId ( ) ) ; command.executeAction ( ) ; } }
Source:
public void validateSlaveHasNoLabelsHasOldLabel ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; slave.setLabels ( new java.util.HashSet < > ( java.util.Arrays.asList ( "lbl1" ) ) ) ; 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 ( ) ; assertValidateSlaveHasNoLabelsFailed ( validator , slave.getName ( ) ) ; }

Target:
public void validateSlaveHasNoLabelsHasOldLabel ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; slave.setLabels ( java.util.Collections.singleton ( "lbl1" ) ) ; 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.Collections.singletonList ( slave ) ) . setHost ( host ) . build ( ) ; assertValidateSlaveHasNoLabelsFailed ( validator , slave.getName ( ) ) ; }
Source:
public static void GetAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
private static 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.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic staticData = getVds ( ) . getStaticData ( ) ; getCompensationContext ( ) . snapshotEntity ( staticData ) ; staticData.setvds_group_id ( targetClusterId ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStaticDAO ( ) . update ( staticData ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic staticData = getVds ( ) . getStaticData ( ) ; getCompensationContext ( ) . snapshotEntity ( staticData ) ; staticData.setvds_group_id ( targetClusterId ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStaticDao ( ) . update ( staticData ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public void getLabelList ( 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllLabels , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.businessentities.StorageDomainStatic > aQuery , java.lang.String storageDomainName ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }
Source:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( isShareableDiskEnabled ) ; }

Target:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( ( isShareableDiskEnabled && ( ( getVm ( ) ) != null ) ) && ( getVm ( ) . isDown ( ) ) ) ) ; }
Source:
private java.lang.String runAndCheck ( java.lang.String original , java.lang.String pattern , java.lang.String value , java.lang.String expected ) { java.lang.String res = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.replace ( original , pattern , value ) ; org.junit.Assert.assertThat ( res , org.hamcrest.core.Is.is ( org.hamcrest.core.IsEqual.equalTo ( expected ) ) ) ; return res ; }

Target:
private java.lang.String runAndCheck ( java.lang.String original , java.lang.String pattern , java.lang.String value , java.lang.String expected ) { java.lang.String res = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.replace ( original , pattern , value ) ; org.hamcrest.MatcherAssert.assertThat ( res , org.hamcrest.core.Is.is ( org.hamcrest.core.IsEqual.equalTo ( expected ) ) ) ; return res ; }
Source:
private static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface resolveActiveNic ( org.ovirt.engine.core.common.businessentities.VDS host , java.lang.String hostIp ) { if ( hostIp == null ) { return null ; } final java.lang.String managementAddress = hostIp ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface activeIface = org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( host.getInterfaces ( ) , new org.ovirt.engine.core.utils.network.predicate.InterfaceByAddressPredicate ( managementAddress ) ) ; return activeIface ; }

Target:
private static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface resolveActiveNic ( org.ovirt.engine.core.common.businessentities.VDS host , java.lang.String hostIp ) { if ( hostIp == null ) { return null ; } final java.lang.String managementAddress = hostIp ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface activeIface = host.getInterfaces ( ) . stream ( ) . filter ( new org.ovirt.engine.core.utils.network.predicate.InterfaceByAddressPredicate ( managementAddress ) ) . findFirst ( ) . orElse ( null ) ; return activeIface ; }
Source:
public void validateDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }

Target:
public void validateDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }
Source:
public void testDeleteOvfGenerations ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > vmsGuids = new java.util.LinkedList < > ( ) ; vmsGuids.add ( FixturesTool.VM_RHEL5_POOL_50 ) ; vmsGuids.add ( FixturesTool.VM_RHEL5_POOL_51 ) ; vmDao.remove ( FixturesTool.VM_RHEL5_POOL_50 ) ; vmDao.remove ( FixturesTool.VM_RHEL5_POOL_51 ) ; dao.deleteOvfGenerations ( vmsGuids ) ; java.lang.Long value = dao.getOvfGeneration ( FixturesTool.VM_RHEL5_POOL_50 ) ; org.junit.Assert.assertNull ( "ovf generation wasn't deleted succesfully" , value ) ; value = dao.getOvfGeneration ( FixturesTool.VM_RHEL5_POOL_51 ) ; org.junit.Assert.assertNull ( "ovf generation wasn't deleted succesfully" , value ) ; }

Target:
public void testDeleteOvfGenerations ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > vmsGuids = new java.util.LinkedList < > ( ) ; vmsGuids.add ( FixturesTool.VM_RHEL5_POOL_50 ) ; vmsGuids.add ( FixturesTool.VM_RHEL5_POOL_51 ) ; vmDao.remove ( FixturesTool.VM_RHEL5_POOL_50 ) ; vmDao.remove ( FixturesTool.VM_RHEL5_POOL_51 ) ; dao.deleteOvfGenerations ( vmsGuids ) ; java.lang.Long value = dao.getOvfGeneration ( FixturesTool.VM_RHEL5_POOL_50 ) ; org.junit.jupiter.api.Assertions.assertNull ( value , "ovf generation wasn't deleted succesfully" ) ; value = dao.getOvfGeneration ( FixturesTool.VM_RHEL5_POOL_51 ) ; org.junit.jupiter.api.Assertions.assertNull ( value , "ovf generation wasn't deleted succesfully" ) ; }
Source:
public void setModel ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel model ) { this . model = model ; setupSelectedProtocol ( model ) ; setupDefaultVmStyles ( ) ; getView ( ) . updateRunButton ( getRunCommand ( ) , model.getIsPool ( ) ) ; getView ( ) . updateShutdownButton ( getShutdownCommand ( ) ) ; getView ( ) . updateSuspendButton ( getSuspendCommand ( ) ) ; getView ( ) . edit ( model ) ; if ( sameEntity ( listModel.getSelectedItem ( ) , model ) ) { setSelectedItem ( ) ; } }

Target:
public void setModel ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel model ) { this . model = model ; setupDefaultVmStyles ( ) ; getView ( ) . updateRunButton ( getRunCommand ( ) , model.isPool ( ) ) ; getView ( ) . updateShutdownButton ( getShutdownCommand ( ) ) ; getView ( ) . updateSuspendButton ( getSuspendCommand ( ) ) ; getView ( ) . edit ( model ) ; if ( sameEntity ( listModel.getSelectedItem ( ) , model ) ) { setSelectedItem ( ) ; } }
Source:
public void removeLun ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun ) { if ( lun.getvolume_group_id ( ) . isEmpty ( ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getLunDao ( ) . remove ( lun.getLUN_id ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : filterConnectionsUsedByOthers ( lun.getLunConnections ( ) , "" , lun.getLUN_id ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.geIid ( ) ) ; } } }

Target:
public void removeLun ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun ) { if ( lun.getVolumeGroupId ( ) . isEmpty ( ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getLunDao ( ) . remove ( lun.getLUNId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : filterConnectionsUsedByOthers ( lun.getLunConnections ( ) , "" , lun.getLUNId ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getId ( ) ) ; } } }
Source:
public void reloadPartial ( org.ovirt.engine.core.common.businessentities.VDS vds ) { vds.setStatisticsData ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStatisticsDao ( ) . get ( vds.getId ( ) ) ) ; vds.setVdsSpmId ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsSpmIdMapDao ( ) . get ( vds.getId ( ) ) . getvds_spm_id ( ) ) ; }

Target:
public void reloadPartial ( org.ovirt.engine.core.common.businessentities.VDS vds ) { vds.setStatisticsData ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStatisticsDao ( ) . get ( vds.getId ( ) ) ) ; vds.setVdsSpmId ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsSpmIdMapDao ( ) . getFromCache ( vds.getId ( ) ) . getvds_spm_id ( ) ) ; }
Source:
public void subscribe ( org.ovirt.engine.core.common.businessentities.event_subscriber subscriber ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "event_up_name" , subscriber.getevent_up_name ( ) ) . addValue ( "method_id" , subscriber.getmethod_id ( ) ) . addValue ( "method_address" , subscriber.getmethod_address ( ) ) . addValue ( "subscriber_id" , subscriber.getsubscriber_id ( ) ) . addValue ( "tag_name" , subscriber.gettag_name ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertevent_subscriber" , parameterSource ) ; }

Target:
public void unsubscribe ( org.ovirt.engine.core.common.businessentities.event_subscriber subscriber ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "event_up_name" , subscriber.getevent_up_name ( ) ) . addValue ( "notification_method" , subscriber.getevent_notification_method ( ) . name ( ) ) . addValue ( "subscriber_id" , subscriber.getsubscriber_id ( ) ) . addValue ( "tag_name" , subscriber.gettag_name ( ) ) ; getCallsHandler ( ) . executeModification ( "Deleteevent_subscriber" , parameterSource ) ; }
Source:
public static boolean osNameExists ( java.lang.Integer osId ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames.keySet ( ) . contains ( osId ) ; }

Target:
public static void isFloppySupported ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.Integer osId , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) : java.lang.Boolean.FALSE ; } } ; org.ovirt.engine.core.common.queries.OsQueryParameters params = new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetFloppySupport , osId , version ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , params , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Disk > getAllForVm ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_guid" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetDisksVmGuid" , org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.DiskRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Disk > getAllForVm ( org.ovirt.engine.core.compat.Guid id , boolean onlyPluggedDisks , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_guid" , id ) . addValue ( "only_plugged" , onlyPluggedDisks ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetDisksVmGuid" , org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.DiskRowMapper.instance , parameterSource ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveMacPool , org.ovirt.engine.core.common.action.RemoveMacPoolByIdParameters.class , new java.lang.String [ ] { "MacPoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendMacPoolResourceTest.MAC_POOL_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( false ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveMacPool , org.ovirt.engine.core.common.action.RemoveMacPoolByIdParameters.class , new java.lang.String [ ] { "MacPoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendMacPoolResourceTest.MAC_POOL_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public java.lang.StringBuilder GetTagIdAndChildrenIds ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "'" ) . append ( gettag_id ( ) ) . append ( "'" ) ; for ( org.ovirt.engine.core.common.businessentities.tags tag : _children ) { builder.append ( "," ) . append ( tag.GetTagIdAndChildrenIds ( ) ) ; } return builder ; }

Target:
public java.lang.StringBuilder getTagIdAndChildrenIds ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "'" ) . append ( gettag_id ( ) ) . append ( "'" ) ; for ( org.ovirt.engine.core.common.businessentities.tags tag : _children ) { builder.append ( "," ) . append ( tag.getTagIdAndChildrenIds ( ) ) ; } return builder ; }
Source:
private void setUpGetCertuficateExpectations ( int times , int index ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsCertificateSubjectByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.CERTIFICATE ) ; } }

Target:
private void setUpGetCertuficateExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsCertificateSubjectByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.CERTIFICATE ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.equals ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getPath ( ) ) ) ) { getPathChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.equals ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getPath ( ) ) ) ) { getPathChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; } else if ( ( ev.equals ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getOverride ( ) ) ) ) { Override_EntityChanged ( args ) ; } }
Source:
public void successfulStatusWithSpecifiedFenceAgent ( ) { mockFenceResult ( agentExecutor1 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.ON ) ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.getFenceAgentStatus ( createFenceAgent ( 1 ) ) ; org.junit.Assert.assertEquals ( Status.SUCCESS , result.getStatus ( ) ) ; org.junit.Assert.assertEquals ( PowerStatus.ON , result.getPowerStatus ( ) ) ; }

Target:
public void successfulStatusWithSpecifiedFenceAgent ( ) { mockFenceResult ( agentExecutor1 , new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.ON ) ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.getFenceAgentStatus ( createFenceAgent ( 1 ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( Status.SUCCESS , result.getStatus ( ) ) ; org.junit.Assert.assertEquals ( PowerStatus.ON , result.getPowerStatus ( ) ) ; }
Source:
public static void GetVmById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( vmId ) , aQuery ) ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > GetLinuxOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.OtherLinux , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; }
Source:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkLabelsByHostNicId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { BackendHostNicLabelsResourceTest.nicId } , java.util.Arrays.asList ( getEntity ( 0 ) ) ) ; } }

Target:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.UnlabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.NIC_ID , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.LABELS [ 0 ] } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDao ( ) . getByName ( org.ovirt.engine.core.bll.AddTagCommand.getParameters ( ) . getTag ( ) . getTagName ( ) ) ; if ( tag != null ) { addValidationMessage ( EngineMessage.TAGS_SPECIFY_TAG_IS_IN_USE ) ; return false ; } return true ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = tagDao.getByName ( org.ovirt.engine.core.bll.AddTagCommand.getParameters ( ) . getTag ( ) . getTagName ( ) ) ; if ( tag != null ) { addValidationMessage ( EngineMessage.TAGS_SPECIFY_TAG_IS_IN_USE ) ; return false ; } return true ; }
Source:
public java.util.List < org.ovirt.engine.core.common.scheduling.PolicyUnit > getBalancePolicyUnits ( ) { java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > list = new java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : getPolicyUnits ( ) ) { if ( ( policyUnit.getPolicyUnitType ( ) ) == ( org.ovirt.engine.core.common.scheduling.PolicyUnitType.LoadBalancing ) ) { list.add ( policyUnit ) ; } } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.common.scheduling.PolicyUnit > getBalancePolicyUnits ( ) { java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > list = new java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : getPolicyUnits ( ) ) { if ( ( policyUnit.getPolicyUnitType ( ) ) == ( org.ovirt.engine.core.common.scheduling.PolicyUnitType.LOAD_BALANCING ) ) { list.add ( policyUnit ) ; } } return list ; }
Source:
protected void setUpGetNoPayloadExpectations ( int index , int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , null ) ; } }

Target:
protected void setUpGetNoPayloadExpectations ( int index , int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , null ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getManagedInterfaceForVds ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vds_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeRead ( "GetVdsManagedInterfaceByVdsId" , org.ovirt.engine.core.dao.network.InterfaceDaoDbFacadeImpl.vdsNetworkInterfaceRowMapper , parameterSource ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getManagedInterfaceForVds ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vds_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeRead ( "GetVdsManagedInterfaceByVdsId" , vdsNetworkInterfaceRowMapper , parameterSource ) ; }
Source:
public void addQuotaPermissionSubject ( java.util.List < org.ovirt.engine.core.common.PermissionSubject > quotaPermissionList ) { if ( ( ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) ) != null ) && ( ( getQuotaId ( ) ) != null ) ) && ( ! ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) . getQuotaEnforcementType ( ) . equals ( QuotaEnforcementTypeEnum.DISABLED ) ) ) ) { quotaPermissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( getQuotaId ( ) , org.ovirt.engine.core.common.VdcObjectType.Quota , org.ovirt.engine.core.common.businessentities.ActionGroup.CONSUME_QUOTA ) ) ; } }

Target:
public void addQuotaPermissionSubject ( java.util.List < org.ovirt.engine.core.common.PermissionSubject > quotaPermissionList ) { if ( ( ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) ) != null ) && ( ( getQuotaId ( ) ) != null ) ) && ( ! ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) . getQuotaEnforcementType ( ) . equals ( QuotaEnforcementTypeEnum.DISABLED ) ) ) ) { if ( canPerformQuotaValidation ( ) ) { quotaPermissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( getQuotaId ( ) , org.ovirt.engine.core.common.VdcObjectType.Quota , org.ovirt.engine.core.common.businessentities.ActionGroup.CONSUME_QUOTA ) ) ; } } }
Source:
public void insufficientDiskSpaceWithSnapshots ( ) { setupDiskSpaceTest ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.ArgumentMatchers.anyMapOf ( org.ovirt.engine.core.compat.Guid.class , org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.mockito.Mockito.when ( cmd.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.ArgumentMatchers.anyCollection ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void insufficientDiskSpaceWithSnapshots ( ) { setupDiskSpaceTest ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.ArgumentMatchers.anyMap ( ) ) ; org.mockito.Mockito.when ( cmd.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.ArgumentMatchers.anyCollection ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
protected void initFrontend ( ) { super . initFrontend ( ) ; org.ovirt.engine.ui.frontend.Frontend.setLoginHandler ( new org.ovirt.engine.ui.frontend.FrontendLoginHandler ( ) { @ java.lang.Override public void onLoginSuccess ( final java.lang.String userName , final java.lang.String password , final java.lang.String domain ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { final java.lang.String domainToken = "@" ; restApiSessionManager.acquireSession ( ( userName.contains ( domainToken ) ? userName : ( userName + domainToken ) + domain ) , password ) ; } } ) ; } @ java.lang.Override public void onLogout ( ) { restApiSessionManager.releaseSession ( ) ; } } ) ; }

Target:
protected void initFrontend ( ) { super . initFrontend ( ) ; frontend.setLoginHandler ( new org.ovirt.engine.ui.frontend.FrontendLoginHandler ( ) { @ java.lang.Override public void onLoginSuccess ( final java.lang.String userName , final java.lang.String password , final java.lang.String domain ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { final java.lang.String domainToken = "@" ; restApiSessionManager.acquireSession ( ( userName.contains ( domainToken ) ? userName : ( userName + domainToken ) + domain ) , password ) ; } } ) ; } @ java.lang.Override public void onLogout ( ) { restApiSessionManager.releaseSession ( ) ; } } ) ; }
Source:
private void initCheckBoxEditors ( ) { importGlusterConfigurationEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; countThreadsAsCoresEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableTrustedServiceEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableBallooning = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableBallooning.getContentWidgetContainer ( ) . setWidth ( "350px" ) ; }

Target:
private void initCheckBoxEditors ( ) { importGlusterConfigurationEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; countThreadsAsCoresEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableTrustedServiceEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableHaReservationEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableBallooning = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableBallooning.getContentWidgetContainer ( ) . setWidth ( "350px" ) ; }
Source:
public void testDetachFailure ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpActionExpectations ( VdcActionType.DetachStorageConnectionFromStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , false , false ) ; try { javax.ws.rs.core.Response response = resource.remove ( ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testDetachFailure ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpActionExpectations ( ActionType.DetachStorageConnectionFromStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , false , false ) ; try { javax.ws.rs.core.Response response = resource.remove ( ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }