auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void executeFenceVdsManuallyAction ( final org.ovirt.engine.core.compat.Guid vdsId , java.lang.String sessionId ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.RestartVdsCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( vdsId ) ; fenceVdsManuallyParams.setSessionId ( sessionId ) ; fenceVdsManuallyParams.setParentCommand ( VdcActionType.RestartVds ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams , getContext ( ) ) ; }

Target:
private void executeFenceVdsManuallyAction ( final org.ovirt.engine.core.compat.Guid vdsId , java.lang.String sessionId ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.RestartVdsCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( vdsId ) ; fenceVdsManuallyParams.setSessionId ( sessionId ) ; fenceVdsManuallyParams.setParentCommand ( VdcActionType.RestartVds ) ; runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams , getContext ( ) ) ; }
Source:
public static void endTaskStep ( org.ovirt.engine.core.compat.NGuid stepId , org.ovirt.engine.core.common.job.JobExecutionStatus exitStatus ) { try { if ( stepId != null ) { org.ovirt.engine.core.common.job.Step step = org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . getStep ( stepId.getValue ( ) ) ; if ( step != null ) { step.markStepEnded ( exitStatus ) ; org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . updateStep ( step ) ; } } } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.job.ExecutionHandler.log.errorFormat ( "Failed to terminate step {0} with status {1}" , stepId , exitStatus , e ) ; } }

Target:
public static void endTaskStep ( org.ovirt.engine.core.compat.Guid stepId , org.ovirt.engine.core.common.job.JobExecutionStatus exitStatus ) { try { if ( stepId != null ) { org.ovirt.engine.core.common.job.Step step = org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . getStep ( stepId ) ; if ( step != null ) { step.markStepEnded ( exitStatus ) ; org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . updateStep ( step ) ; } } } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.job.ExecutionHandler.log.errorFormat ( "Failed to terminate step {0} with status {1}" , stepId , exitStatus , e ) ; } }
Source:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.compat.NGuid getUserId ( ) { if ( ( mUserId.equals ( Guid.Empty ) ) && ( ( getCurrentUser ( ) ) != null ) ) { mUserId = getCurrentUser ( ) . getUserId ( ) ; } return mUserId ; }

Target:
public org.ovirt.engine.core.compat.NGuid getUserId ( ) { if ( ( ( ( mUserId ) != null ) && ( mUserId.equals ( Guid.Empty ) ) ) && ( ( getCurrentUser ( ) ) != null ) ) { mUserId = getCurrentUser ( ) . getUserId ( ) ; } return mUserId ; }
Source:
private boolean ContainsLocalStorage ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model ) { for ( org.ovirt.engine.core.common.businessentities.storage_domains a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage_domains > Cast ( getSelectedItems ( ) ) ) { if ( ( a.getstorage_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { return true ; } } return false ; }

Target:
private boolean ContainsLocalStorage ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > Cast ( getSelectedItems ( ) ) ) { if ( ( a.getstorage_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { return true ; } } return false ; }
Source:
public void failWhenNoAgentsExist ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setPmEnabled ( true ) ; java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; boolean result = validator.isPowerManagementEnabledAndLegal ( vds , null , messages ) ; org.junit.Assert.assertFalse ( result ) ; org.junit.Assert.assertEquals ( messages.size ( ) , 2 ) ; org.junit.Assert.assertTrue ( messages.contains ( "ACTION_TYPE_FAILED_PM_ENABLED_WITHOUT_AGENT" ) ) ; org.junit.Assert.assertTrue ( messages.contains ( "VDS_FENCE_DISABLED" ) ) ; }

Target:
public void failWhenNoAgentsExist ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setPmEnabled ( true ) ; java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; boolean result = validator.isPowerManagementEnabledAndLegal ( vds , null , messages ) ; org.junit.Assert.assertFalse ( result ) ; org.junit.Assert.assertEquals ( 2 , messages.size ( ) ) ; org.junit.Assert.assertTrue ( messages.contains ( "ACTION_TYPE_FAILED_PM_ENABLED_WITHOUT_AGENT" ) ) ; org.junit.Assert.assertTrue ( messages.contains ( "VDS_FENCE_DISABLED" ) ) ; }
Source:
private void initInterface ( org.ovirt.engine.core.common.businessentities.network.VmNic iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVmId ( ) ) ; }

Target:
private void initInterface ( org.ovirt.engine.core.common.businessentities.network.VmNic iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( getVmId ( ) ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( new org.ovirt.engine.api.model.Tag ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Tag" , "add" , "id|name" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.setUpBasicUriExpectations ( ) ) ; try { collection.add ( new org.ovirt.engine.api.model.Tag ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendAssignedTagsResourceTest.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Tag" , "add" , "id|name" ) ; } }
Source:
public void createCommand ( ) { org.ovirt.engine.core.common.action.RunVmParams param = new org.ovirt.engine.core.common.action.RunVmParams ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > ( param ) ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . removeQuotaCommandLeftOver ( ) ; mockVmRunHandler ( ) ; mockSuccessfulSnapshotValidator ( ) ; mockVmPropertiesUtils ( ) ; mockBackend ( ) ; }

Target:
public void createCommand ( ) { org.ovirt.engine.core.common.action.RunVmParams param = new org.ovirt.engine.core.common.action.RunVmParams ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > ( param ) ) ; mockVmRunHandler ( ) ; mockSuccessfulSnapshotValidator ( ) ; mockVmPropertiesUtils ( ) ; mockBackend ( ) ; }
Source:
public boolean IsSupported ( java.lang.String agent , java.lang.String key ) { boolean result = false ; if ( ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( agent ) ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( key ) ) ) && ( fencingOptionMapping.containsKey ( agent ) ) ) { java.util.HashMap < java.lang.String , java.lang.String > agentOptions = fencingOptionMapping.get ( agent ) ; result = ( agentOptions == null ) ? false : agentOptions.containsKey ( key ) ; } else { org.ovirt.engine.core.utils.pm.VdsFenceOptions.log.errorFormat ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.AGENT_ERROR , agent ) ; } return result ; }

Target:
public boolean IsSupported ( java.lang.String agent , java.lang.String key ) { boolean result = false ; if ( ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( agent ) ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( key ) ) ) && ( fencingOptionMapping.containsKey ( agent ) ) ) { java.util.HashMap < java.lang.String , java.lang.String > agentOptions = fencingOptionMapping.get ( agent ) ; result = ( agentOptions == null ) ? false : agentOptions.containsKey ( key ) ; } else { org.ovirt.engine.core.utils.pm.VdsFenceOptions.log.error ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.AGENT_ERROR , agent ) ; } return result ; }
Source:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertFalse ( model.isSetVm ( ) ) ; assertTrue ( model.isSparse ( ) ) ; assertTrue ( ( ! ( model.isBootable ( ) ) ) ) ; assertTrue ( model.isPropagateErrors ( ) ) ; assertEquals ( model.getStorageDomain ( ) . getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.STORAGE_DOMAIN_ID.toString ( ) ) ; }

Target:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertFalse ( model.isSetVm ( ) ) ; assertTrue ( model.isSparse ( ) ) ; assertTrue ( model.isPropagateErrors ( ) ) ; assertEquals ( model.getStorageDomain ( ) . getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.STORAGE_DOMAIN_ID.toString ( ) ) ; }
Source:
public void testOtherFieldsNotValidatedInImportNotNewEntity ( ) { final org.ovirt.engine.core.common.action.ImportVmTemplateParameters parameters = createParameters ( ) ; parameters.setImportAsNewEntity ( false ) ; org.ovirt.engine.core.bll.exportimport.ImportVmTemplateCommand command = createImportVmTemplateCommandSpy ( parameters ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.action.ImportVmTemplateParameters > > validate = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) . validate ( parameters , command.getValidationGroups ( ) . toArray ( new java.lang.Class < ? > [ 0 ] ) ) ; org.junit.Assert.assertTrue ( validate.isEmpty ( ) ) ; }

Target:
public void testOtherFieldsNotValidatedInImportNotNewEntity ( ) { command.getParameters ( ) . setImportAsNewEntity ( false ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.action.ImportVmTemplateParameters > > validate = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) . validate ( command.getParameters ( ) , command.getValidationGroups ( ) . toArray ( new java.lang.Class < ? > [ 0 ] ) ) ; org.junit.Assert.assertTrue ( validate.isEmpty ( ) ) ; }
Source:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue runPublicQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase params ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: runPublicQuery invoked! '{}'" , queryType ) ; debugQuery ( queryType , params ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = getBackend ( ) . runPublicQuery ( queryType , params ) ; returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( org.ovirt.engine.ui.frontend.server.gwt.hibernate.HibernateCleaner.doClean ( returnValue ) ) ) ; return returnValue ; }

Target:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue runPublicQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase params ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: runPublicQuery invoked! '{}'" , queryType ) ; debugQuery ( queryType , params ) ; return getBackend ( ) . runPublicQuery ( queryType , params ) ; }
Source:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { super . executeCommand ( ) ; if ( removeImages ( ) ) { if ( ( org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getParameters ( ) . getSnapshot ( ) . getType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR ) ) { org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImage ( ) . setActive ( true ) ; org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImageDao ( ) . update ( org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImage ( ) . getImage ( ) ) ; } org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { if ( removeImages ( ) ) { if ( ( org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getParameters ( ) . getSnapshot ( ) . getType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR ) ) { org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImage ( ) . setActive ( true ) ; org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImageDao ( ) . update ( org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getImage ( ) . getImage ( ) ) ; } org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.setSucceeded ( true ) ; } }
Source:
public int getAvailableUnitForScsiDisk ( java.util.Map < org.ovirt.engine.core.common.businessentities.VmDevice , java.lang.Integer > vmDeviceUnitMap , boolean reserveFirstTwoLuns ) { int unit = ( reserveFirstTwoLuns ) ? 2 : 0 ; while ( vmDeviceUnitMap.containsValue ( unit ) ) { unit ++ ; } return unit ; }

Target:
public int getAvailableUnitForScsiDisk ( java.util.Map < org.ovirt.engine.core.common.businessentities.VmDevice , java.lang.Integer > vmDeviceUnitMap , boolean reserveFirstTwoLuns ) { int unit = ( reserveFirstTwoLuns ) ? 2 : 0 ; if ( vmDeviceUnitMap == null ) { return unit ; } while ( vmDeviceUnitMap.containsValue ( unit ) ) { unit ++ ; } return unit ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE ) ; }
Source:
private void managePrestartedVmsInPool ( org.ovirt.engine.core.common.businessentities.VmPool vmPool ) { org.ovirt.engine.core.compat.Guid vmPoolId = vmPool.getVmPoolId ( ) ; int prestartedVms = org.ovirt.engine.core.bll.VmPoolCommandBase.getNumOfPrestartedVmsInPool ( vmPoolId ) ; int missingPrestartedVms = ( vmPool.getPrestartedVms ( ) ) - prestartedVms ; if ( missingPrestartedVms > 0 ) { int numOfVmsToPrestart = java.lang.Math.min ( missingPrestartedVms , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VmPoolMonitorBatchSize ) ) ; org.ovirt.engine.core.bll.VmPoolMonitor.log.infoFormat ( "VmPool {0} is missing {1} prestarted Vms, attempting to prestart {2} Vms" , vmPoolId , missingPrestartedVms , numOfVmsToPrestart ) ; prestartVms ( vmPoolId , numOfVmsToPrestart ) ; } }

Target:
private void managePrestartedVmsInPool ( org.ovirt.engine.core.common.businessentities.VmPool vmPool ) { org.ovirt.engine.core.compat.Guid vmPoolId = vmPool.getVmPoolId ( ) ; int prestartedVms = org.ovirt.engine.core.bll.VmPoolCommandBase.getNumOfPrestartedVmsInPool ( vmPoolId ) ; int missingPrestartedVms = ( vmPool.getPrestartedVms ( ) ) - prestartedVms ; if ( missingPrestartedVms > 0 ) { int numOfVmsToPrestart = java.lang.Math.min ( missingPrestartedVms , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VmPoolMonitorBatchSize ) ) ; org.ovirt.engine.core.bll.VmPoolMonitor.log.infoFormat ( "VmPool {0} is missing {1} prestarted Vms, attempting to prestart {2} Vms" , vmPoolId , missingPrestartedVms , numOfVmsToPrestart ) ; prestartVms ( vmPoolId , numOfVmsToPrestart ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( org.ovirt.engine.core.bll.utils.VmUtils.getSnapshotMemorySizeInBytes ( vm ) ) ; image.setVolumeType ( org.ovirt.engine.core.bll.memory.MemoryUtils.storageTypeToMemoryVolumeType ( storageType ) ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; image.setDiskInterface ( DiskInterface.VirtIO ) ; return image ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( org.ovirt.engine.core.bll.utils.VmUtils.getSnapshotMemorySizeInBytes ( vm ) ) ; image.setVolumeType ( org.ovirt.engine.core.bll.memory.MemoryUtils.storageTypeToMemoryVolumeType ( storageType ) ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; return image ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( masterDomain.getStoragePoolIsoMapData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . remove ( masterDomain.getStoragePoolIsoMapData ( ) . getId ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . remove ( masterDomain.getStoragePoolIsoMapData ( ) . getId ( ) ) ; return null ; }
Source:
protected boolean performImagesChecks ( org.ovirt.engine.core.common.businessentities.VM vm ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( vm , org.ovirt.engine.core.bll.AddDiskCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , vm.getstorage_pool_id ( ) , getStorageDomainId ( ) . getValue ( ) , false , false , false , false , true , false , false , true , java.util.Collections.emptyList ( ) ) ; }

Target:
protected boolean performImagesChecks ( org.ovirt.engine.core.common.businessentities.VM vm ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( vm , org.ovirt.engine.core.bll.AddDiskCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , vm.getstorage_pool_id ( ) , getStorageDomainId ( ) . getValue ( ) , false , true , false , false , true , false , false , true , null ) ; }
Source:
private void initMockNetworkAttachmentIpConfigurationValidator ( org.ovirt.engine.core.common.errors.EngineMessage engineMessage , java.util.Collection < java.lang.String > replacements ) { org.ovirt.engine.core.bll.ValidationResult validationResult = ( replacements.isEmpty ( ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , replacements ) ; org.mockito.Mockito.when ( mockNetworkAttachmentIpConfigurationValidator.validateNetworkAttachmentIpConfiguration ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( validationResult ) ; }

Target:
private void initMockNetworkAttachmentIpConfigurationValidator ( org.ovirt.engine.core.common.errors.EngineMessage engineMessage , java.util.Collection < java.lang.String > replacements ) { org.ovirt.engine.core.bll.ValidationResult validationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , replacements ) ; org.mockito.Mockito.when ( mockNetworkAttachmentIpConfigurationValidator.validateNetworkAttachmentIpConfiguration ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( validationResult ) ; }
Source:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; }
Source:
public void deallocate ( org.ovirt.engine.core.common.businessentities.network.VmNic nic ) { try { com.woorea.openstack.quantum.model.Port port = locatePort ( nic ) ; if ( port != null ) { getClient ( ) . ports ( ) . delete ( port.getId ( ) ) . execute ( ) ; } } catch ( java.lang.RuntimeException e ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.PROVIDER_FAILURE , e ) ; } }

Target:
public void deallocate ( org.ovirt.engine.core.common.businessentities.network.VmNic nic ) { com.woorea.openstack.quantum.model.Port port = locatePort ( nic ) ; if ( port != null ) { execute ( getClient ( ) . ports ( ) . delete ( port.getId ( ) ) ) ; } }
Source:
private org.ovirt.engine.api.model.Hooks mapCollection ( java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > > hooksMap ) { org.ovirt.engine.api.model.Hooks hooks = getMapper ( java.util.HashMap.class , org.ovirt.engine.api.model.Hooks.class ) . map ( hooksMap , null ) ; for ( org.ovirt.engine.api.model.Hook hook : hooks.getHooks ( ) ) { addLinks ( hook ) ; } return hooks ; }

Target:
private org.ovirt.engine.api.model.Hooks mapCollection ( java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.String > > > hooksMap ) { org.ovirt.engine.api.model.Hooks hooks = getMapper ( java.util.Map.class , org.ovirt.engine.api.model.Hooks.class ) . map ( hooksMap , null ) ; for ( org.ovirt.engine.api.model.Hook hook : hooks.getHooks ( ) ) { addLinks ( hook ) ; } return hooks ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( key ) == null ? 0 : key.hashCode ( ) ) ; result = ( prime * result ) + ( ( defaultValue ) == null ? 0 : defaultValue.hashCode ( ) ) ; result = ( prime * result ) + ( ( description ) == null ? 0 : description.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( key ) == null ? 0 : key.hashCode ( ) ) ; result = ( prime * result ) + ( ( defaultValue ) == null ? 0 : defaultValue.hashCode ( ) ) ; return result ; }
Source:
private static java.lang.Class < org.ovirt.engine.core.bll.CommandBase < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > > loadClass ( java.lang.String className ) { try { return ( ( java.lang.Class < org.ovirt.engine.core.bll.CommandBase < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > > ) ( java.lang.Class.forName ( className ) ) ) ; } catch ( java.lang.ClassNotFoundException e ) { return null ; } }

Target:
private static java.lang.Class < ? > loadClass ( java.lang.String className ) { try { return java.lang.Class.forName ( className ) ; } catch ( java.lang.ClassNotFoundException e ) { return null ; } }
Source:
public boolean storageDomainRemoved ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomain ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . getAllForVolumeGroup ( storageDomain.getStorage ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : filterConnectionsUsedByOthers ( list , storageDomain.getStorage ( ) , "" ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getid ( ) ) ; } removeStorageDomainLuns ( storageDomain ) ; return true ; }

Target:
public boolean storageDomainRemoved ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomain ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . getAllForVolumeGroup ( storageDomain.getStorage ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : filterConnectionsUsedByOthers ( list , storageDomain.getStorage ( ) , "" ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getId ( ) ) ; } removeStorageDomainLuns ( storageDomain ) ; return true ; }
Source:
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.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( ( ( java.util.Collection ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { setItems ( ( ( java.util.Collection ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }
Source:
public void validateSpaceNotEnough ( ) throws java.lang.Exception { org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; 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 ( storageDomainValidator ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.junit.Assert.assertFalse ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void validateSpaceNotEnough ( ) throws java.lang.Exception { 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 ( storageDomainValidator ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.junit.Assert.assertFalse ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }
Source:
protected void endVmCommand ( ) { if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) ) != null ) { vmStaticDao.incrementDbGeneration ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getId ( ) ) ; } endActionOnDisks ( ) ; unlockVm ( ) ; org.ovirt.engine.core.bll.VmCommand.setSucceeded ( true ) ; }

Target:
protected void endVmCommand ( ) { endActionOnDisks ( ) ; if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) ) != null ) { vmStaticDao.incrementDbGeneration ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getId ( ) ) ; } unlockVm ( ) ; org.ovirt.engine.core.bll.VmCommand.setSucceeded ( true ) ; }
Source:
protected void executeCommand ( ) { if ( shouldSkipCommandExecutionCached ( ) ) { org.ovirt.engine.core.bll.VmCommand.setSucceeded ( true ) ; return ; } executeVmCommand ( ) ; if ( ( ( shouldUpdateHostedEngineOvf ( ) ) && ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . isHostedEngine ( ) ) ) && ( org.ovirt.engine.core.bll.VmCommand.getSucceeded ( ) ) ) { updateHeOvf ( ) ; } }

Target:
protected void executeCommand ( ) { if ( shouldSkipCommandExecutionCached ( ) ) { org.ovirt.engine.core.bll.VmCommand.setSucceeded ( true ) ; return ; } executeVmCommand ( ) ; if ( ( ( ( shouldUpdateHostedEngineOvf ( ) ) && ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) ) != null ) ) && ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . isHostedEngine ( ) ) ) && ( org.ovirt.engine.core.bll.VmCommand.getSucceeded ( ) ) ) { updateHeOvf ( ) ; } }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 , true ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( wae.getResponse ( ) . getStatus ( ) , 404 ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 , true ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
protected void configure ( ) { bind ( org.ovirt.engine.ui.webadmin.plugin.PluginManager.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.PluginEventHandler.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.api.PluginUiFunctions.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( DynamicUrlContentTabPresenter.ViewDef.class ) . to ( org.ovirt.engine.ui.webadmin.section.main.view.DynamicUrlContentTabView.class ) ; bind ( org.ovirt.engine.ui.webadmin.section.main.presenter.DynamicUrlContentTabProxyFactory.class ) . in ( com.google.inject.Singleton.class ) ; bindPresenterWidget ( org.ovirt.engine.ui.webadmin.section.main.presenter.popup.DynamicUrlContentPopupPresenterWidget.class , DynamicUrlContentPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.webadmin.section.main.view.popup.DynamicUrlContentPopupView.class ) ; }

Target:
protected void configure ( ) { bind ( org.ovirt.engine.ui.webadmin.plugin.PluginManager.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.PluginEventHandler.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.api.PluginUiFunctions.class ) . in ( com.google.inject.Singleton.class ) ; bind ( DynamicUrlContentTabPresenter.ViewDef.class ) . to ( org.ovirt.engine.ui.webadmin.section.main.view.DynamicUrlContentTabView.class ) ; bind ( org.ovirt.engine.ui.webadmin.section.main.presenter.DynamicUrlContentTabProxyFactory.class ) . in ( com.google.inject.Singleton.class ) ; bindPresenterWidget ( org.ovirt.engine.ui.webadmin.section.main.presenter.popup.DynamicUrlContentPopupPresenterWidget.class , DynamicUrlContentPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.webadmin.section.main.view.popup.DynamicUrlContentPopupView.class ) ; }
Source:
private static java.util.Map < java.lang.String , java.lang.Object > mapExternalRoleMapping ( org.ovirt.engine.api.model.RegistrationRoleMappings model ) { return model.getRegistrationRoleMappings ( ) . stream ( ) . collect ( java.util.stream.Collectors.toMap ( ( registrationMap ) -> registrationMap.isSetFrom ( ) ? registrationMap.getFrom ( ) . getName ( ) : null , ( registrationMap ) -> registrationMap.isSetTo ( ) ? org.ovirt.engine.api.restapi.types.RoleMapper.map ( registrationMap.getTo ( ) , null ) : null ) ) ; }

Target:
private static java.util.Map < java.lang.String , java.lang.String > mapExternalRoleMapping ( org.ovirt.engine.api.model.RegistrationRoleMappings model ) { return model.getRegistrationRoleMappings ( ) . stream ( ) . collect ( java.util.stream.Collectors.toMap ( ( registrationMap ) -> registrationMap.isSetFrom ( ) ? registrationMap.getFrom ( ) . getName ( ) : null , ( registrationMap ) -> registrationMap.isSetTo ( ) ? org.ovirt.engine.api.restapi.types.RoleMapper.map ( registrationMap.getTo ( ) , null ) . getName ( ) : null ) ) ; }
Source:
private void checkTemplateName ( boolean isImportAsNewEntity , java.lang.String name ) { org.ovirt.engine.core.common.action.ImportVmTemplateParameters parameters = createParameters ( ) ; parameters.getVmTemplate ( ) . setName ( name ) ; parameters.setImportAsNewEntity ( isImportAsNewEntity ) ; org.ovirt.engine.core.bll.exportimport.ImportVmTemplateCommand command = createImportVmTemplateCommandSpy ( parameters ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.action.ImportVmTemplateParameters > > validate = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) . validate ( parameters , command.getValidationGroups ( ) . toArray ( new java.lang.Class < ? > [ 0 ] ) ) ; org.junit.Assert.assertNotEquals ( validate.isEmpty ( ) , isImportAsNewEntity ) ; }

Target:
private void checkTemplateName ( boolean isImportAsNewEntity , java.lang.String name ) { command.getParameters ( ) . getVmTemplate ( ) . setName ( name ) ; command.getParameters ( ) . setImportAsNewEntity ( isImportAsNewEntity ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.action.ImportVmTemplateParameters > > validate = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) . validate ( command.getParameters ( ) , command.getValidationGroups ( ) . toArray ( new java.lang.Class < ? > [ 0 ] ) ) ; org.junit.Assert.assertNotEquals ( validate.isEmpty ( ) , isImportAsNewEntity ) ; }
Source:
public void testSubResourceLocator ( ) throws java.lang.Exception { java.lang.String id = java.util.UUID.nameUUIDFromBytes ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResourceTest.STATISTICS [ 1 ] . getBytes ( ) ) . toString ( ) ; control.replay ( ) ; assertTrue ( ( ( collection.getStatisticResource ( id ) ) instanceof org.ovirt.engine.api.resource.StatisticResource ) ) ; }

Target:
public void testSubResourceLocator ( ) throws java.lang.Exception { java.lang.String id = java.util.UUID.nameUUIDFromBytes ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResourceTest.STATISTICS [ 1 ] . getBytes ( ) ) . toString ( ) ; assertTrue ( ( ( collection.getStatisticResource ( id ) ) instanceof org.ovirt.engine.api.resource.StatisticResource ) ) ; }
Source:
public void testUpdateByClusterIdAndName ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig config = dao.getConfigByClusterIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_3 ) ; org.junit.Assert.assertNotNull ( config ) ; org.junit.Assert.assertEquals ( config.getParamValue ( ) , "value3" ) ; dao.updateConfigByClusterIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_3 , "new_value" ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig modifiedConfig = dao.getConfigByClusterIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_3 ) ; org.junit.Assert.assertNotNull ( modifiedConfig ) ; org.junit.Assert.assertEquals ( modifiedConfig.getParamValue ( ) , "new_value" ) ; }

Target:
public void testUpdateByClusterIdAndName ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig config = dao.getConfigByClusterIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_3 ) ; org.junit.Assert.assertNotNull ( config ) ; org.junit.Assert.assertEquals ( "value3" , config.getParamValue ( ) ) ; dao.updateConfigByClusterIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_3 , "new_value" ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig modifiedConfig = dao.getConfigByClusterIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_3 ) ; org.junit.Assert.assertNotNull ( modifiedConfig ) ; org.junit.Assert.assertEquals ( "new_value" , modifiedConfig.getParamValue ( ) ) ; }
Source:
protected void executeVdsIdCommand ( ) { org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.info ( "AddVds - entered , starting logic to add VDS '{}'" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.info ( "AddVds - VDS '{}' was added, will try to add it to the resource manager" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; resourceManager.addVds ( vds , false ) ; }

Target:
protected void executeVdsIdCommand ( ) { org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.info ( "AddVds - entered , starting logic to add VDS '{}'" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.info ( "AddVds - VDS '{}' was added, will try to add it to the resource manager" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; resourceManager.addVds ( vds , false , true ) ; }
Source:
private void updateItems ( java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots ) { super . setItems ( snapshots ) ; if ( ( getSelectedItem ( ) ) == null ) { setSelectedItem ( ( ( snapshots.size ( ) ) > 1 ? snapshots.get ( 1 ) : snapshots.get ( 0 ) ) ) ; } updateActionAvailability ( ) ; }

Target:
private void updateItems ( java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots ) { super . setItems ( snapshots ) ; if ( ( ( getSelectedItem ( ) ) == null ) && ( ! ( snapshots.isEmpty ( ) ) ) ) { setSelectedItem ( ( ( snapshots.size ( ) ) > 1 ? snapshots.get ( 1 ) : snapshots.get ( 0 ) ) ) ; } updateActionAvailability ( ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getParameters ( ) . getVmId ( ) ; status = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getBroker ( ) . migrateCancel ( vmId.toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.ProceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . RemoveAsyncRunningVm ( vmId ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getParameters ( ) . getVmId ( ) ; status = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getBroker ( ) . migrateCancel ( vmId.toString ( ) ) ; ProceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . RemoveAsyncRunningVm ( vmId ) ; }
Source:
protected boolean ValidConnection ( org.ovirt.engine.core.common.businessentities.StorageType type , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections ) { return ( connections != null ) && ( ( connections.isEmpty ( ) ) || ( org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( type ) . validateStoragePoolConnectionsInHost ( org.ovirt.engine.core.bll.storage.ConnectHostToStoragePoolServersCommand.getVds ( ) , connections , org.ovirt.engine.core.bll.storage.ConnectHostToStoragePoolServersCommand.getStoragePool ( ) . getId ( ) ) ) ) ; }

Target:
protected boolean ValidConnection ( org.ovirt.engine.core.common.businessentities.StorageType type , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections ) { return ( connections != null ) && ( ( connections.isEmpty ( ) ) || ( org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( type ) . validateStoragePoolConnectionsInHost ( getVds ( ) , connections , getStoragePool ( ) . getId ( ) ) ) ) ; }
Source:
public void testGetVmsByInstanceTypeId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getVmsListByInstanceType ( FixturesTool.INSTANCE_TYPE ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( result.iterator ( ) . next ( ) . getId ( ) , FixturesTool.VM_RHEL5_POOL_50 ) ; }

Target:
public void testGetVmsByInstanceTypeId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getVmsListByInstanceType ( FixturesTool.INSTANCE_TYPE ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.VM_RHEL5_POOL_50 , result.iterator ( ) . next ( ) . getId ( ) ) ; }