auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.common.businessentities.VDS getHost ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.GetNewVdsFenceStatusQuery.getParameters ( ) . getVdsId ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( ( ( org.ovirt.engine.core.compat.Guid ) ( id != null ? id : org.ovirt.engine.core.compat.Guid.Empty ) ) ) ; vds.setStoragePoolId ( org.ovirt.engine.core.bll.GetNewVdsFenceStatusQuery.getParameters ( ) . getStoragePoolId ( ) ) ; vds.getFenceAgents ( ) . add ( org.ovirt.engine.core.bll.GetNewVdsFenceStatusQuery.getParameters ( ) . getAgent ( ) ) ; vds.setPmProxyPreferences ( org.ovirt.engine.core.bll.GetNewVdsFenceStatusQuery.getParameters ( ) . getPmProxyPreferences ( ) ) ; return vds ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS getHost ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.GetFenceAgentStatusQuery.getParameters ( ) . getVdsId ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( ( ( org.ovirt.engine.core.compat.Guid ) ( id != null ? id : org.ovirt.engine.core.compat.Guid.Empty ) ) ) ; vds.setStoragePoolId ( org.ovirt.engine.core.bll.GetFenceAgentStatusQuery.getParameters ( ) . getStoragePoolId ( ) ) ; vds.setPmProxyPreferences ( org.ovirt.engine.core.bll.GetFenceAgentStatusQuery.getParameters ( ) . getPmProxyPreferences ( ) ) ; return vds ; }
Source:
public static void addOrUpdateTaskInDB ( org.ovirt.engine.core.bll.SPMAsyncTask asyncTask ) { try { if ( ( asyncTask.getParameters ( ) . getDbAsyncTask ( ) ) != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . saveOrUpdate ( asyncTask.getParameters ( ) . getDbAsyncTask ( ) , asyncTask.getEntityType ( ) , asyncTask.getAssociatedEntities ( ) ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.log.error ( java.lang.String.format ( "Adding/Updating task %1$s to DataBase threw an exception." , asyncTask.getVdsmTaskId ( ) ) , e ) ; } }

Target:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.addOrUpdateTaskInDB ( asyncTask.getParameters ( ) . getDbAsyncTask ( ) ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entitiesMap = asyncTask.getEntitiesMap ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entry : entitiesMap.entrySet ( ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.getAsyncTaskDao ( ) . insertAsyncTaskEntity ( asyncTask.getParameters ( ) . getDbAsyncTask ( ) . getTaskId ( ) , entry.getKey ( ) , entry.getValue ( ) ) ; } return null ; }
Source:
protected boolean canDoAction ( ) { if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { if ( ! ( validateUnregisteredEntity ( vmFromConfiguration , ovfEntityData ) ) ) { return false ; } setImagesWithStoragePoolId ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getStorageDomain ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getImages ( ) ) ; } return super . canDoAction ( ) ; }

Target:
protected boolean canDoAction ( ) { if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { org.ovirt.engine.core.bll.validator.ImportValidator importValidator = org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getImportValidator ( ) ; if ( ! ( validate ( importValidator.validateUnregisteredEntity ( vmFromConfiguration , ovfEntityData , org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getImages ( ) ) ) ) ) { return false ; } setImagesWithStoragePoolId ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getImages ( ) ) ; } return super . canDoAction ( ) ; }
Source:
protected java.lang.Object runQuery ( org.ovirt.engine.core.common.queries.QueryType queryType , java.lang.String sessionId , javax.naming.InitialContext ctx ) { org.ovirt.engine.core.common.queries.QueryParametersBase queryParams = new org.ovirt.engine.core.common.queries.QueryParametersBase ( ) ; queryParams.setSessionId ( sessionId ) ; queryParams.setFiltered ( org.ovirt.engine.core.aaa.filters.SsoPostLoginFilter.FILTER_QUERIES ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = org.ovirt.engine.core.aaa.filters.FiltersHelper.getBackend ( ctx ) . runQuery ( queryType , queryParams ) ; return ( result != null ) && ( result.getSucceeded ( ) ) ? result.getReturnValue ( ) : null ; }

Target:
protected java.lang.Object runQuery ( org.ovirt.engine.core.common.queries.QueryType queryType , java.lang.String sessionId , javax.naming.InitialContext ctx ) { org.ovirt.engine.core.common.queries.QueryParametersBase queryParams = new org.ovirt.engine.core.common.queries.QueryParametersBase ( ) ; queryParams.setSessionId ( sessionId ) ; queryParams.setFiltered ( org.ovirt.engine.core.aaa.filters.SsoPostLoginFilter.FILTER_QUERIES ) ; org.ovirt.engine.core.common.queries.QueryReturnValue result = org.ovirt.engine.core.aaa.filters.FiltersHelper.getBackend ( ctx ) . runQuery ( queryType , queryParams ) ; return ( result != null ) && ( result.getSucceeded ( ) ) ? result.getReturnValue ( ) : null ; }
Source:
private void UpdateActionAvailability ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( getSelectedItem ( ) ) ) ; getSetAsDisplayCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) == 1 ) ) && ( network != null ) ) && ( ! ( network.getCluster ( ) . getis_display ( ) ) ) ) && ( ( network.getCluster ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.NON_OPERATIONAL ) ) ) ) ; }

Target:
private void UpdateActionAvailability ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( getSelectedItem ( ) ) ) ; getSetAsDisplayCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) == 1 ) ) && ( network != null ) ) && ( ! ( network.getCluster ( ) . isDisplay ( ) ) ) ) && ( ( network.getCluster ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.NON_OPERATIONAL ) ) ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.ValidationError > validateProperties ( org.ovirt.engine.core.compat.Version version , java.lang.String properties ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( properties ) ) { return java.util.Collections.emptyList ( ) ; } if ( syntaxErrorInProperties ( properties ) ) { return invalidSyntaxValidationError ; } java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; java.util.List < org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.ValidationError > result = populateVMProperties ( version , properties , map ) ; return result ; }

Target:
private java.util.List < org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.ValidationError > validateProperties ( org.ovirt.engine.core.compat.Version version , java.lang.String properties ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( properties ) ) { return java.util.Collections.emptyList ( ) ; } if ( syntaxErrorInProperties ( properties ) ) { return invalidSyntaxValidationError ; } java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; java.util.List < org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.ValidationError > result = populateVMProperties ( version , properties , map ) ; return result ; }
Source:
private org.ovirt.engine.core.common.scheduling.AffinityGroup createAffinityGroup ( org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup , java.lang.Boolean isPositive , final org.ovirt.engine.core.common.businessentities.VM ... vmList ) { org.ovirt.engine.core.common.scheduling.AffinityGroup ag = new org.ovirt.engine.core.common.scheduling.AffinityGroup ( ) ; ag.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; ag.setPositive ( isPositive ) ; ag.setClusterId ( vdsGroup.getId ( ) ) ; ag.setEnforcing ( true ) ; ag.setEntityIds ( java.util.Arrays.stream ( vmList ) . map ( VM :: getId ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; return ag ; }

Target:
private org.ovirt.engine.core.common.scheduling.AffinityGroup createAffinityGroup ( org.ovirt.engine.core.common.businessentities.Cluster cluster , java.lang.Boolean isPositive , final org.ovirt.engine.core.common.businessentities.VM ... vmList ) { org.ovirt.engine.core.common.scheduling.AffinityGroup ag = new org.ovirt.engine.core.common.scheduling.AffinityGroup ( ) ; ag.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; ag.setPositive ( isPositive ) ; ag.setClusterId ( cluster.getId ( ) ) ; ag.setEnforcing ( true ) ; ag.setEntityIds ( java.util.Arrays.stream ( vmList ) . map ( VM :: getId ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; return ag ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; }

Target:
public void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public void put ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.compat.Guid rootCommandId , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.core.compat.CommandStatus status , boolean enableCallBack ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = buildCommandEntity ( commandId , rootCommandId , actionType , params , status , enableCallBack ) ; commandMap.put ( commandId , cmdEntity ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; }

Target:
public void updateCommandStatus ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.common.asynctasks.AsyncTaskType taskType , org.ovirt.engine.core.compat.CommandStatus status ) { final org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = get ( commandId ) ; if ( cmdEntity != null ) { cmdEntity.setCommandStatus ( status ) ; if ( ( taskType.equals ( AsyncTaskType.notSupported ) ) || ( cmdEntity.isCallBackEnabled ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; } } }
Source:
public void networkExists ( ) { simulateVdsGroupExists ( ) ; org.mockito.Mockito.when ( mockNetworkDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getNetwork ( ) ) ; org.mockito.Mockito.when ( mockNetworkClusterDao.get ( param.getNetworkCluster ( ) . getId ( ) ) ) . thenReturn ( param.getNetworkCluster ( ) ) ; assertValidateFailure ( EngineMessage.NETWORK_ALREADY_ATTACHED_TO_CLUSTER.toString ( ) ) ; }

Target:
public void networkExists ( ) { simulateClusterExists ( ) ; org.mockito.Mockito.when ( mockNetworkDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getNetwork ( ) ) ; org.mockito.Mockito.when ( mockNetworkClusterDao.get ( param.getNetworkCluster ( ) . getId ( ) ) ) . thenReturn ( param.getNetworkCluster ( ) ) ; assertValidateFailure ( EngineMessage.NETWORK_ALREADY_ATTACHED_TO_CLUSTER.toString ( ) ) ; }
Source:
public static void getRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , 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.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; try { resource.update ( getNic ( false ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; try { resource.update ( getNic ( false ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testBuildVmNumatuneSetting ( ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.Object > numaTune = org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactory.buildVmNumatuneSetting ( org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.numaTuneMode , org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vmNumaNodes , org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vdsNumaNodes ) ; org.junit.Assert.assertEquals ( 2 , numaTune.size ( ) ) ; org.junit.Assert.assertTrue ( numaTune.containsKey ( VdsProperties.NUMA_TUNE_MODE ) ) ; org.junit.Assert.assertEquals ( NumaTuneMode.INTERLEAVE.getValue ( ) , numaTune.get ( VdsProperties.NUMA_TUNE_MODE ) ) ; org.junit.Assert.assertTrue ( numaTune.containsKey ( VdsProperties.NUMA_TUNE_NODESET ) ) ; org.junit.Assert.assertEquals ( "0,1" , numaTune.get ( VdsProperties.NUMA_TUNE_NODESET ) ) ; }

Target:
public void shouldNotCreateCpuPinningForVirtualNumaNodes ( ) { for ( org.ovirt.engine.core.common.businessentities.VmNumaNode numaNode : org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vmNumaNodes ) { numaNode.getVdsNumaNodeList ( ) . clear ( ) ; } java.util.Map < java.lang.String , java.lang.Object > cpuPinning = org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactory.buildCpuPinningWithNumaSetting ( org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vmNumaNodes , org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vdsNumaNodes ) ; org.assertj.core.api.Assertions.assertThat ( cpuPinning ) . isEmpty ( ) ; java.util.Map < java.lang.String , java.lang.Object > mapping = org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactory.buildVmNumatuneSetting ( NumaTuneMode.INTERLEAVE , org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vmNumaNodes ) ; org.assertj.core.api.Assertions.assertThat ( mapping ) . doesNotContainKeys ( VdsProperties.NUMA_TUNE_MODE , VdsProperties.NUMA_TUNE_NODESET ) ; }
Source:
public void canRemoveIncreaseReplica ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedReplicatedVolume ( volumeId1 , 12 , 4 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricksToRemove = new java.util.ArrayList < > ( ) ; bricksToRemove.add ( volumeEntity.getBricks ( ) . get ( 0 ) ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( bricksToRemove , volumeEntity , 5 , false ) ; org.junit.Assert.assertFalse ( validationResult.isValid ( ) ) ; org.junit.Assert.assertEquals ( EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_INCREASE_REPLICA_COUNT , validationResult.getMessage ( ) ) ; }

Target:
public void canRemoveIncreaseReplica ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedReplicatedVolume ( volumeId1 , 12 , 4 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricksToRemove = new java.util.ArrayList < > ( ) ; bricksToRemove.add ( volumeEntity.getBricks ( ) . get ( 0 ) ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( bricksToRemove , volumeEntity , 5 , false ) ; org.junit.Assert.assertThat ( validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_INCREASE_REPLICA_COUNT ) ) ; }
Source:
public void getLunConnectionsForFC ( ) { org.ovirt.engine.core.common.businessentities.LUNs lun = new org.ovirt.engine.core.common.businessentities.LUNs ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( ) ; lun.setLunConnections ( connections ) ; java.util.Map < org.ovirt.engine.core.common.businessentities.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > connectionsByType = org.ovirt.engine.core.bll.storage.StorageHelperBase.filterConnectionsByStorageType ( lun ) ; org.junit.Assert.assertTrue ( "Map of storage connections should be empty." , connectionsByType.isEmpty ( ) ) ; }

Target:
public void getLunConnectionsForFC ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( ) ; lun.setLunConnections ( connections ) ; java.util.Map < org.ovirt.engine.core.common.businessentities.storage.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > connectionsByType = org.ovirt.engine.core.bll.storage.StorageHelperBase.filterConnectionsByStorageType ( lun ) ; org.junit.Assert.assertTrue ( "Map of storage connections should be empty." , connectionsByType.isEmpty ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc setVmTicket ( java.lang.String vmId , java.lang.String otp64 , java.lang.String sec , java.lang.String connectionAction , java.util.Map < java.lang.String , java.lang.String > params ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.setTicket" ) . withParameter ( "vmID" , vmId ) . withParameter ( "password" , otp64 ) . withParameter ( "ttl" , sec ) . withParameter ( "existingConnAction" , connectionAction ) . withParameter ( "params" , params ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc prepareImage ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID , boolean allowIllegal ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Image.prepare" ) . withParameter ( "storagepoolID" , spID ) . withParameter ( "storagedomainID" , sdID ) . withParameter ( "imageID" , imageID ) . withParameter ( "volumeID" , volumeID ) . withParameter ( "allowIllegal" , allowIllegal ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc ( response ) ; }
Source:
public void testNetworkExistWhenOnlyNetworkNameIsSet ( ) { java.lang.String networkName = "network" ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkName ( networkName ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( networkAttachment ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_HAVING_NAME_NOT_EXISTS ; org.junit.Assert.assertThat ( validator.networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , networkName ) ) ) ; }

Target:
public void testNetworkExistWhenOnlyNetworkNameIsSet ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkName ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidatorTest.NETWORK_NAME ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( networkAttachment ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_HAVING_NAME_NOT_EXISTS ; org.junit.Assert.assertThat ( validator.networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , org.ovirt.engine.core.bll.validator.NetworkAttachmentValidatorTest.NETWORK_NAME ) ) ) ; }
Source:
public static void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public static void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( T value ) { setTitle ( value.getComment ( ) ) ; if ( ( ( value.getComment ( ) ) != null ) && ( ! ( value.getComment ( ) . isEmpty ( ) ) ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.CommentColumn.getApplicationResources ( ) . commentImage ( ) ; } return null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( T value ) { if ( ( value == null ) || ( ( value.getComment ( ) ) == null ) ) { return null ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( value.getComment ( ) ) ; }
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 ( "Trying to remove unknown task '{}'" , 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:
protected org.ovirt.engine.core.compat.Guid getPredefinedVdsIdToRunOn ( ) { return ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getDestinationVdsId ( ) ) != null ? org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getDestinationVdsId ( ) : super . getPredefinedVdsIdToRunOn ( ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.compat.Guid > getPredefinedVdsIdListToRunOn ( ) { if ( ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getDestinationVdsId ( ) ) != null ) { java.util.List < org.ovirt.engine.core.compat.Guid > destIdList = new java.util.LinkedList < org.ovirt.engine.core.compat.Guid > ( ) ; destIdList.add ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getDestinationVdsId ( ) ) ; return destIdList ; } return super . getPredefinedVdsIdListToRunOn ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain mockStorageDomain ( org.ovirt.engine.core.compat.Guid storageId , int availableSize , int usedSize ) { return mockStorageDomain ( storageId , availableSize , usedSize , StorageType.UNKNOWN , new org.ovirt.engine.core.compat.Version ( ) ) ; }

Target:
public void testCanDoSuccessOnAddFloatingDiskWithPlugUnset ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createDiskImage ( 1 ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; parameters.setVmId ( Guid.Empty ) ; parameters.setPlugDiskToVm ( false ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public void testExecuteNoTaskHandlers ( ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parameterMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) ; org.mockito.Mockito.when ( parameterMock.getTransactionScopeOption ( ) ) . thenReturn ( TransactionScopeOption.Required ) ; org.ovirt.engine.core.bll.CommandBase < org.ovirt.engine.core.common.action.VdcActionParametersBase > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.CommandBaseTest.CommandBaseDummy ( parameterMock ) ) ; command.insertAsyncTaskPlaceHolders ( ) ; command.executeAction ( ) ; org.mockito.Mockito.verify ( command ) . executeCommand ( ) ; }

Target:
public void testExecuteNoTaskHandlers ( ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parameterMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) ; org.mockito.Mockito.when ( parameterMock.getTransactionScopeOption ( ) ) . thenReturn ( TransactionScopeOption.Required ) ; org.mockito.Mockito.when ( parameterMock.getLockProperties ( ) ) . thenReturn ( org.ovirt.engine.core.common.action.LockProperties.create ( LockProperties.Scope.None ) ) ; org.ovirt.engine.core.bll.CommandBase < org.ovirt.engine.core.common.action.VdcActionParametersBase > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.CommandBaseTest.CommandBaseDummy ( parameterMock ) ) ; command.insertAsyncTaskPlaceHolders ( ) ; command.executeAction ( ) ; org.mockito.Mockito.verify ( command ) . executeCommand ( ) ; }
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 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 ) ; }
Source:
public boolean isVisible ( ) { return getDetailModel ( ) . getIsLocalS ( ) ; }

Target:
public boolean isVisible ( ) { return ( ( getDetailModel ( ) . getIsPosix ( ) ) && ( ( getDetailModel ( ) . getVfsType ( ) ) != null ) ) && ( ! ( getDetailModel ( ) . getVfsType ( ) . isEmpty ( ) ) ) ; }
Source:
public static void getAllVnicProfiles ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVnicProfiles , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getExternalNetworkMap ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { 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.HashMap < org.ovirt.engine.core.common.businessentities.network.Network , java.util.Set < org.ovirt.engine.core.compat.Guid > > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , new org.ovirt.engine.core.common.queries.IdQueryParameters ( providerId ) , aQuery ) ; }
Source:
public void runMultipleAction ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , final org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback callback , final boolean showErrorDialog , final boolean waitForResult ) { runMultipleAction ( actionType , parameters , callback , null , showErrorDialog , waitForResult ) ; }

Target:
public void runMultipleActionsFailed ( java.util.Map < org.ovirt.engine.core.common.action.VdcActionType , java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > > failedActionsMap , org.ovirt.engine.ui.frontend.IFrontendEventsHandler.MessageFormatter messageFormatter ) { java.util.Collection < org.ovirt.engine.core.common.action.VdcReturnValueBase > failedResults = new java.util.ArrayList < > ( ) ; for ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > vdcActionTypeResults : failedActionsMap.values ( ) ) { failedResults.addAll ( vdcActionTypeResults ) ; } translateErrors ( failedResults ) ; getEventsHandler ( ) . runMultipleActionsFailed ( failedActionsMap , messageFormatter ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( MultiLevelAdministrationHandler.SYSTEM_OBJECT_ID , org.ovirt.engine.core.common.VdcObjectType.System , org.ovirt.engine.core.common.businessentities.ActionGroup.CONFIGURE_ENGINE ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { org.ovirt.engine.core.compat.Guid macPoolIdToUse = ( ( getParameters ( ) . getMacPool ( ) ) == null ) ? null : getParameters ( ) . getMacPool ( ) . getId ( ) ; return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( macPoolIdToUse , org.ovirt.engine.core.common.VdcObjectType.MacPool , org.ovirt.engine.core.common.businessentities.ActionGroup.EDIT_MAC_POOL ) ) ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) { return true ; } if ( ( o == null ) || ( ( getClass ( ) ) != ( o.getClass ( ) ) ) ) { return false ; } org.ovirt.engine.core.bll.scheduling.pending.PendingVM that = ( ( org.ovirt.engine.core.bll.scheduling.pending.PendingVM ) ( o ) ) ; return getVm ( ) . equals ( that.getVm ( ) ) ; }

Target:
public boolean equals ( java.lang.Object other ) { return org.ovirt.engine.core.bll.scheduling.utils.VmSpecificPendingResourceEqualizer.isEqual ( this , other ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void getVmNextRunConfiguration ( 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.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
java.lang.String resolveMessage ( java.lang.String message , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ) { java.lang.String returnValue = message ; if ( logable != null ) { java.util.Map < java.lang.String , java.lang.String > map = getAvailableValues ( message , logable ) ; returnValue = resolveMessage ( message , map ) ; } return returnValue ; }

Target:
java.lang.String resolveMessage ( java.lang.String message , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable logable ) { java.lang.String returnValue = message ; if ( logable != null ) { java.util.Map < java.lang.String , java.lang.String > map = getAvailableValues ( message , logable ) ; returnValue = resolveMessage ( message , map ) ; } return returnValue ; }
Source:
private void RestoreVmFromBaseSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vm.getId ( ) , SnapshotType.STATELESS ) ) { log.infoFormat ( "Deleting snapshots for stateless vm {0}" , vm.getId ( ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vm.getId ( ) ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.DetachUserFromVmFromPoolCommand.getCompensationContext ( ) ) ) ; } }

Target:
private void RestoreVmFromBaseSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vm.getId ( ) , SnapshotType.STATELESS ) ) { log.infoFormat ( "Deleting snapshots for stateless vm {0}" , vm.getId ( ) ) ; org.ovirt.engine.core.common.action.VmOperationParameterBase restoreParams = new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vm.getId ( ) ) ; restoreParams.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RestoreStatelessVm , restoreParams , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.DetachUserFromVmFromPoolCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.DetachUserFromVmFromPoolCommand.getLock ( ) ) ) ; } }
Source:
public void testAllDomainsHaveSpaceForNewDisksFailure ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksListForChecks ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }

Target:
public void testAllDomainsHaveSpaceForNewDisksFailure ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksListForChecks ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.Boolean entity = getOptimizeForSpeed ( ) . getEntity ( ) ; if ( entity ) { getGuarantyResources ( ) . setEntity ( true ) ; } getAllowOverbooking ( ) . setIsChangeable ( ( ! entity ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getEnableKsm ( ) . getEntity ( ) ) == null ) { return ; } if ( ( getEnableKsm ( ) . getEntity ( ) ) == true ) { getKsmPolicyForNumaSelection ( ) . setIsChangeable ( true ) ; } if ( ( getEnableKsm ( ) . getEntity ( ) ) == false ) { getKsmPolicyForNumaSelection ( ) . setIsChangeable ( false ) ; } }
Source:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
public void provisioningValidated ( ) throws java.lang.Exception { setupVirtMock ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningComputeResourceValid ( org.mockito.ArgumentMatchers.any ( java.lang.Boolean.class ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningHostGroupValid ( org.mockito.ArgumentMatchers.any ( java.lang.Boolean.class ) , org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
public void provisioningValidated ( ) throws java.lang.Exception { setupVirtMock ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningComputeResourceValid ( org.mockito.ArgumentMatchers.anyBoolean ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningHostGroupValid ( org.mockito.ArgumentMatchers.anyBoolean ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }