auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void parseSecondArgWithKeyValue ( java.lang.String arg , java.lang.String key , java.lang.String value ) { if ( getConfigAction ( ) . equals ( ConfigActionType.ACTION_SET ) ) { engineConfigMap.setKey ( key ) ; engineConfigMap.setValue ( value ) ; } else { org.ovirt.engine.core.config.EngineConfigCLIParser.log.debug ( ( ( "parseArguments error: second argument '" + arg ) + "' has an '=' char but action is not 'set'." ) ) ; throw new java.lang.IllegalArgumentException ( ( ( "Illegal second argument: " + arg ) + "." ) ) ; } }

Target:
private boolean isSetOrMergeAction ( ) { return ( getConfigAction ( ) . equals ( ConfigActionType.ACTION_SET ) ) || ( getConfigAction ( ) . equals ( ConfigActionType.ACTION_MERGE ) ) ; }
Source:
private org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator createHostSetupNetworksValidator ( org.ovirt.engine.core.common.action.HostSetupNetworksParameters params , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > existingIfaces ) { return new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setHost ( host ) . setParams ( params ) . setExistingInterfaces ( existingIfaces ) . build ( ) ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedLabels ( java.lang.String ... removedLabels ) { if ( nullParameters ( removedLabels ) ) { return this ; } if ( ( parameters.getRemovedLabels ( ) ) == null ) { parameters.setRemovedLabels ( new java.util.HashSet < java.lang.String > ( ) ) ; } parameters.getRemovedLabels ( ) . addAll ( java.util.Arrays.asList ( removedLabels ) ) ; return this ; }
Source:
private static int GetNextImage ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( images.get ( i ) . getParentId ( ) . equals ( curr.getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
private static int GetNextImage ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , org.ovirt.engine.core.common.businessentities.storage.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( images.get ( i ) . getParentId ( ) . equals ( curr.getImageId ( ) ) ) { return i ; } } return - 1 ; }
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 ) { loadProviders ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = dataCenters.getSelectedItem ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenter.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , createGetStorageDomainsByStoragePoolIdCallback ( dataCenter ) ) ) ; }

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 ) { clearVms ( ) ; exportDomain.setEntity ( null ) ; loadProviders ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = dataCenters.getSelectedItem ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenter.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , createGetStorageDomainsByStoragePoolIdCallback ( dataCenter ) ) ) ; }
Source:
public void testMissingSubField ( ) { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; vm.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "host.id" ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "host.id" ) ; } }

Target:
public void testMissingSubField ( ) { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; vm.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "host.id" ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "host.id" ) ; } }
Source:
protected org.ovirt.engine.core.compat.Guid getClusterId ( org.ovirt.engine.api.model.Template template ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , VdcQueryType.GetVdsGroupByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( template.getCluster ( ) . getName ( ) ) , ( "Cluster: name=" + ( template.getCluster ( ) . getName ( ) ) ) ) . getId ( ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getClusterId ( org.ovirt.engine.api.model.Template template ) { return getEntity ( org.ovirt.engine.core.common.businessentities.Cluster.class , VdcQueryType.GetClusterByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( template.getCluster ( ) . getName ( ) ) , ( "Cluster: name=" + ( template.getCluster ( ) . getName ( ) ) ) ) . getId ( ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > getDisplayTypes ( int osId , org.ovirt.engine.core.compat.Version version ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.displayTypes.get ( osId ) . get ( version ) ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > getDisplayTypes ( int osId , org.ovirt.engine.core.compat.Version version ) { java.util.Map < org.ovirt.engine.core.compat.Version , java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > > osDisplayTypes = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.displayTypes.get ( osId ) ; return osDisplayTypes == null ? null : osDisplayTypes.get ( version ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel < java.lang.Void > source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) || ( lastExecutedCommand == ( getModel ( ) . getMaintenanceCommand ( ) ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getManualFenceCommand ( ) ) ) { return manualFenceConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel < java.lang.Void > source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) || ( lastExecutedCommand == ( getModel ( ) . getMaintenanceCommand ( ) ) ) ) { return hostMaintenanceConfirmationPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getManualFenceCommand ( ) ) ) { return manualFenceConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > serviceList = null ; if ( ( org.ovirt.engine.core.bll.gluster.GetGlusterServerServicesByClusterIdQuery.getParameters ( ) . getServiceType ( ) ) == null ) { serviceList = org.ovirt.engine.core.bll.gluster.GetGlusterServerServicesByClusterIdQuery.getGlusterServerServiceDao ( ) . getByClusterId ( org.ovirt.engine.core.bll.gluster.GetGlusterServerServicesByClusterIdQuery.getParameters ( ) . getId ( ) ) ; } else { serviceList = org.ovirt.engine.core.bll.gluster.GetGlusterServerServicesByClusterIdQuery.getGlusterServerServiceDao ( ) . getByClusterIdAndServiceType ( org.ovirt.engine.core.bll.gluster.GetGlusterServerServicesByClusterIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.gluster.GetGlusterServerServicesByClusterIdQuery.getParameters ( ) . getServiceType ( ) ) ; } org.ovirt.engine.core.bll.gluster.GetGlusterServerServicesByClusterIdQuery.getQueryReturnValue ( ) . setReturnValue ( serviceList ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > serviceList = null ; if ( ( org.ovirt.engine.core.bll.gluster.GetGlusterServerServicesByClusterIdQuery.getParameters ( ) . getServiceType ( ) ) == null ) { serviceList = glusterServerServiceDao.getByClusterId ( org.ovirt.engine.core.bll.gluster.GetGlusterServerServicesByClusterIdQuery.getParameters ( ) . getId ( ) ) ; } else { serviceList = glusterServerServiceDao.getByClusterIdAndServiceType ( org.ovirt.engine.core.bll.gluster.GetGlusterServerServicesByClusterIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.gluster.GetGlusterServerServicesByClusterIdQuery.getParameters ( ) . getServiceType ( ) ) ; } org.ovirt.engine.core.bll.gluster.GetGlusterServerServicesByClusterIdQuery.getQueryReturnValue ( ) . setReturnValue ( serviceList ) ; }
Source:
public void canDisableVirtioScsiFail ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; org.junit.Assert.assertThat ( validator.canDisableVirtioScsi ( java.util.Collections.singletonList ( disk ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS ) ) ; }

Target:
public void canDisableVirtioScsiFail ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( disk.getId ( ) , vm.getId ( ) ) ; dve.setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; disk.setDiskVmElements ( java.util.Collections.singletonList ( dve ) ) ; org.junit.Assert.assertThat ( validator.canDisableVirtioScsi ( java.util.Collections.singletonList ( disk ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS ) ) ; }
Source:
public java.util.concurrent.Future < org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse > call ( org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest req ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.internal.Call call = new org.ovirt.vdsm.jsonrpc.client.internal.Call ( req ) ; if ( ( this . runningCalls.putIfAbsent ( req.getId ( ) , call ) ) != null ) { throw new org.ovirt.vdsm.jsonrpc.client.RequestAlreadySentException ( ) ; } this . getClient ( ) . sendMessage ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.jsonToByteArray ( req.toJson ( ) , objectMapper ) ) ; retryCall ( req , call ) ; return call ; }

Target:
public java.util.concurrent.Future < org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse > call ( org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest req ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.internal.Call call = new org.ovirt.vdsm.jsonrpc.client.internal.Call ( req ) ; this . tracker.registerCall ( req , call ) ; this . getClient ( ) . sendMessage ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.jsonToByteArray ( req.toJson ( ) , objectMapper ) ) ; retryCall ( req , call ) ; return call ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { if ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getTemplateType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) { return true ; } return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getMasterVm ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : org.ovirt.engine.core.bll.AddVmTemplateCommand.getVm ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( getQuotaIdForDisk ( disk ) , null , QuotaStorageConsumptionParameter.QuotaAction.CONSUME , disk.getStorageIds ( ) . get ( 0 ) , ( ( double ) ( disk.getSizeInGigabytes ( ) ) ) ) ) ; } return list ; }
Source:
public void testMoveNamedParent ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetTagByTagName , org.ovirt.engine.core.common.queries.GetTagByTagNameParameters.class , new java.lang.String [ ] { "TagName" } , new java.lang.Object [ ] { NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] } , getEntity ( org.ovirt.engine.api.restapi.resource.BackendTagResourceTest.NEW_PARENT_IDX ) ) ; org.ovirt.engine.api.model.Tag model = org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 ) ; model.getParent ( ) . getTag ( ) . setId ( null ) ; model.getParent ( ) . getTag ( ) . setName ( NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] ) ; doTestMove ( model , 0 ) ; }

Target:
public void testMoveNamedParent ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetTagByTagName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] } , getEntity ( org.ovirt.engine.api.restapi.resource.BackendTagResourceTest.NEW_PARENT_IDX ) ) ; org.ovirt.engine.api.model.Tag model = org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 ) ; model.getParent ( ) . getTag ( ) . setId ( null ) ; model.getParent ( ) . getTag ( ) . setName ( NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] ) ; doTestMove ( model , 0 ) ; }
Source:
public static void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { 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.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public static void getAllVnicProfiles ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVnicProfiles , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isPosixSupportedInDC ( ) { if ( ( ! ( storagePool.isLocal ( ) ) ) && ( ! ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.PosixStorageEnabled , storagePool.getcompatibility_version ( ) . toString ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.DATA_CENTER_POSIX_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isPosixSupportedInDC ( ) { if ( ( ! ( storagePool.isLocal ( ) ) ) && ( ! ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.PosixStorageEnabled , storagePool.getCompatibilityVersion ( ) . toString ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.DATA_CENTER_POSIX_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected void AsyncSearch ( ) { super . AsyncSearch ( ) ; org.ovirt.engine.core.common.VdcObjectType objType = getObjectType ( ) ; boolean directOnly = ( objType == ( org.ovirt.engine.core.common.VdcObjectType.VM ) ) ? true : false ; org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters tempVar = new org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ( ) ; tempVar.setObjectId ( getEntityGuid ( ) ) ; tempVar.setVdcObjectType ( objType ) ; tempVar.setDirectOnly ( directOnly ) ; setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetPermissionsForObject , tempVar ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }

Target:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; org.ovirt.engine.core.common.VdcObjectType objType = getObjectType ( ) ; boolean directOnly = ( objType == ( org.ovirt.engine.core.common.VdcObjectType.VM ) ) ? true : false ; org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters tempVar = new org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ( ) ; tempVar.setObjectId ( getEntityGuid ( ) ) ; tempVar.setVdcObjectType ( objType ) ; tempVar.setDirectOnly ( directOnly ) ; setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetPermissionsForObject , tempVar ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }
Source:
public void updateJobStepsCompleted ( org.ovirt.engine.core.compat.Guid jobId , org.ovirt.engine.core.common.job.JobExecutionStatus status , java.util.Date endTime ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "job_id" , jobId ) . addValue ( "status" , status.name ( ) ) . addValue ( "end_time" , endTime ) ; getCallsHandler ( ) . executeModification ( "updateJobStepsCompleted" , parameterSource ) ; }

Target:
public void updateJobStepsCompleted ( org.ovirt.engine.core.compat.Guid jobId , org.ovirt.engine.core.common.job.JobExecutionStatus status , java.util.Date endTime ) { if ( status != ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) { updateQuery ( entityManager.createNamedQuery ( "Step.updateJobStepsCompleted" ) . setParameter ( "jobId" , jobId ) . setParameter ( "status" , status ) . setParameter ( "endTime" , endTime ) . setParameter ( "startedStatus" , JobExecutionStatus.STARTED ) ) ; } }
Source:
private void mockBackendQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValueMock = org.mockito.Mockito.when ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue.class ) . getReturnValue ( ) ) . thenReturn ( returnValue ) . getMock ( ) ; org.mockito.Mockito.when ( mockBackend.RunQuery ( org.mockito.Matchers.eq ( queryType ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ) . thenReturn ( queryReturnValueMock ) ; }

Target:
private void mockBackendQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValueMock = org.mockito.Mockito.when ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue.class ) . getReturnValue ( ) ) . thenReturn ( returnValue ) . getMock ( ) ; org.mockito.Mockito.when ( mockBackend.RunPublicQuery ( org.mockito.Matchers.eq ( queryType ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ) . thenReturn ( queryReturnValueMock ) ; }
Source:
public void testAllowedHostedEngineEditing ( ) { org.ovirt.engine.core.bll.UpdateVmCommandTest.mcr.mockConfigValue ( ConfigValues.AllowEditingHostedEngine , true ) ; vmStatic.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; boolean validInput = command.validateInputs ( ) ; org.junit.Assert.assertThat ( validInput , org.hamcrest.core.Is.is ( true ) ) ; }

Target:
public void testBlockingHostedEngineEditing ( ) { org.ovirt.engine.core.bll.UpdateVmCommandTest.mcr.mockConfigValue ( ConfigValues.AllowEditingHostedEngine , false ) ; vmStatic.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; boolean validInput = command.validateInputs ( ) ; org.junit.Assert.assertThat ( validInput , org.hamcrest.core.Is.is ( false ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_EDITING_HOSTED_ENGINE_IS_DISABLED.name ( ) ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.ad_groups setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.ad_groups entity , int index ) { org.easymock.EasyMock.expect ( entity.getid ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getdomain ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.DOMAIN ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getstatus ( ) ) . andReturn ( AdRefStatus.Active ) . anyTimes ( ) ; return entity ; }

Target:
public static org.ovirt.engine.core.common.businessentities.LdapGroup setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.LdapGroup entity , int index ) { org.easymock.EasyMock.expect ( entity.getid ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getdomain ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.DOMAIN ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getstatus ( ) ) . andReturn ( LdapRefStatus.Active ) . anyTimes ( ) ; return entity ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = new java.util.HashMap < > ( ) ; jobProperties.put ( VdcObjectType.VM.name ( ) . toLowerCase ( ) , ( ( org.ovirt.engine.core.bll.storage.export.RemoveVmFromImportExportCommand.getVmName ( ) ) == null ? "" : org.ovirt.engine.core.bll.storage.export.RemoveVmFromImportExportCommand.getVmName ( ) ) ) ; jobProperties.put ( VdcObjectType.Storage.name ( ) . toLowerCase ( ) , org.ovirt.engine.core.bll.storage.export.RemoveVmFromImportExportCommand.getStorageDomainName ( ) ) ; } return jobProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = new java.util.HashMap < > ( ) ; jobProperties.put ( VdcObjectType.VM.name ( ) . toLowerCase ( ) , ( ( org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getVmName ( ) ) == null ? "" : org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getVmName ( ) ) ) ; jobProperties.put ( VdcObjectType.Storage.name ( ) . toLowerCase ( ) , org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getStorageDomainName ( ) ) ; } return jobProperties ; }
Source:
public void onInitialize ( com.google.gwt.event.logical.shared.InitializeEvent event ) { updateActionButton ( button , buttonDefinition ) ; }

Target:
public com.google.gwt.event.dom.client.HasClickHandlers addSuspendButton ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel model , org.ovirt.engine.ui.uicommonweb.UICommand command ) { org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton button = new org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton ( constants.suspendVm ( ) , resources.pauseIcon ( ) , resources.pauseDisabledIcon ( ) , style.suspendButtonAdditionalStyle ( ) ) ; button.setElementId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , "suspendButton" ) ) ; addButtonToPanel ( button ) ; updateButton ( button , command ) ; return button ; }
Source:
public static java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > getImagesLeaf ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > retVal = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( image.getId ( ) , image , retVal ) ; } for ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > list : retVal.values ( ) ) { org.ovirt.engine.core.bll.ImagesHandler.sortImageList ( list ) ; } return retVal ; }

Target:
public static java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > getImagesLeaf ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > retVal = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( image.getId ( ) , image , retVal ) ; } for ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > list : retVal.values ( ) ) { org.ovirt.engine.core.bll.ImagesHandler.sortImageList ( list ) ; } return retVal ; }
Source:
protected boolean validateAttachment ( ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator validator = new org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator ( getNetworkCluster ( ) , getClusterVersion ( ) ) ; return ( ( ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isManagementNetwork ( getNetworkName ( ) ) ) ) || ( validate ( validator.managementNetworkAttachment ( getNetworkName ( ) ) ) ) ) && ( validate ( validator.migrationPropertySupported ( getNetworkName ( ) ) ) ) ) && ( ( ! ( getPersistedNetwork ( ) . isExternal ( ) ) ) || ( validateExternalNetwork ( validator ) ) ) ; }

Target:
protected boolean validateAttachment ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase validator ) { final org.ovirt.engine.core.common.businessentities.network.Network network = getPersistedNetwork ( ) ; return ( ( ( ( validate ( validator.managementNetworkRequired ( network ) ) ) && ( validate ( validator.managementNetworkNotExternal ( network ) ) ) ) && ( validate ( validator.managementNetworkChange ( ) ) ) ) && ( validate ( validator.migrationPropertySupported ( ) ) ) ) && ( ( ! ( network.isExternal ( ) ) ) || ( validateExternalNetwork ( validator ) ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.cancel ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.cancel ( ) ; } }
Source:
public void validateInvalidVmStatus ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Unknown , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP.toString ( ) ) ) ; }

Target:
public void validateInvalidVmStatus ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Unknown , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; command.init ( ) ; command.updateParameters ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP.toString ( ) ) ) ; }
Source:
public void testBlockUseHostCpuWithPPCArch ( ) { prepareVmToPassValidate ( ) ; command.initEffectiveCompatibilityVersion ( ) ; vm.setClusterArch ( ArchitectureType.ppc64le ) ; group.setArchitecture ( ArchitectureType.ppc ) ; org.mockito.Mockito.when ( osRepository.getArchitectureFromOS ( OsType.Windows.ordinal ( ) ) ) . thenReturn ( ArchitectureType.ppc ) ; vmStatic.setUseHostCpuFlags ( true ) ; vmStatic.setMigrationSupport ( MigrationSupport.PINNED_TO_HOST ) ; boolean validInput = command.validate ( ) ; org.junit.Assert.assertFalse ( "validate should fail with can't use host CPU." , validInput ) ; assertValidateMessage ( EngineMessage.USE_HOST_CPU_REQUESTED_ON_UNSUPPORTED_ARCH ) ; }

Target:
public void testBlockUseHostCpuWithPPCArch ( ) { prepareVmToPassValidate ( ) ; command.initEffectiveCompatibilityVersion ( ) ; vm.setClusterArch ( ArchitectureType.ppc64le ) ; group.setArchitecture ( ArchitectureType.ppc ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.UpdateVmCommandTest.osRepository.getArchitectureFromOS ( OsType.Windows.ordinal ( ) ) ) . thenReturn ( ArchitectureType.ppc ) ; vmStatic.setUseHostCpuFlags ( true ) ; vmStatic.setMigrationSupport ( MigrationSupport.PINNED_TO_HOST ) ; boolean validInput = command.validate ( ) ; org.junit.Assert.assertFalse ( "validate should fail with can't use host CPU." , validInput ) ; assertValidateMessage ( EngineMessage.USE_HOST_CPU_REQUESTED_ON_UNSUPPORTED_ARCH ) ; }
Source:
private static void setVmTemplateStatus ( org.ovirt.engine.core.compat.Guid vmTemplateGuid , org.ovirt.engine.core.common.businessentities.VmTemplateStatus status , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . get ( vmTemplateGuid ) ; if ( vmTemplate != null ) { if ( compensationContext != null ) { compensationContext.snapshotEntityStatus ( vmTemplate ) ; } vmTemplate.setStatus ( status ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . update ( vmTemplate ) ; } else { org.ovirt.engine.core.bll.VmTemplateHandler.log.warnFormat ( "setVmTemplateStatus: vmTemplate is null, not setting status '{0}' to vmTemplate" , status ) ; } }

Target:
private static void setVmTemplateStatus ( org.ovirt.engine.core.compat.Guid vmTemplateGuid , org.ovirt.engine.core.common.businessentities.VmTemplateStatus status , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . get ( vmTemplateGuid ) ; if ( vmTemplate != null ) { if ( compensationContext != null ) { compensationContext.snapshotEntityStatus ( vmTemplate ) ; } vmTemplate.setStatus ( status ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . update ( vmTemplate ) ; } else { org.ovirt.engine.core.bll.VmTemplateHandler.log.warn ( "setVmTemplateStatus: vmTemplate is null, not setting status '{}' to vmTemplate" , status ) ; } }
Source:
public void testResolveUnknownVariable ( ) { final java.lang.String message = "This is my ${Variable}" ; final java.lang.String expectedResolved = "This is my <UNKNOWN>" ; java.util.Map < java.lang.String , java.lang.String > values = org.apache.commons.collections.MapUtils.EMPTY_MAP ; java.lang.String resolvedMessage = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resolveMessage ( message , values ) ; junit.framework.Assert.assertEquals ( expectedResolved , resolvedMessage ) ; }

Target:
public void testResolveUnknownVariable ( ) { final java.lang.String message = "This is my ${Variable}" ; final java.lang.String expectedResolved = "This is my <UNKNOWN>" ; java.util.Map < java.lang.String , java.lang.String > values = java.util.Collections.emptyMap ( ) ; java.lang.String resolvedMessage = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resolveMessage ( message , values ) ; junit.framework.Assert.assertEquals ( expectedResolved , resolvedMessage ) ; }
Source:
public void testUpdateHotPlugDisk ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = dao.get ( getExistingEntityId ( ) ) ; boolean newPluggedValue = ! ( vmDevice.getIsPlugged ( ) ) ; org.junit.Assert.assertTrue ( org.apache.commons.lang.StringUtils.isNotBlank ( vmDevice.getAddress ( ) ) ) ; vmDevice.setIsPlugged ( newPluggedValue ) ; dao.updateHotPlugDisk ( vmDevice ) ; dao.get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertEquals ( vmDevice.getIsPlugged ( ) , newPluggedValue ) ; }

Target:
public void testUpdateHotPlugDisk ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = dao.get ( getExistingEntityId ( ) ) ; boolean newPluggedValue = ! ( vmDevice.isPlugged ( ) ) ; org.junit.Assert.assertTrue ( org.apache.commons.lang.StringUtils.isNotBlank ( vmDevice.getAddress ( ) ) ) ; vmDevice.setPlugged ( newPluggedValue ) ; dao.updateHotPlugDisk ( vmDevice ) ; dao.get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertEquals ( vmDevice.isPlugged ( ) , newPluggedValue ) ; }
Source:
public void getExternalProviderDiscoveredHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , params , aQuery ) ; }

Target:
public void getExternalProviderDiscoveredHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , params , aQuery ) ; }
Source:
public void multiQueryValid ( ) { java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryType > queryTypeList = new java.util.ArrayList ( java.util.Arrays.asList ( VdcQueryType.Search , VdcQueryType.Search ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > queryParamsList = new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ) ; underTest.runMultipleQueries ( queryTypeList , queryParamsList ) ; org.mockito.Mockito.verify ( backendLocal , org.mockito.Mockito.times ( 2 ) ) . runQuery ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; }

Target:
public void multiQueryValid ( ) { java.util.ArrayList < org.ovirt.engine.core.common.queries.QueryType > queryTypeList = new java.util.ArrayList ( java.util.Arrays.asList ( QueryType.Search , QueryType.Search ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > queryParamsList = new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ) ; underTest.runMultipleQueries ( queryTypeList , queryParamsList ) ; org.mockito.Mockito.verify ( backendLocal , org.mockito.Mockito.times ( 2 ) ) . runQuery ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.QueryType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; }
Source:
public void setUsePatternFly ( final boolean use ) { super . setUsePatternFly ( use ) ; if ( use ) { getRadioButtonWidgetLabel ( ) . getStyle ( ) . setPaddingLeft ( 10 , Unit.PX ) ; getRadioButtonWidgetLabel ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; getContentWidgetElement ( ) . removeClassName ( Styles.FORM_CONTROL ) ; removeContentWidgetStyleName ( Styles.FORM_CONTROL ) ; } }

Target:
public void setUsePatternFly ( final boolean use ) { super . setUsePatternFly ( use ) ; if ( use ) { getRadioButtonWidgetLabel ( ) . getStyle ( ) . setPaddingLeft ( 10 , Unit.PX ) ; getRadioButtonWidgetLabel ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; getValidatedWidgetStyle ( ) . clearPadding ( ) ; getContentWidgetElement ( ) . removeClassName ( Styles.FORM_CONTROL ) ; removeContentWidgetStyleName ( Styles.FORM_CONTROL ) ; } }
Source:
public void setUp ( ) { org.ovirt.engine.core.common.action.RemoveImageParameters params = new org.ovirt.engine.core.common.action.RemoveImageParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveImageCommand < org.ovirt.engine.core.common.action.RemoveImageParameters > ( params ) { @ java.lang.Override protected void initImage ( ) { } @ java.lang.Override protected void initStoragePoolId ( ) { } @ java.lang.Override protected void initStorageDomainId ( ) { } @ java.lang.Override protected void initContainerDetails ( org.ovirt.engine.core.common.action.ImagesContainterParametersBase parameters ) { } } ) ; org.mockito.Mockito.doReturn ( snapshotDAO ) . when ( cmd ) . getSnapshotDao ( ) ; }

Target:
public void setUp ( ) { org.ovirt.engine.core.common.action.RemoveImageParameters params = new org.ovirt.engine.core.common.action.RemoveImageParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveImageCommand < org.ovirt.engine.core.common.action.RemoveImageParameters > ( params ) { @ java.lang.Override protected void initImage ( ) { } @ java.lang.Override protected void initStoragePoolId ( ) { } @ java.lang.Override protected void initStorageDomainId ( ) { } @ java.lang.Override protected void initContainerDetails ( org.ovirt.engine.core.common.action.ImagesContainterParametersBase parameters ) { } } ) ; org.mockito.Mockito.doReturn ( snapshotDAO ) . when ( cmd ) . getSnapshotDao ( ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }
Source:
public void testBalance ( ) throws org.apache.xmlrpc.XmlRpcException { java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > result = proxy.balance ( org.ovirt.schedulerproxy.SchedulerProxyTest.FILE_NAME , org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ARRAY , "" ) ; org.junit.Assert.assertTrue ( result.containsKey ( org.ovirt.schedulerproxy.SchedulerProxyTest.VM_ID ) ) ; org.junit.Assert.assertTrue ( result.get ( org.ovirt.schedulerproxy.SchedulerProxyTest.VM_ID ) . contains ( org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ID1 ) ) ; }

Target:
public void testBalance ( ) throws org.apache.xmlrpc.XmlRpcException { java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > result = proxy.balance ( org.ovirt.schedulerproxy.SchedulerProxyTest.CLASS_NAME , org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ARRAY , "" ) ; org.junit.Assert.assertTrue ( result.containsKey ( org.ovirt.schedulerproxy.SchedulerProxyTest.VM_ID ) ) ; org.junit.Assert.assertTrue ( result.get ( org.ovirt.schedulerproxy.SchedulerProxyTest.VM_ID ) . contains ( org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ID1 ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disk.setDiskAlias ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; disk.setActive ( true ) ; disk.setImageStatus ( ImageStatus.OK ) ; return disk ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disk.setDiskAlias ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; disk.setActive ( true ) ; disk.setImageStatus ( ImageStatus.OK ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > storageDomainIds = new java.util.ArrayList < > ( ) ; storageDomainIds.add ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disk.setStorageIds ( storageDomainIds ) ; return disk ; }
Source:
public static void addDiskImageWithNoVmDevice ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap ) { try { org.ovirt.engine.core.bll.ImagesHandler.addImage ( image , active , imageStorageDomainMap ) ; org.ovirt.engine.core.bll.ImagesHandler.addDisk ( image ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.DB , ex ) ; } }

Target:
public static void addDiskImageWithNoVmDevice ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap ) { try { org.ovirt.engine.core.bll.ImagesHandler.addImage ( image , active , imageStorageDomainMap ) ; org.ovirt.engine.core.bll.ImagesHandler.addDisk ( image ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.DB , ex ) ; } }
Source:
private void logProxySelection ( java.lang.String proxy , java.lang.String origin , java.lang.String command ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "Proxy" , proxy ) ; logable.addCustomValue ( "Origin" , origin ) ; logable.addCustomValue ( "Command" , command ) ; logable.setVdsId ( _vds.getId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.PROXY_HOST_SELECTION ) ; org.ovirt.engine.core.bll.FenceExecutor.log.infoFormat ( "Using Host {0} from {1} as proxy to execute {2} command on Host {3}" , proxy , origin , command , _vds.getName ( ) ) ; }

Target:
private void logProxySelection ( java.lang.String proxy , java.lang.String origin , java.lang.String command ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "Proxy" , proxy ) ; logable.addCustomValue ( "Origin" , origin ) ; logable.addCustomValue ( "Command" , command ) ; logable.setVdsId ( _vds.getId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.PROXY_HOST_SELECTION ) ; org.ovirt.engine.core.bll.FenceExecutor.log.info ( "Using Host '{}' from '{}' as proxy to execute '{}' command on Host '{}'" , proxy , origin , command , _vds.getName ( ) ) ; }
Source:
public static void getHostById ( 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.RunQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }