auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassValidate ( ) ; group.setCompatibilityVersion ( Version.v3_3 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Arrays.asList ( "VirtIO" ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }

Target:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassValidate ( ) ; group.setCompatibilityVersion ( Version.v4_0 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Arrays.asList ( "VirtIO" ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }
Source:
public void canDoActionSucceedsOnDiskDomainCheckWhenStorageGuidInParamsMismatches ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( storageId ) ; mockVmWithDisk ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void canDoActionSucceedsOnDiskDomainCheckWhenStorageGuidInParamsMismatches ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId ) ; mockVmWithDisk ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeBrickAdd ( java.lang.String volumeName , java.lang.String [ ] bricks , int replicaCount , int stripeCount ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeBrickAdd ( volumeName , bricks , replicaCount , stripeCount ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesListReturnForXmlRpc glusterVolumeInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumesList ( volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesListReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static java.lang.String toJson ( final java.util.List < org.ovirt.engine.core.bll.validator.InClusterUpgradeValidator.UPGRADE_ERROR > vm ) { final org.codehaus.jackson.map.ObjectMapper mapper = new org.codehaus.jackson.map.ObjectMapper ( ) ; mapper.setSerializationInclusion ( JsonSerialize.Inclusion.NON_NULL ) ; try { return mapper.writerWithDefaultPrettyPrinter ( ) . writeValueAsString ( new org.ovirt.engine.core.bll.validator.InClusterUpgradeValidator.VmValidation ( vm ) ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public org.ovirt.engine.core.bll.ValidationResult checkClusterUpgradeIsEnabled ( final org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.MIXED_HOST_VERSIONS_NOT_ALLOWED ) . when ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.CheckMixedRhelVersions , cluster.getCompatibilityVersion ( ) . getValue ( ) ) ) ; }
Source:
private void refresh ( ) { topSelectionModel.clear ( ) ; bottomSelectionModel.clear ( ) ; topTable.edit ( topTable.flush ( ) ) ; bottomTable.edit ( bottomTable.flush ( ) ) ; }

Target:
private void refresh ( ) { topSelectionModel.clear ( ) ; bottomSelectionModel.clear ( ) ; topTable.asEditor ( ) . edit ( topTable.asEditor ( ) . flush ( ) ) ; bottomTable.asEditor ( ) . edit ( bottomTable.asEditor ( ) . flush ( ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster cloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster instance ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster obj = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; obj.setId ( instance.getId ( ) ) ; obj.setStatus ( instance.getStatus ( ) ) ; obj.setDisplay ( instance.isDisplay ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; obj.setMigration ( instance.isMigration ( ) ) ; obj.setManagement ( instance.isManagement ( ) ) ; return obj ; }

Target:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster cloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster instance ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster obj = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; obj.setId ( instance.getId ( ) ) ; obj.setStatus ( instance.getStatus ( ) ) ; obj.setDisplay ( instance.isDisplay ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; obj.setMigration ( instance.isMigration ( ) ) ; obj.setManagement ( instance.isManagement ( ) ) ; obj.setGluster ( instance.isGluster ( ) ) ; return obj ; }
Source:
public void onPowerringUp ( ) { decreasePendingVm ( org.ovirt.engine.core.bll.RunVmCommand.getVmStaticDAO ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ) ; }

Target:
private void removeMemoryFromActiveSnapshot ( ) { java.lang.String memory = org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( memory ) ) { return ; } org.ovirt.engine.core.bll.RunVmCommand.getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; if ( ( org.ovirt.engine.core.bll.RunVmCommand.getSnapshotDao ( ) . getNumOfSnapshotsByMemory ( memory ) ) == 0 ) { removeMemoryVolumes ( memory , org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) , true ) ; } }
Source:
private void internalEndSuccessfully ( ) { log.infoFormat ( "Ending command successfully: {0}" , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { getCurrentTaskHandler ( ) . endSuccessfully ( ) ; getParameters ( ) . incrementExecutionIndex ( ) ; if ( ( getExecutionIndex ( ) ) < ( getTaskHandlers ( ) . size ( ) ) ) { _actionState = CommandActionState.EXECUTE ; execute ( ) ; } } else { endSuccessfully ( ) ; } }

Target:
private void internalEndSuccessfully ( ) { log.info ( "Ending command '{}' successfully." , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { getCurrentTaskHandler ( ) . endSuccessfully ( ) ; getParameters ( ) . incrementExecutionIndex ( ) ; if ( ( getExecutionIndex ( ) ) < ( getTaskHandlers ( ) . size ( ) ) ) { _actionState = CommandActionState.EXECUTE ; execute ( ) ; } } else { endSuccessfully ( ) ; } }
Source:
public void validateVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToAnyNonDownVm ( org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }

Target:
public void validateCantLiveMigrateToBackupDomain ( ) { initStorageDomain ( srcStorageId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setBackup ( true ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_DISKS_ON_BACKUP_STORAGE ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel ) ( target ) ) ; model.setIsDiskHotPlugSupported ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; }

Target:
protected void UpdateIsDiskHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = vm.getVdsGroupCompatibilityVersion ( ) ; if ( clusterCompatibilityVersion == null ) { setIsDiskHotPlugSupported ( false ) ; } else { setIsDiskHotPlugSupported ( ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.HotPlugEnabled , clusterCompatibilityVersion.toString ( ) ) ) ) ) ; } }
Source:
public void testUpdateFieldsNameInStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; src.setInterfaces ( new java.util.ArrayList < > ( 2 ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.junit.Assert.assertTrue ( "Update should be valid for different names" , vmHandler.isUpdateValid ( src , dest ) ) ; }

Target:
public void testUpdateFieldsNameInStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; src.setInterfaces ( new java.util.ArrayList < > ( 2 ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.junit.Assert.assertFalse ( "Update should not be valid for different names" , vmHandler.isUpdateValid ( src , dest ) ) ; }
Source:
protected void expectGetLunsForVg ( java.lang.String vgId , boolean withDummyLun ) { org.ovirt.engine.core.dao.LunDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.LunDao.class ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getLunDao ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.getAllForVolumeGroup ( vgId ) ) . thenReturn ( setUpLuns ( withDummyLun ) ) ; }

Target:
protected void expectGetLunsForVg ( java.lang.String vgId , boolean withDummyLun ) { org.mockito.Mockito.when ( lunDao.getAllForVolumeGroup ( vgId ) ) . thenReturn ( setUpLuns ( withDummyLun ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > list = new java.util.ArrayList < > ( ) ; if ( source != null ) { for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( source ) ) ) { if ( ( template.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.OK ) ) { list.add ( template ) ; } } java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; } return list ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > list = new java.util.ArrayList < > ( ) ; if ( source != null ) { for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( source ) ) ) { if ( ( template.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.OK ) ) { list.add ( template ) ; } } java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; } return list ; }
Source:
public boolean isValid ( java.lang.Integer value , javax.validation.ConstraintValidatorContext context ) { return value == null ? true : ( value >= ( min ) ) && ( value <= ( max ) ) ; }

Target:
public boolean isValid ( java.lang.Integer value , javax.validation.ConstraintValidatorContext context ) { boolean result = ( value == null ) ? true : ( value >= ( min ) ) && ( value <= ( max ) ) ; if ( ! result ) { context.buildConstraintViolationWithTemplate ( rangeMessage ) ; } return result ; }
Source:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "testAddIncompleteParameters" , "provisionedSize|size" , "format" ) ; } }

Target:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; verifyIncompleteException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( model ) ) , "Disk" , "lambda$testAddIncompleteParameters$1" , "provisionedSize|size" , "format" ) ; }
Source:
private void executeDeactivateCommand ( ) { final org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase params = new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getStoragePoolId ( ) ) ; params.setSkipChecks ( true ) ; params.setSkipLock ( true ) ; params.setShouldBeLogged ( true ) ; runInternalActionWithTasksContext ( ActionType.DeactivateStorageDomain , params ) ; }

Target:
private void executeDeactivateCommand ( ) { final org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase params = new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getStoragePoolId ( ) ) ; params.setSkipChecks ( true ) ; params.setSkipLock ( true ) ; params.setShouldBeLogged ( true ) ; runInternalAction ( ActionType.DeactivateStorageDomain , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getContext ( ) ) ) ; }
Source:
void initTable ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VmTemplate > nameColumn = new org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VmTemplate object ) { return object.getname ( ) ; } } ; getTable ( ) . addColumn ( nameColumn , constants.nameTemplate ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmTemplateStatus getRawValue ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VmTemplate > object ) { return object.getSecond ( ) . getstatus ( ) ; }
Source:
private void addDisk ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalActionWithTasksContext ( ActionType.AddDisk , buildAddDiskParameters ( disk ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getFault ( ) . getError ( ) , java.lang.String.format ( "Failed to create disk! %s" , disk.getDiskAlias ( ) ) ) ; } org.ovirt.engine.core.bll.HibernateVmCommand.getTaskIdList ( ) . addAll ( returnValue.getInternalVdsmTaskIdList ( ) ) ; }

Target:
private void addDisk ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = runInternalActionWithTasksContext ( ActionType.AddDisk , buildAddDiskParameters ( disk ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getFault ( ) . getError ( ) , java.lang.String.format ( "Failed to create disk! %s" , disk.getDiskAlias ( ) ) ) ; } org.ovirt.engine.core.bll.HibernateVmCommand.getTaskIdList ( ) . addAll ( returnValue.getInternalVdsmTaskIdList ( ) ) ; }
Source:
public void testGetAllActionGroupsForRole ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.ActionGroup > result = dao.getAllForRole ( FixturesTool.ROLE_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.ActionGroupDaoTest.ACTION_GROUP_COUNT , result.size ( ) ) ; }

Target:
public void testGetAllActionGroupsForRole ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.ActionGroup > result = dao.getAllForRole ( FixturesTool.ROLE_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.ActionGroupDaoTest.ACTION_GROUP_COUNT , result.size ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; setUpVolumes ( ) ; setUpDisks ( ) ; }

Target:
protected void initQuery ( org.ovirt.engine.core.bll.storage.disk.cinder.GetUnregisteredCinderDisksByStorageDomainIdQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query ) { super . initQuery ( query ) ; org.ovirt.engine.core.common.queries.IdQueryParameters parameters = query.getParameters ( ) ; org.mockito.Mockito.when ( parameters.getId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; setUpVolumes ( ) ; setUpDisks ( ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsList = org.ovirt.engine.core.bll.GetAllVmsQuery.getDbFacade ( ) . getVmDAO ( ) . getAll ( org.ovirt.engine.core.bll.GetAllVmsQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllVmsQuery.getParameters ( ) . isFiltered ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsList ) { org.ovirt.engine.core.bll.VmHandler.UpdateVmGuestAgentVersion ( vm ) ; } org.ovirt.engine.core.bll.GetAllVmsQuery.getQueryReturnValue ( ) . setReturnValue ( vmsList ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsList = org.ovirt.engine.core.bll.GetAllVmsQuery.getDbFacade ( ) . getVmDao ( ) . getAll ( org.ovirt.engine.core.bll.GetAllVmsQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllVmsQuery.getParameters ( ) . isFiltered ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsList ) { org.ovirt.engine.core.bll.VmHandler.UpdateVmGuestAgentVersion ( vm ) ; } org.ovirt.engine.core.bll.GetAllVmsQuery.getQueryReturnValue ( ) . setReturnValue ( vmsList ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > siblingVlanInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( source ) ) ; if ( ( siblingVlanInterfaces.size ( ) ) > 0 ) { return true ; } return false ; }

Target:
public static boolean canVmsBePaused ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > items ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : items ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isSuspendSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ) { return false ; } } return true ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNicSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , nicName , false , null , network.getVlanId ( ) , network.getName ( ) , network.isVmNetwork ( ) ) ; return nic ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNicSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , network.getVlanId ( ) , network.getName ( ) , network.isVmNetwork ( ) ) ; return nic ; }
Source:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return org.ovirt.engine.core.bll.tasks.TaskManagerUtil.createTask ( this , asyncTaskCreationInfo , parentCommand , null , null , org.ovirt.engine.core.bll.CommandBase.EMPTY_GUID_ARRAY ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , getParentParameters ( parentCommand ) , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc glusterSnapshotInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName , java.lang.String snapshotName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue ; if ( snapshotName == null ) { xmlRpcReturnValue = vdsServer.glusterSnapshotInfo ( "" , volumeName ) ; } else { xmlRpcReturnValue = vdsServer.glusterSnapshotInfo ( snapshotName , volumeName ) ; } org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc ( clusterId , volumeName , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterSnapshotDelete ( java.lang.String snapshotName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterSnapshotDelete ( snapshotName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static void GetDocumentationBaseURL ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public void checkStorageDomainNotEqualWithStatusActive ( ) { setStorageDomainStatus ( StorageDomainStatus.Active ) ; org.junit.Assert.assertFalse ( cmd.CheckStorageDomainStatusNotEqual ( StorageDomainStatus.Active ) ) ; java.util.List < java.lang.String > messages = cmd.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertEquals ( messages.size ( ) , 2 ) ; org.junit.Assert.assertEquals ( messages.get ( 0 ) , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2.toString ( ) ) ; org.junit.Assert.assertEquals ( messages.get ( 1 ) , java.lang.String.format ( "$status %1$s" , StorageDomainStatus.Active ) ) ; }

Target:
public void checkStorageDomainNotEqualWithStatusActive ( ) { setStorageDomainStatus ( StorageDomainStatus.Active ) ; org.junit.Assert.assertFalse ( cmd.checkStorageDomainStatusNotEqual ( StorageDomainStatus.Active ) ) ; java.util.List < java.lang.String > messages = cmd.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertEquals ( messages.size ( ) , 2 ) ; org.junit.Assert.assertEquals ( messages.get ( 0 ) , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2.toString ( ) ) ; org.junit.Assert.assertEquals ( messages.get ( 1 ) , java.lang.String.format ( "$status %1$s" , StorageDomainStatus.Active ) ) ; }
Source:
private void completeGenerationInfo ( ) { org.ovirt.engine.core.common.businessentities.SubchainInfo info = org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.getParameters ( ) . getSubchainInfo ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getVolumeInfoFromVdsm ( org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.getParameters ( ) . getStoragePoolId ( ) , info.getStorageDomainId ( ) , info.getImageGroupId ( ) , info.getBaseImageId ( ) ) ; info.setBaseImageGeneration ( image.getImage ( ) . getGeneration ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.persistCommandIfNeeded ( ) ; }

Target:
private void completeGenerationInfo ( ) { org.ovirt.engine.core.common.businessentities.SubchainInfo info = org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.getParameters ( ) . getSubchainInfo ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage image = imagesHandler.getVolumeInfoFromVdsm ( org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.getParameters ( ) . getStoragePoolId ( ) , info.getStorageDomainId ( ) , info.getImageGroupId ( ) , info.getBaseImageId ( ) ) ; info.setBaseImageGeneration ( image.getImage ( ) . getGeneration ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.persistCommandIfNeeded ( ) ; }
Source:
public void testVmsWithNoIsoAttached ( ) { mockDomain ( ) ; org.mockito.Mockito.doReturn ( domain ) . when ( cmd ) . getStorageDomain ( ) ; org.mockito.Mockito.doReturn ( vmStaticDao ) . when ( cmd ) . getVmStaticDao ( ) ; org.mockito.Mockito.when ( vmStaticDao.getAllByStoragePoolId ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.VmStatic > emptyList ( ) ) ; org.junit.Assert.assertTrue ( cmd.isRunningVmsWithIsoAttached ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . isEmpty ( ) ) ; }

Target:
public void testVmsWithNoIsoAttached ( ) { mockDomain ( ) ; org.mockito.Mockito.doReturn ( domain ) . when ( cmd ) . getStorageDomain ( ) ; org.mockito.Mockito.doReturn ( vmStaticDao ) . when ( cmd ) . getVmStaticDao ( ) ; org.mockito.Mockito.when ( vmStaticDao.getAllByStoragePoolId ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.VmStatic > emptyList ( ) ) ; org.junit.Assert.assertTrue ( cmd.isRunningVmsWithIsoAttached ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . isEmpty ( ) ) ; }
Source:
public org.ovirt.engine.sdk.entities.Action commitnetconfig ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/commitnetconfig" ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . 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.Response delete ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . delete ( url , org.ovirt.engine.sdk.entities.Response.class , headers ) ; }
Source:
public void testGetExportNotFound ( ) { setUpGetStorageDomainExpectations ( StorageDomainType.ImportExport ) ; setUpGetEntityExpectations ( StorageDomainType.ImportExport , org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID , true ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetExportNotFound ( ) { setUpGetStorageDomainExpectations ( StorageDomainType.ImportExport ) ; setUpGetEntityExpectations ( StorageDomainType.ImportExport , org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID , true ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: get ) ) ; }
Source:
public void testContainsKeyReturnsFalseForNotExistingId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > testItems = java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , null ) ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( testItems ) ; org.junit.Assert.assertThat ( map.containsKey ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testContainsKeyReturnsFalseForNotExistingId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > testItems = java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , null ) ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( testItems ) ; org.hamcrest.MatcherAssert.assertThat ( map.containsKey ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getNetworkInterfaces ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifaces = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; iface.setNetworkName ( org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.GLUSTER_NW ) ; iface.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; iface.setAddress ( org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.SERVER_ADDRESS ) ; ifaces.add ( iface ) ; return ifaces ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getNetworkInterfaces ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifaces = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; iface.setNetworkName ( org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.GLUSTER_NW ) ; iface.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; iface.setIpv4Address ( org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.SERVER_ADDRESS ) ; ifaces.add ( iface ) ; return ifaces ; }
Source:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , getEntityList ( ) , failure ) ; } }

Target:
protected org.ovirt.engine.api.model.Network getEntity ( int index ) { org.ovirt.engine.api.model.Network entity = org.mockito.Mockito.mock ( org.ovirt.engine.api.model.Network.class ) ; org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( entity.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; return entity ; }
Source:
public void setMappingLocator ( org.ovirt.engine.api.restapi.types.MappingLocator mappingLocator ) { this . mappingLocator = mappingLocator ; }

Target:
private void addRngSources ( org.ovirt.engine.api.model.VersionCaps ver , org.ovirt.engine.api.model.RngSource [ ] vals ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( ver , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_5 ) ) { ver.setRngSources ( new org.ovirt.engine.api.model.RngSources ( ) ) ; for ( org.ovirt.engine.api.model.RngSource src : vals ) { ver.getRngSources ( ) . getRngSources ( ) . add ( src.name ( ) ) ; } } }
Source:
public void updateJobStepsCompleted ( org.ovirt.engine.core.compat.Guid jobId , org.ovirt.engine.core.common.job.JobExecutionStatus status , java.util.Date endTime ) { if ( status != ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) { updateQuery ( getEntityManager ( ) . createNamedQuery ( "Step.updateJobStepsCompleted" ) . setParameter ( "jobId" , jobId ) . setParameter ( "status" , status ) . setParameter ( "endTime" , endTime ) . setParameter ( "startedStatus" , JobExecutionStatus.STARTED ) ) ; } }

Target:
public void updateJobStepsCompleted ( org.ovirt.engine.core.compat.Guid jobId , org.ovirt.engine.core.common.job.JobExecutionStatus status , java.util.Date endTime ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "job_id" , jobId ) . addValue ( "status" , status.name ( ) ) . addValue ( "end_time" , endTime ) ; getCallsHandler ( ) . executeModification ( "updateJobStepsCompleted" , parameterSource ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid vdsgroupid = org.ovirt.engine.core.bll.GetAllNetworksByClusterIdQuery.getParameters ( ) . getVdsGroupId ( ) ; org.ovirt.engine.core.bll.GetAllNetworksByClusterIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetAllNetworksByClusterIdQuery.getDbFacade ( ) . getNetworkDAO ( ) . getAllForCluster ( vdsgroupid , org.ovirt.engine.core.bll.GetAllNetworksByClusterIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllNetworksByClusterIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid vdsgroupid = org.ovirt.engine.core.bll.GetAllNetworksByClusterIdQuery.getParameters ( ) . getVdsGroupId ( ) ; org.ovirt.engine.core.bll.GetAllNetworksByClusterIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetAllNetworksByClusterIdQuery.getDbFacade ( ) . getNetworkDao ( ) . getAllForCluster ( vdsgroupid , org.ovirt.engine.core.bll.GetAllNetworksByClusterIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllNetworksByClusterIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
protected void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getSucceeded ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( ActionType.AttachStorageDomainToPool , new org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters ( org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getStorageDomain ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getStoragePool ( ) . getId ( ) ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getReturnValue ( ) . setFault ( returnValue.getFault ( ) ) ; } } }

Target:
protected void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getSucceeded ( ) ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( ActionType.AttachStorageDomainToPool , new org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters ( org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getStorageDomain ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getStoragePool ( ) . getId ( ) ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.bll.storage.domain.AddLocalStorageDomainCommand.getReturnValue ( ) . setFault ( returnValue.getFault ( ) ) ; } } }
Source:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public static void getClusterGlusterServices ( 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 ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap runInTransaction ( ) { org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; context.snapshotEntityStatus ( map , map.getstatus ( ) ) ; map.setstatus ( status ) ; getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , map.getstatus ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap runInTransaction ( ) { org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; context.snapshotEntityStatus ( map , map.getStatus ( ) ) ; map.setStatus ( status ) ; getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , map.getStatus ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . CancelTasks ( getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }

Target:
public java.lang.Void runInTransaction ( ) { saveTaskAndPutInMap ( taskKey , task ) ; return null ; }