auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsed ( java.util.List < ? extends org.ovirt.engine.core.common.businessentities.Nameable > entities , org.ovirt.engine.core.common.errors.VdcBllMessages entitiesReplacement ) { if ( entities.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( "ENTITIES_USING_NETWORK" , entities ) ; replacements.add ( entitiesReplacement.name ( ) ) ; return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_IN_USE , replacements ) ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsed ( java.util.List < ? extends org.ovirt.engine.core.common.businessentities.Nameable > entities , org.ovirt.engine.core.common.errors.VdcBllMessages entitiesReplacementPlural , org.ovirt.engine.core.common.errors.VdcBllMessages entitiesReplacementSingular ) { return new org.ovirt.engine.core.common.utils.PluralMessages ( ) . getNetworkInUse ( getEntitiesNames ( entities ) , entitiesReplacementSingular , entitiesReplacementPlural ) ; }
Source:
public void testIsStorageDomainNotInAnyPoolFailure ( ) { org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( storageDomain.getId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ) ) ; org.junit.Assert.assertThat ( validator.isStorageDomainNotInAnyPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ) ; }

Target:
public void testIsStorageDomainNotInAnyPoolFailure ( ) { org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( storageDomain.getId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.isStorageDomainNotInAnyPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) , null ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) , null ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testListGlobalLimit ( ) { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaStorage ( getStorageGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; org.ovirt.engine.api.model.QuotaStorageLimits storageLimits = collection.list ( ) ; assertStorageLimitsFound ( storageLimits , 1 ) ; org.ovirt.engine.api.model.QuotaStorageLimit storageLimit = storageLimits.getQuotaStorageLimits ( ) . get ( 0 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendQuotaStorageLimitsResourceTest.STORAGE_SIZE_GB , storageLimit.getLimit ( ) ) ; }

Target:
public void testListGlobalLimit ( ) { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaStorage ( getStorageGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; org.ovirt.engine.api.model.QuotaStorageLimits storageLimits = collection.list ( ) ; assertStorageLimitsFound ( storageLimits , 1 ) ; org.ovirt.engine.api.model.QuotaStorageLimit storageLimit = storageLimits.getQuotaStorageLimits ( ) . get ( 0 ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendQuotaStorageLimitsResourceTest.STORAGE_SIZE_GB , storageLimit.getLimit ( ) ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase endAction ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task , org.ovirt.engine.core.bll.job.ExecutionContext context ) { org.ovirt.engine.core.common.businessentities.AsyncTasks dbAsyncTask = task.getParameters ( ) . getDbAsyncTask ( ) ; org.ovirt.engine.core.common.action.VdcActionType actionType = getEndActionType ( dbAsyncTask ) ; org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = dbAsyncTask.getActionParameters ( ) ; org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters ) ; command.setContext ( new org.ovirt.engine.core.bll.context.CommandContext ( context ) ) ; return new org.ovirt.engine.core.bll.tasks.DecoratedCommand ( command ) . endAction ( ) ; }

Target:
public void cancelTasks ( final org.ovirt.engine.core.bll.CommandBase command ) { coCoAsyncTaskHelper.cancelTasks ( command , org.ovirt.engine.core.bll.tasks.CommandCoordinatorImpl.log ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; }
Source:
protected boolean canDoAction ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) ; if ( vm == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ! ( org.ovirt.engine.core.bll.RebootVmCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL , org.ovirt.engine.core.bll.validator.LocalizedVmStatus.from ( vm.getStatus ( ) ) ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) ; if ( vm == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ! ( org.ovirt.engine.core.bll.RebootVmCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.RebootVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL , org.ovirt.engine.core.bll.validator.LocalizedVmStatus.from ( vm.getStatus ( ) ) ) ; } return true ; }
Source:
public void calculateNetworkImplementationDetailsNetworkQosOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkQoS qos = createQos ( ) ; qos.setOutboundAverage ( 30 ) ; qos.setOutboundPeak ( 30 ) ; qos.setOutboundBurst ( 30 ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , qos ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkQosOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; qos.setOutAverageLinkshare ( 60 ) ; qos.setOutAverageUpperlimit ( 60 ) ; qos.setOutAverageRealtime ( 60 ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , qos ) ; }
Source:
protected void init ( ) { super . init ( ) ; setVdsId ( org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getParameters ( ) . getProxyHostId ( ) ) ; setStorageDomainId ( org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getParameters ( ) . getDestDomainId ( ) ) ; setStoragePoolId ( ( ( org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getVdsGroup ( ) ) != null ? org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getVdsGroup ( ) . getStoragePoolId ( ) : null ) ) ; }

Target:
protected void init ( ) { super . init ( ) ; setVmName ( org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getParameters ( ) . getExternalName ( ) ) ; setVdsId ( org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getParameters ( ) . getProxyHostId ( ) ) ; setStorageDomainId ( org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getParameters ( ) . getDestDomainId ( ) ) ; setStoragePoolId ( ( ( org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getVdsGroup ( ) ) != null ? org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getVdsGroup ( ) . getStoragePoolId ( ) : null ) ) ; }
Source:
protected boolean formatStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain dom , org.ovirt.engine.core.common.businessentities.VDS vds ) { return getVdsBroker ( ) . RunVdsCommand ( VDSCommandType.FormatStorageDomain , new org.ovirt.engine.core.common.vdscommands.FormatStorageDomainVDSCommandParameters ( vds.getId ( ) , dom.getId ( ) ) ) . getSucceeded ( ) ; }

Target:
protected boolean formatStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain dom , org.ovirt.engine.core.common.businessentities.VDS vds ) { try { return getVdsBroker ( ) . RunVdsCommand ( VDSCommandType.FormatStorageDomain , new org.ovirt.engine.core.common.vdscommands.FormatStorageDomainVDSCommandParameters ( vds.getId ( ) , dom.getId ( ) ) ) . getSucceeded ( ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { if ( ( e.getErrorCode ( ) ) != ( org.ovirt.engine.core.common.errors.VdcBllErrors.StorageDomainDoesNotExist ) ) { throw e ; } log.warnFormat ( "Storage Domain {0} which was about to be formatted does not exist in VDS {1}" , dom.getName ( ) , vds.getName ( ) ) ; return true ; } }
Source:
public void testMapFromRestToBackend ( ) { org.ovirt.engine.api.model.RngDevice model = new org.ovirt.engine.api.model.RngDevice ( ) ; model.setSource ( RngSource.HWRNG ) ; model.setRate ( new org.ovirt.engine.api.model.Rate ( ) ) ; model.getRate ( ) . setBytes ( 10 ) ; model.getRate ( ) . setPeriod ( 11 ) ; org.ovirt.engine.core.common.businessentities.VmRngDevice expected = new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) ; expected.setBytes ( 10 ) ; expected.setPeriod ( 11 ) ; expected.setSource ( VmRngDevice.Source.HWRNG ) ; org.junit.Assert.assertEquals ( expected , org.ovirt.engine.api.restapi.types.RngDeviceMapper.map ( model , null ) ) ; }

Target:
public void testMapFromRestToBackend ( ) { org.ovirt.engine.api.model.RngDevice model = new org.ovirt.engine.api.model.RngDevice ( ) ; model.setSource ( RngSource.HWRNG ) ; model.setRate ( new org.ovirt.engine.api.model.Rate ( ) ) ; model.getRate ( ) . setBytes ( 10 ) ; model.getRate ( ) . setPeriod ( 11 ) ; org.ovirt.engine.core.common.businessentities.VmRngDevice expected = new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) ; expected.setBytes ( 10 ) ; expected.setPeriod ( 11 ) ; expected.setSource ( VmRngDevice.Source.HWRNG ) ; org.junit.jupiter.api.Assertions.assertEquals ( expected , org.ovirt.engine.api.restapi.types.RngDeviceMapper.map ( model , null ) ) ; }
Source:
public synchronized boolean hasTasksForEntityIdAndAction ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.common.action.VdcActionType type ) { if ( ( _tasks ) != null ) { for ( org.ovirt.engine.core.bll.tasks.SPMAsyncTask task : _tasks.values ( ) ) { if ( ( isCurrentTaskLookedFor ( id , task ) ) && ( type.equals ( task.getParameters ( ) . getDbAsyncTask ( ) . getaction_type ( ) ) ) ) { return true ; } } } return false ; }

Target:
public synchronized boolean hasTasksForEntityIdAndAction ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.common.action.VdcActionType type ) { if ( ( _tasks ) != null ) { for ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task : _tasks.values ( ) ) { if ( ( isCurrentTaskLookedFor ( id , task ) ) && ( type.equals ( task.getParameters ( ) . getDbAsyncTask ( ) . getaction_type ( ) ) ) ) { return true ; } } } return false ; }
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 , org.ovirt.engine.core.common.businessentities.StorageType storageType , 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public static void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void testExecuteQueryCommnad ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getClusterId ( ) ) . thenReturn ( parameters.getClusterId ( ) ) ; getQuery ( ) . executeQueryCommand ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > options = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertNotNull ( options ) ; org.junit.Assert.assertEquals ( expected , options ) ; }

Target:
public void testExecuteQueryCommnad ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getClusterId ( ) ) . thenReturn ( parameters.getClusterId ( ) ) ; getQuery ( ) . executeQueryCommand ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > options = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.jupiter.api.Assertions.assertNotNull ( options ) ; org.junit.jupiter.api.Assertions.assertEquals ( expected , options ) ; }
Source:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMClearTaskVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case UnknownTask : log.error ( java.lang.String.format ( "Trying to remove unknown task: %1$s" , org.ovirt.engine.core.vdsbroker.vdsbroker.HSMClearTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ) ; return ; case TaskStateError : initializeVdsError ( returnStatus ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HSMClearTaskVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; return ; } super . ProceedProxyReturnValue ( ) ; }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMClearTaskVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case UnknownTask : log.error ( java.lang.String.format ( "Trying to remove unknown task: %1$s" , org.ovirt.engine.core.vdsbroker.vdsbroker.HSMClearTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ) ; return ; case TaskStateError : initializeVdsError ( returnStatus ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HSMClearTaskVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; return ; } super . proceedProxyReturnValue ( ) ; }
Source:
public static < V > java.util.concurrent.ExecutorCompletionService < V > createCompletionService ( java.lang.Iterable < java.util.concurrent.Callable < V > > tasks ) { java.util.concurrent.ExecutorCompletionService < V > ecs = org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.createCompletionService ( ) ; if ( tasks != null ) { for ( java.util.concurrent.Callable < V > callable : tasks ) { ecs.submit ( callable ) ; } } return ecs ; }

Target:
public static < V > java.util.concurrent.ExecutorCompletionService < V > createCompletionService ( java.lang.Iterable < java.util.concurrent.Callable < V > > tasks ) { java.util.concurrent.ExecutorCompletionService < V > ecs = org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.createCompletionService ( ) ; org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.submitTasks ( ecs , tasks ) ; return ecs ; }
Source:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
protected java.lang.String getFilter ( org.ovirt.engine.core.bll.adbroker.LdapQueryMetadata queryMetadata , java.lang.Object [ ] filterParameters ) { java.lang.String filter = prefix ; for ( java.lang.Object currObject : filterParameters ) { filter += java.lang.String.format ( queryMetadata.getFilter ( ) , currObject ) ; } filter += suffix ; return filter ; }

Target:
protected java.lang.String getFilter ( org.ovirt.engine.core.bll.adbroker.LdapQueryMetadata queryMetadata , java.lang.Object [ ] filterParameters ) { java.lang.StringBuilder filter = new java.lang.StringBuilder ( prefix ) ; for ( java.lang.Object currObject : filterParameters ) { filter.append ( java.lang.String.format ( queryMetadata.getFilter ( ) , currObject ) ) ; } filter.append ( suffix ) ; return filter.toString ( ) ; }
Source:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostGeneralModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostGeneralModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getUpgradeHostCommand ( ) ) ) { return installPopupProvider.get ( ) ; } return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; }
Source:
public void testMissingParameter ( ) throws java.lang.Exception { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; vm.setDescription ( "incomplete" ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "status" ) ; fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "VM" , "status" ) ; } }

Target:
public void testMissingParameter ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "status" ) ; fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "status" ) ; } }
Source:
public static void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public void testGetAllInterfacesForVmFilteredWithPermissions ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > result = dao.getAllForVm ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID , org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.PRIVILEGED_USER_ID , true ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : result ) { assertEquals ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID , iface.getVmId ( ) ) ; } }

Target:
public void testGetAllInterfacesForVmFilteredWithPermissions ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > result = dao.getAllForVm ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID , org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID , iface.getVmId ( ) ) ; } }
Source:
static com.gwtplatform.mvp.client.TabData getTabData ( org.ovirt.engine.ui.common.uicommon.model.MainModelProvider < org.ovirt.engine.core.common.businessentities.StoragePool , org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterListModel > modelProvider , org.ovirt.engine.ui.webadmin.widget.tab.WebadminMenuLayout menuLayout ) { org.ovirt.engine.ui.webadmin.widget.tab.MenuLayoutMenuDetails menuTabDetails = menuLayout.getDetails ( WebAdminApplicationPlaces.dataCenterMainTabPlace ) ; return new org.ovirt.engine.ui.common.widget.tab.ModelBoundTabData ( menuTabDetails.getSecondaryTitle ( ) , menuTabDetails.getSecondaryPriority ( ) , menuTabDetails.getPrimaryTitle ( ) , menuTabDetails.getPrimaryPriority ( ) , modelProvider , menuTabDetails.getIcon ( ) ) ; }

Target:
static com.gwtplatform.mvp.client.TabData getTabData ( org.ovirt.engine.ui.webadmin.widget.tab.WebadminMenuLayout menuLayout ) { org.ovirt.engine.ui.webadmin.widget.tab.MenuLayoutMenuDetails menuTabDetails = menuLayout.getDetails ( WebAdminApplicationPlaces.dataCenterMainTabPlace ) ; return new org.ovirt.engine.ui.common.uicommon.model.GroupedTabData ( menuTabDetails.getSecondaryTitle ( ) , menuTabDetails.getPrimaryTitle ( ) , menuTabDetails.getSecondaryPriority ( ) , menuTabDetails.getPrimaryPriority ( ) , menuTabDetails.getIcon ( ) ) ; }
Source:
public static void GetClusterDesktopMemoryOverCommit ( 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.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void GetCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
protected boolean validateVmNetwork ( ) { boolean retVal = true ; if ( ! ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) ) { org.ovirt.engine.core.compat.Version version = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getStoragePool ( ) . getcompatibility_version ( ) ; retVal = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.NonVmNetworkSupported , version.getValue ( ) ) ; if ( ! retVal ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; } } return retVal ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult vmNetworkSetCorrectly ( ) { return ( getNetwork ( ) . isVmNetwork ( ) ) || ( org.ovirt.engine.core.bll.validator.FeatureSupported.nonVmNetwork ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getStoragePool ( ) . getcompatibility_version ( ) ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; }
Source:
public void getUnusedBricksFromServer ( 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 ) { return source ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }

Target:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }
Source:
public void deleteJobOlderThanDateWithStatus ( ) throws java.text.ParseException { int sizeBeforeDelete = dao.getAll ( ) . size ( ) ; java.text.DateFormat df = new java.text.SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; dao.deleteJobOlderThanDateWithStatus ( df.parse ( "2012-10-02 10:00:00" ) , java.util.Collections.singletonList ( JobExecutionStatus.FAILED ) ) ; int sizeAfterDelete = dao.getAll ( ) . size ( ) ; org.junit.Assert.assertTrue ( "Check an entry was deleted" , ( sizeBeforeDelete > sizeAfterDelete ) ) ; }

Target:
public void deleteJobOlderThanDateWithStatus ( ) throws java.text.ParseException { int sizeBeforeDelete = dao.getAll ( ) . size ( ) ; java.text.DateFormat df = new java.text.SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; dao.deleteJobOlderThanDateWithStatus ( df.parse ( "2012-10-02 10:00:00" ) , java.util.Collections.singletonList ( JobExecutionStatus.FAILED ) ) ; int sizeAfterDelete = dao.getAll ( ) . size ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( sizeBeforeDelete > sizeAfterDelete ) , "Check an entry was deleted" ) ; }
Source:
public void removeLun ( org.ovirt.engine.core.common.businessentities.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.getid ( ) ) ; } } }

Target:
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.getid ( ) ) ; } } }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addNetworkAttachments ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ... networkAttachments ) { if ( emptyParameters ( networkAttachments ) ) { return this ; } if ( ( parameters.getNetworkAttachments ( ) ) == null ) { parameters.setNetworkAttachments ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > ( ) ) ; } parameters.getNetworkAttachments ( ) . addAll ( java.util.Arrays.asList ( networkAttachments ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addNetworkAttachments ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ... networkAttachments ) { if ( nullParameters ( networkAttachments ) ) { return this ; } if ( ( parameters.getNetworkAttachments ( ) ) == null ) { parameters.setNetworkAttachments ( new java.util.ArrayList < > ( ) ) ; } parameters.getNetworkAttachments ( ) . addAll ( java.util.Arrays.asList ( networkAttachments ) ) ; return this ; }
Source:
private void initCommandExecutor ( ) { if ( ! ( cmdExecutorInitialized ) ) { for ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity : coco.getCommandsWithCallBackEnabled ( ) ) { switch ( cmdEntity.getCommandStatus ( ) ) { case ACTIVE_SYNC : case NOT_STARTED : coco.retrieveCommand ( cmdEntity.getId ( ) ) . setCommandStatus ( CommandStatus.FAILED_RESTARTED ) ; break ; default : if ( ! ( cmdEntity.isCallBackNotified ( ) ) ) { addToCallBackMap ( cmdEntity ) ; } break ; } } cmdExecutorInitialized = true ; } }

Target:
private void initCommandExecutor ( ) { if ( ! ( cmdExecutorInitialized ) ) { for ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity : coco.getCommandsWithCallBackEnabled ( ) ) { if ( ! ( cmdEntity.isExecuted ( ) ) ) { coco.retrieveCommand ( cmdEntity.getId ( ) ) . setCommandStatus ( CommandStatus.FAILED_RESTARTED ) ; } else if ( ! ( cmdEntity.isCallBackNotified ( ) ) ) { addToCallBackMap ( cmdEntity ) ; } } cmdExecutorInitialized = true ; } }
Source:
public void init ( ) throws org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult { try { utilityConfiguration = new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsConfiguration ( ( ( java.lang.String ) ( args.get ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ARG_CONFIG_FILE ) ) ) ) ; } catch ( java.lang.Exception e ) { throw new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult ( ManageDomainsResultEnum.FAILED_READING_CONFIGURATION , e.getMessage ( ) ) ; } try { daoImpl = new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsDAOImpl ( ) ; } catch ( java.sql.SQLException e ) { throw new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult ( "Please verify the following:\n1. Your database credentials are valid.\n2. The database machine is accessible.\n3. The database service is running" , ManageDomainsResultEnum.DB_EXCEPTION , e.getMessage ( ) ) ; } }

Target:
public void init ( ) throws org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult { try { utilityConfiguration = new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsConfiguration ( ( ( java.lang.String ) ( args.get ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ARG_CONFIG_FILE ) ) ) ) ; } catch ( java.lang.Exception e ) { throw new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult ( ManageDomainsResultEnum.FAILED_READING_CONFIGURATION , e.getMessage ( ) ) ; } try { daoImpl = new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsDaoImpl ( ) ; } catch ( java.sql.SQLException e ) { throw new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult ( "Please verify the following:\n1. Your database credentials are valid.\n2. The database machine is accessible.\n3. The database service is running" , ManageDomainsResultEnum.DB_EXCEPTION , e.getMessage ( ) ) ; } }
Source:
protected void prepareRoleForCommand ( ) { org.ovirt.engine.core.common.businessentities.roles role = org.ovirt.engine.core.bll.AddRoleWithActionGroupsCommand.getRole ( ) ; role.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; role.setAllowsViewingChildren ( false ) ; for ( org.ovirt.engine.core.common.businessentities.ActionGroup group : org.ovirt.engine.core.bll.AddRoleWithActionGroupsCommand.getParameters ( ) . getActionGroups ( ) ) { if ( group.allowsViewingChildren ( ) ) { role.setAllowsViewingChildren ( true ) ; break ; } } }

Target:
protected void prepareRoleForCommand ( ) { org.ovirt.engine.core.common.businessentities.Role role = org.ovirt.engine.core.bll.AddRoleWithActionGroupsCommand.getRole ( ) ; role.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; role.setAllowsViewingChildren ( false ) ; for ( org.ovirt.engine.core.common.businessentities.ActionGroup group : org.ovirt.engine.core.bll.AddRoleWithActionGroupsCommand.getParameters ( ) . getActionGroups ( ) ) { if ( group.allowsViewingChildren ( ) ) { role.setAllowsViewingChildren ( true ) ; break ; } } }
Source:
public void testBootProtocolSetForDisplayNetworkWhenNetworkIsNonDisplay ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsNone ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( false , true , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }
Source:
public javax.ws.rs.core.Response deactivate ( org.ovirt.engine.api.model.Action action ) { boolean stopGlusterService = org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendHostResource.STOP_GLUSTER_SERVICE , true , false ) ; return doAction ( VdcActionType.MaintenanceNumberOfVdss , new org.ovirt.engine.core.common.action.MaintenanceNumberOfVdssParameters ( asList ( guid ) , false , ( action.isSetReason ( ) ? action.getReason ( ) : null ) , stopGlusterService ) , action ) ; }

Target:
public javax.ws.rs.core.Response deactivate ( org.ovirt.engine.api.model.Action action ) { boolean stopGlusterService = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendHostResource.STOP_GLUSTER_SERVICE , true , false ) ; return doAction ( VdcActionType.MaintenanceNumberOfVdss , new org.ovirt.engine.core.common.action.MaintenanceNumberOfVdssParameters ( asList ( guid ) , false , ( action.isSetReason ( ) ? action.getReason ( ) : null ) , stopGlusterService ) , action ) ; }
Source:
protected void initFrontend ( ) { super . initFrontend ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . 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:
public void checkRemoveNFSConnectionNoDomain ( ) { parameters.setStorageServerConnection ( NFSConnection ) ; org.mockito.Mockito.when ( storageServerConnectionDao.get ( NFSConnection.getId ( ) ) ) . thenReturn ( NFSConnection ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.doReturn ( domains ) . when ( command ) . getStorageDomainsByConnId ( NFSConnection.getId ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void checkRemoveNFSConnectionNoDomain ( ) { parameters.setStorageServerConnection ( org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommandTest.NFSConnection ) ; org.mockito.Mockito.when ( storageServerConnectionDao.get ( org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommandTest.NFSConnection.getId ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommandTest.NFSConnection ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.doReturn ( domains ) . when ( command ) . getStorageDomainsByConnId ( org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommandTest.NFSConnection.getId ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkCluster getNetworkCluster ( ) { if ( ( networkCluster ) == null ) { org.ovirt.engine.core.common.businessentities.network.NetworkClusterId networkClusterId = new org.ovirt.engine.core.common.businessentities.network.NetworkClusterId ( host.getVdsGroupId ( ) , getNetwork ( ) . getId ( ) ) ; networkCluster = networkClusterDao.get ( networkClusterId ) ; } return networkCluster ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkNotAttachedToHost ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_ALREADY_ATTACHED_TO_HOST , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "networkName" , getNetwork ( ) . getName ( ) ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "hostName" , host.getName ( ) ) ) . when ( networkAttachedToHost ( ) ) ; }