auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public final boolean acquireLockAsyncTask ( ) { org.ovirt.engine.core.bll.LockIdNameAttribute annotation = getClass ( ) . getAnnotation ( org.ovirt.engine.core.bll.LockIdNameAttribute.class ) ; boolean returnValue = true ; if ( annotation != null ) { releaseLocksAtEndOfExecute = annotation.isReleaseAtEndOfExecute ( ) ; if ( ! ( releaseLocksAtEndOfExecute ) ) { returnValue = acquireLockInternal ( ) ; } } return returnValue ; }

Target:
protected org.ovirt.engine.core.common.action.LockProperties getLockProperties ( ) { org.ovirt.engine.core.common.action.LockProperties lockProperties = _parameters.getLockProperties ( ) ; if ( lockProperties == null ) { lockProperties = applyLockProperties ( getLockingPropertiesSettings ( ) ) ; _parameters.setLockProperties ( lockProperties ) ; } return lockProperties ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getAddCommand ( ) ) ) { add ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getAddCommand ( ) ) ) { add ( ) ; } else if ( command == ( getEditCommand ( ) ) ) { edit ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } }
Source:
public void testAllLunsHaveDiscardZeroesTheDataSupportFailsOneLunDoesNotSupport ( ) { org.junit.Assert.assertFalse ( discardHelper.allLunsHaveDiscardZeroesTheDataSupport ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , true ) , createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsPreservedNoDiskRequiresPassDiscardFunctionality ( ) { storageDomain.setSupportsDiscard ( true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 0L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
protected void executeVDSCommand ( ) { try { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxyData = org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getCurrentIrsProxyData ( ) ; proxyData.clearPoolTimers ( ) ; proxyData.clearCache ( ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.log.error ( ( "Could not change timers for pool " + ( org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getParameters ( ) . getStoragePoolId ( ) ) ) , e ) ; } org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getVDSReturnValue ( ) . setSucceeded ( true ) ; }

Target:
protected void executeVDSCommand ( ) { try { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxyData = org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getCurrentIrsProxyData ( ) ; proxyData.clearPoolTimers ( ) ; proxyData.clearCache ( ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.log.error ( "Could not change timers for pool '{}': {}" , org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getParameters ( ) . getStoragePoolId ( ) , e.getMessage ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.log.debug ( "Exception" , e ) ; } org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getVDSReturnValue ( ) . setSucceeded ( true ) ; }
Source:
public void canDoActionDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( ) ; initVmForFail ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }

Target:
public void canDoActionDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }
Source:
private boolean verifyDisksIfNeeded ( ) { if ( ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) && ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.isImagesAlreadyOnTarget ( ) ) ) ) { return checkIfDisksExist ( imageList ) ; } return true ; }

Target:
protected boolean validateNoDuplicateDiskImages ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { if ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) { org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( images ) ; return validate ( diskImagesValidator.diskImagesAlreadyExist ( ) ) ; } return true ; }
Source:
public java.lang.Void runInTransaction ( ) { getVdsDynamicDao ( ) . updateNetConfigDirty ( getVds ( ) . getId ( ) , getVds ( ) . getNetConfigDirty ( ) ) ; org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredNetworkData = new org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData ( getParameters ( ) . getNetworkAttachments ( ) , applyUserConfiguredNics ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkTopologyPersisterImpl.getInstance ( ) . persistAndEnforceNetworkCompliance ( updatedHost , false , userConfiguredNetworkData ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getModifiedNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredNetworkData = new org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData ( getParameters ( ) . getNetworkAttachments ( ) , applyUserConfiguredNics ( ) ) ; hostNetworkTopologyPersister.persistAndEnforceNetworkCompliance ( updatedHost , false , userConfiguredNetworkData ) ; getVdsDynamicDao ( ) . updateNetConfigDirty ( getVds ( ) . getId ( ) , getVds ( ) . getNetConfigDirty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getModifiedNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return null ; }
Source:
public void testImagesIllegal ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksListForChecks ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISKS_ILLEGAL ) ) . when ( diskImagesValidator ) . diskImagesNotIllegal ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISKS_ILLEGAL.name ( ) ) ) ; }

Target:
public void testImagesIllegal ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksListForChecks ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISKS_ILLEGAL ) ) . when ( diskImagesValidator ) . diskImagesNotIllegal ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISKS_ILLEGAL ) ; }
Source:
private void setUpMock ( ) { geoRepDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.gluster.GlusterGeoRepDao.class ) ; org.mockito.Mockito.doReturn ( geoRepDao ) . when ( getQuery ( ) ) . getGeoRepDao ( ) ; org.mockito.Mockito.doReturn ( masterVolumeId ) . when ( getQueryParameters ( ) ) . getId ( ) ; org.mockito.Mockito.doReturn ( getMockGeoRepSessions ( ) ) . when ( geoRepDao ) . getGeoRepSessions ( masterVolumeId ) ; }

Target:
private void setUpMock ( ) { geoRepDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.gluster.GlusterGeoRepDao.class ) ; org.mockito.Mockito.doReturn ( geoRepDao ) . when ( getQuery ( ) ) . getGeoRepDao ( ) ; org.mockito.Mockito.doReturn ( masterVolumeId ) . when ( getQueryParameters ( ) ) . getId ( ) ; org.mockito.Mockito.doReturn ( getMockGeoRepSessions ( ) ) . when ( geoRepDao ) . getGeoRepSessions ( masterVolumeId ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails > ( ) ) . when ( geoRepDao ) . getGeoRepSessionDetails ( sessionId ) ; }
Source:
private void unlockImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images = getAllImagesForDisk ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { if ( ( image.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ) { org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getImageDao ( ) . updateStatus ( image.getImageId ( ) , ImageStatus.OK ) ; } } }

Target:
private void unlockImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images = getAllImagesForDisk ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { if ( ( image.getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.LOCKED ) ) { org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getImageDao ( ) . updateStatus ( image.getImageId ( ) , ImageStatus.OK ) ; } } }
Source:
public static void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void isClusterEmpty ( 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.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity getBrick ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brick.setId ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQueryTest.BRICK_ID ) ; brick.setServerId ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQueryTest.SERVER_ID ) ; return brick ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity getBrick ( ) { org.ovirt.engine.core.common.businessentities.gluster.BrickProperties brickProperties = new org.ovirt.engine.core.common.businessentities.gluster.BrickProperties ( ) ; brickProperties.setConfirmedFreeSize ( 1.0 ) ; org.ovirt.engine.core.common.businessentities.gluster.BrickDetails details = new org.ovirt.engine.core.common.businessentities.gluster.BrickDetails ( ) ; details.setBrickProperties ( brickProperties ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brick.setId ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQueryTest.BRICK_ID ) ; brick.setServerId ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeAdvancedDetailsQueryTest.SERVER_ID ) ; brick.setBrickDetails ( details ) ; return brick ; }
Source:
public void getManagementNetworkName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ManagementNetwork , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getSnapshot ( ) ) == null ) { failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_DOES_NOT_EXIST , org.ovirt.engine.core.bll.gluster.GlusterVolumeSnapshotCommandBase.getParameters ( ) . getSnapshotName ( ) ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } if ( ( getSnapshot ( ) ) == null ) { failValidation ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_DOES_NOT_EXIST , org.ovirt.engine.core.bll.gluster.GlusterVolumeSnapshotCommandBase.getParameters ( ) . getSnapshotName ( ) ) ; } return true ; }
Source:
public void diskImagesNotLockedFirstLocked ( ) { disk1.setImageStatus ( ImageStatus.LOCKED ) ; org.junit.Assert.assertThat ( validator.diskImagesNotLocked ( ) , org.junit.matchers.JUnitMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.junit.matchers.JUnitMatchers.hasItem ( org.ovirt.engine.core.bll.validator.DiskImagesValidatorTest.createAliasReplacements ( disk1 ) ) ) ) ) ; }

Target:
public void diskImagesNotLockedFirstLocked ( ) { disk1.setImageStatus ( ImageStatus.LOCKED ) ; org.junit.Assert.assertThat ( validator.diskImagesNotLocked ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.DiskImagesValidatorTest.createAliasReplacements ( disk1 ) ) ) ) ) ; }
Source:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case noVM : org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase outEx = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.createDefaultConcreteException ( "Cancel migration has failed. Please try again in a few moments and track the VM's event log for details" ) ; initializeVdsError ( returnStatus ) ; outEx.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( org.ovirt.engine.core.common.errors.VdcBllErrors.MIGRATION_CANCEL_ERROR_NO_VM , org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getReturnStatus ( ) . mMessage ) ) ; throw outEx ; default : super . proceedProxyReturnValue ( ) ; } }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case noVM : org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase outEx = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.createDefaultConcreteException ( "Cancel migration has failed. Please try again in a few moments and track the VM's event list for details" ) ; initializeVdsError ( returnStatus ) ; outEx.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( org.ovirt.engine.core.common.errors.VdcBllErrors.MIGRATION_CANCEL_ERROR_NO_VM , org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getReturnStatus ( ) . mMessage ) ) ; throw outEx ; default : super . proceedProxyReturnValue ( ) ; } }
Source:
public void moveShareableDisk ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }

Target:
public void validateSourceDomainValid ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; initializeCommand ( disk , VmEntityType.VM ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SOURCE_STORAGE_DOMAIN_DOES_CONTAINS_THE_DISK ) ; }
Source:
public void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getGlusterSnapshotConfig ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.setHandleFailure ( true ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotConfig , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters ( clusterId , volumeId ) , aQuery ) ; }
Source:
public org.ovirt.engine.sdk.entities.Action export ( org.ovirt.engine.sdk.entities.Action action , java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/export" ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . add ( "Correlation-Id" , correlationId ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.entities.Action exportVm ( org.ovirt.engine.sdk.entities.Action action , java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/export" ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . add ( "Correlation-Id" , correlationId ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }
Source:
private void editNetworkThreadCompat ( org.ovirt.engine.core.common.vdscommands.NetworkVdsmVDSCommandParameters parameters ) { try { retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.EditNetwork , parameters ) ; editNetworkDone = true ; } catch ( java.lang.RuntimeException e ) { if ( e instanceof org.ovirt.engine.core.common.errors.VdcBLLException ) { org.ovirt.engine.core.bll.network.host.UpdateNetworkToVdsInterfaceCommand.getReturnValue ( ) . setFault ( new org.ovirt.engine.core.common.errors.VdcFault ( e , ( ( org.ovirt.engine.core.common.errors.VdcBLLException ) ( e ) ) . getVdsError ( ) . getCode ( ) ) ) ; } } catch ( java.lang.Exception e ) { } finally { editNetworkThreadFinish = true ; } }

Target:
private void editNetworkThreadCompat ( org.ovirt.engine.core.common.vdscommands.NetworkVdsmVDSCommandParameters parameters ) { try { retVal = runVdsCommand ( VDSCommandType.EditNetwork , parameters ) ; editNetworkDone = true ; } catch ( java.lang.RuntimeException e ) { if ( e instanceof org.ovirt.engine.core.common.errors.VdcBLLException ) { org.ovirt.engine.core.bll.network.host.UpdateNetworkToVdsInterfaceCommand.getReturnValue ( ) . setFault ( new org.ovirt.engine.core.common.errors.VdcFault ( e , ( ( org.ovirt.engine.core.common.errors.VdcBLLException ) ( e ) ) . getVdsError ( ) . getCode ( ) ) ) ; } } catch ( java.lang.Exception e ) { } finally { editNetworkThreadFinish = true ; } }
Source:
public void init ( ) { super . init ( ) ; org.ovirt.engine.api.restapi.utils.OsTypeMockUtils.mockOsTypes ( ) ; osRepository = control.createMock ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }

Target:
public void init ( ) { super . init ( ) ; org.ovirt.engine.api.restapi.utils.OsTypeMockUtils.mockOsTypes ( ) ; osRepository = control.createMock ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( new org.ovirt.engine.api.restapi.resource.VmMapperMockConfigUtils ( ) ) ; }
Source:
static void printContexts ( org.ovirt.engine.core.bll.exportimport.vnics.MapVnicContext expected , org.ovirt.engine.core.bll.exportimport.vnics.MapVnicContext actual ) { org.ovirt.engine.core.bll.exportimport.vnics.MapVnicFlowTestUtils.printContext ( expected , "expected" ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicFlowTestUtils.printContext ( actual , "actual" ) ; java.lang.System.out.println ( "------------ Actual Trace Start --------------" ) ; java.lang.System.out.println ( actual.getTrace ( ) ) ; java.lang.System.out.println ( "------------ Actual Trace End --------------" ) ; }

Target:
static void printContexts ( org.ovirt.engine.core.bll.exportimport.vnics.MapVnicContext expected , org.ovirt.engine.core.bll.exportimport.vnics.MapVnicContext actual ) { if ( ! ( org.ovirt.engine.core.bll.exportimport.vnics.MapVnicFlowTestUtils.GENERATE_DEBUG_INFO ) ) { return ; } org.ovirt.engine.core.bll.exportimport.vnics.MapVnicFlowTestUtils.printContext ( expected , "expected" ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicFlowTestUtils.printContext ( actual , "actual" ) ; java.lang.System.out.println ( "------------ Actual Trace Start --------------" ) ; java.lang.System.out.println ( actual.getTrace ( ) ) ; java.lang.System.out.println ( "------------ Actual Trace End --------------" ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVdsGroup ( ) ) == null ) && ( ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) . getTemplateType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_CAN_NOT_BE_EMPTY ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVdsGroup ( ) ) == null ) && ( ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) . getTemplateType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_CAN_NOT_BE_EMPTY ) ; return false ; } return true ; }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService mapRow ( java.sql.ResultSet rs , int rownum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService ( ) ; entity.setClusterId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "cluster_id" ) ) ) ; entity.setServiceType ( org.ovirt.engine.core.common.businessentities.gluster.ServiceType.valueOf ( rs.getString ( "service_type" ) ) ) ; entity.setStatus ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServiceStatus.valueOf ( rs.getString ( "status" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService mapRow ( java.sql.ResultSet rs , int rownum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService ( ) ; entity.setClusterId ( getGuidDefaultEmpty ( rs , "cluster_id" ) ) ; entity.setServiceType ( org.ovirt.engine.core.common.businessentities.gluster.ServiceType.valueOf ( rs.getString ( "service_type" ) ) ) ; entity.setStatus ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServiceStatus.valueOf ( rs.getString ( "status" ) ) ) ; return entity ; }
Source:
public void onRemoval ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomainStatic > domainStaticEntries = getDbFacade ( ) . getStorageDomainStaticDao ( ) . getAllByStorage ( provider.getId ( ) . toString ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic domainStaticEntry : domainStaticEntries ) { getDbFacade ( ) . getStorageDomainDynamicDao ( ) . remove ( domainStaticEntry.getId ( ) ) ; getDbFacade ( ) . getStorageDomainStaticDao ( ) . remove ( domainStaticEntry.getId ( ) ) ; } }

Target:
public static org.ovirt.engine.core.bll.provider.OpenstackImageProviderProxy getFromStorageDomainId ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomainStatic = org.ovirt.engine.core.bll.provider.OpenstackImageProviderProxy.getDbFacade ( ) . getStorageDomainStaticDao ( ) . get ( storageDomainId ) ; if ( storageDomainStatic != null ) { org.ovirt.engine.core.common.businessentities.Provider provider = org.ovirt.engine.core.bll.provider.OpenstackImageProviderProxy.getDbFacade ( ) . getProviderDao ( ) . get ( new org.ovirt.engine.core.compat.Guid ( storageDomainStatic.getStorage ( ) ) ) ; return org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( provider ) ; } return null ; }
Source:
private void addLabelToAddedRemovedSets ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel , java.lang.String label , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel.LabelOnNic labelOnNic = new org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel.LabelOnNic ( iface.getId ( ) , iface.getName ( ) , label ) ; if ( dataFromHostSetupNetworksModel.removedLabels.contains ( labelOnNic ) ) { dataFromHostSetupNetworksModel.removedLabels.remove ( labelOnNic ) ; } else { dataFromHostSetupNetworksModel.addedLabels.add ( labelOnNic ) ; } }

Target:
private void addLabelToAddedRemovedSets ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel , java.lang.String label , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { org.ovirt.engine.core.common.businessentities.network.NicLabel labelOnNic = new org.ovirt.engine.core.common.businessentities.network.NicLabel ( iface.getId ( ) , iface.getName ( ) , label ) ; if ( dataFromHostSetupNetworksModel.removedLabels.contains ( labelOnNic ) ) { dataFromHostSetupNetworksModel.removedLabels.remove ( labelOnNic ) ; } else { dataFromHostSetupNetworksModel.addedLabels.add ( labelOnNic ) ; } }
Source:
public void isSupportBridgesReportByVDSM ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportBridgesReportByVDSM ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
private void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; }

Target:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > setupCanAddVmTests ( final int domainSizeGB , final int sizeRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > cmd = createCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; return cmd ; }

Target:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > setupCanAddVmTests ( final int domainSizeGB , final int sizeRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = createCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; org.mockito.Mockito.doReturn ( createStoragePool ( ) ) . when ( cmd ) . getStoragePool ( ) ; return cmd ; }
Source:
public void validateFailedGuestOsIsNotSupported ( ) { mockInterfaceList ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( 15 ) ; createVirtIODisk ( ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getOsName ( 15 ) ) . thenReturn ( "RHEL3x64" ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getDiskHotpluggableInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( ) ) ) . thenReturn ( java.util.Collections.emptySet ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; }

Target:
public void validateFailedGuestOsIsNotSupported ( ) { mockInterfaceList ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( 15 ) ; createVirtIODisk ( ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getOsName ( 15 ) ) . thenReturn ( "RHEL3x64" ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getDiskHotpluggableInterfaces ( org.mockito.ArgumentMatchers.any ( java.lang.Integer.class ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.emptySet ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; }
Source:
public void canDoActionPreallocatedSpaceCheckSucceeds ( ) { final int availableSize = 12 ; final int usedSize = 8 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void canDoActionSpaceValidationSucceeds ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }
Source:
private void stopSpm ( ) { org.ovirt.engine.core.common.businessentities.VdsSpmStatus spmStatus = org.ovirt.engine.core.bll.pm.StopVdsCommand.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) . getId ( ) ) . getSpmStatus ( ) ; if ( spmStatus != ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ) { runVdsCommand ( VDSCommandType.SpmStop , new org.ovirt.engine.core.common.vdscommands.SpmStopVDSCommandParameters ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) . getId ( ) , org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) . getStoragePoolId ( ) ) ) ; } }

Target:
private void stopSpm ( ) { org.ovirt.engine.core.common.businessentities.VdsSpmStatus spmStatus = vdsDao.get ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) . getId ( ) ) . getSpmStatus ( ) ; if ( spmStatus != ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ) { runVdsCommand ( VDSCommandType.SpmStop , new org.ovirt.engine.core.common.vdscommands.SpmStopVDSCommandParameters ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) . getId ( ) , org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) . getStoragePoolId ( ) ) ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ! ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) { return failCanDoAction ( EngineMessage.VM_CANNOT_CANCEL_MIGRATION_WHEN_VM_IS_NOT_MIGRATING ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ! ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) { return failValidation ( EngineMessage.VM_CANNOT_CANCEL_MIGRATION_WHEN_VM_IS_NOT_MIGRATING ) ; } return true ; }
Source:
private void initTemplateDiskImage ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setVmEntityType ( VmEntityType.TEMPLATE ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( diskImage ) ; }

Target:
public void validateFailureOnCopyingCinderDisk ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.CinderDisk ( ) , VmEntityType.VM ) ; command.getParameters ( ) . setOperation ( ImageOperation.Copy ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ) . when ( command ) . getTemplateForImage ( ) ; command.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_DISK_STORAGE_TYPE ) ; }
Source:
public void canDoActionVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }

Target:
public void validateVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }
Source:
public void testUpdateConsoleUserWithOptimisticLockingFailure ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmDynamic vmWithoutConsoleUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4355" ) ) ; vmWithoutConsoleUser.setConsoleUserId ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; boolean result = dao.updateConsoleUserWithOptimisticLocking ( vmWithoutConsoleUser ) ; org.junit.Assert.assertFalse ( result ) ; }

Target:
public void testUpdateConsoleUserWithOptimisticLockingFailure ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmDynamic vmWithoutConsoleUser = dao.get ( FixturesTool.VM_RHEL5_POOL_57 ) ; vmWithoutConsoleUser.setConsoleUserId ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; boolean result = dao.updateConsoleUserWithOptimisticLocking ( vmWithoutConsoleUser ) ; org.junit.Assert.assertFalse ( result ) ; }
Source:
private void UpdateCanSpecify ( ) { org.ovirt.engine.core.common.businessentities.Network network = ( ( org.ovirt.engine.core.common.businessentities.Network ) ( getNetwork ( ) . getSelectedItem ( ) ) ) ; boolean isChangable = getIsStaticAddress ( ) ; getAddress ( ) . setIsChangable ( isChangable ) ; getSubnet ( ) . setIsChangable ( isChangable ) ; }

Target:
private void UpdateCanSpecify ( ) { org.ovirt.engine.core.common.businessentities.Network network = ( ( org.ovirt.engine.core.common.businessentities.Network ) ( getNetwork ( ) . getSelectedItem ( ) ) ) ; boolean isChangable = ( bootProtocolsAvailable ) && ( getIsStaticAddress ( ) ) ; getAddress ( ) . setIsChangable ( isChangable ) ; getSubnet ( ) . setIsChangable ( isChangable ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel tagListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnVal = result.getReturnValue ( ) ; boolean success = ( returnVal != null ) && ( returnVal.getSucceeded ( ) ) ; if ( success ) { tagListModel.getSearchCommand ( ) . Execute ( ) ; } tagListModel.Cancel ( ) ; tagListModel.StopProgress ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel tagListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnVal = result.getReturnValue ( ) ; boolean success = ( returnVal != null ) && ( returnVal.getSucceeded ( ) ) ; if ( success ) { tagListModel.getSearchCommand ( ) . Execute ( ) ; } tagListModel.Cancel ( ) ; tagListModel.StopProgress ( ) ; }
Source:
public static void getMinimalVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VMMinMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void initCommand ( ) { org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( ) ; params.setVdsId ( org.ovirt.engine.core.bll.pm.StartVdsCommandTest.FENCECD_HOST_ID ) ; command = new org.ovirt.engine.core.bll.pm.StartVdsCommand ( params ) ; command.setAuditLogDirector ( auditLogDirector ) ; command = org.mockito.Mockito.spy ( command ) ; org.mockito.Mockito.doReturn ( executor ) . when ( command ) . createHostFenceActionExecutor ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.FencingPolicy.class ) ) ; org.mockito.Mockito.doReturn ( vdsBrokerFrontend ) . when ( command ) . getVdsBroker ( ) ; command.setVdsGroupId ( org.ovirt.engine.core.bll.pm.StartVdsCommandTest.FENCECD_HOST_CLUSTER_ID ) ; }

Target:
private void initCommand ( ) { org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( ) ; params.setVdsId ( org.ovirt.engine.core.bll.pm.StartVdsCommandTest.FENCECD_HOST_ID ) ; command = new org.ovirt.engine.core.bll.pm.StartVdsCommand ( params ) ; command.setAuditLogDirector ( auditLogDirector ) ; command = org.mockito.Mockito.spy ( command ) ; org.mockito.Mockito.doReturn ( executor ) . when ( command ) . createHostFenceActionExecutor ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.FencingPolicy.class ) ) ; org.mockito.Mockito.doReturn ( vdsBrokerFrontend ) . when ( command ) . getVdsBroker ( ) ; command.setClusterId ( org.ovirt.engine.core.bll.pm.StartVdsCommandTest.FENCECD_HOST_CLUSTER_ID ) ; }