auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void bindFrontendInfrastructure ( ) { bind ( org.ovirt.engine.ui.frontend.Frontend.class ) . in ( com.google.inject.Singleton.class ) ; requestStaticInjection ( Frontend.InstanceHolder.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.VdcOperationManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.OperationProcessor.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.CommunicationProvider.class ) . to ( org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.class ) . in ( com.google.inject.Singleton.class ) ; }

Target:
private void bindFrontendInfrastructure ( ) { bind ( org.ovirt.engine.ui.frontend.Frontend.class ) . in ( com.google.inject.Singleton.class ) ; requestStaticInjection ( Frontend.InstanceHolder.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.VdcOperationManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.OperationProcessor.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.CommunicationProvider.class ) . to ( org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.frontend.communication.XsrfRpcRequestBuilder.class ) . in ( com.google.inject.Singleton.class ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult notChangingManagementNetwork ( org.ovirt.engine.core.common.businessentities.network.Network newNetwork ) { java.lang.String managementNetwork = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.ManagementNetwork ) ; return ( network.getName ( ) . equals ( managementNetwork ) ) && ( ! ( newNetwork.getName ( ) . equals ( managementNetwork ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_CAN_NOT_REMOVE_DEFAULT_NETWORK ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult notRenamingManagementNetwork ( org.ovirt.engine.core.common.businessentities.network.Network newNetwork ) { java.lang.String managementNetwork = org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) ; return ( network.getName ( ) . equals ( managementNetwork ) ) && ( ! ( newNetwork.getName ( ) . equals ( managementNetwork ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_CAN_NOT_REMOVE_DEFAULT_NETWORK ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
void initLists ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase object ) { iscsiDiscoverTargetsView = new org.ovirt.engine.ui.common.widget.uicommon.storage.IscsiDiscoverTargetsView ( ) ; sanStorageTargetToLunList = new org.ovirt.engine.ui.common.widget.uicommon.storage.SanStorageTargetToLunList ( object , hideLeaf , multiSelection ) ; targetsToLunsDiscoverPanel.add ( iscsiDiscoverTargetsView ) ; targetsListPanel.add ( sanStorageTargetToLunList ) ; }

Target:
void initLists ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase object ) { iscsiDiscoverTargetsView = new org.ovirt.engine.ui.common.widget.uicommon.storage.IscsiDiscoverTargetsView ( ) ; sanStorageTargetToLunList = new org.ovirt.engine.ui.common.widget.uicommon.storage.SanStorageTargetToLunList ( object , hideLeaf , multiSelection ) ; targetsToLunsDiscoverPanel.add ( iscsiDiscoverTargetsView ) ; targetsListPanel.add ( sanStorageTargetToLunList ) ; iscsiDiscoverTargetsView.setEnabled ( object.getContainer ( ) . getIsChangable ( ) ) ; }
Source:
public java.lang.String getDiskAlias ( ) { if ( ( getDisk ( ) ) != null ) { return getDisk ( ) . getDiskAlias ( ) ; } return org.apache.commons.lang.StringUtils.EMPTY ; }

Target:
private void freeVmSnapshotsWithWait ( ) { if ( ( org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getParameters ( ) . getVmId ( ) ) != null ) { org.ovirt.engine.core.utils.lock.EngineLock snapshotsEngineLock = new org.ovirt.engine.core.utils.lock.EngineLock ( ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > snapshotsExlusiveLockMap = java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getParameters ( ) . getVmId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_SNAPSHOTS , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; snapshotsEngineLock.setExclusiveLocks ( snapshotsExlusiveLockMap ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getLockManager ( ) . releaseLock ( snapshotsEngineLock ) ; } }
Source:
private void composeObjectIdForAnEmptyAuditLog ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable logable ) { java.lang.String composedObjectId = org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventKeyComposer.composeObjectId ( logable , AuditLogType.UNASSIGNED ) ; org.junit.Assert.assertEquals ( ( "type=UNASSIGNED," + ( ( ( ( ( ( ( "sd=," + "dc=," ) + "user=," ) + "cluster=," ) + "vds=," ) + "vm=," ) + "template=," ) + "customId=" ) ) , composedObjectId ) ; }

Target:
private void composeObjectIdForAnEmptyAuditLog ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable logable ) { java.lang.String composedObjectId = org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventKeyComposer.composeObjectId ( logable , AuditLogType.UNASSIGNED ) ; org.junit.jupiter.api.Assertions.assertEquals ( ( "type=UNASSIGNED," + ( ( ( ( ( ( ( "sd=," + "dc=," ) + "user=," ) + "cluster=," ) + "vds=," ) + "vm=," ) + "template=," ) + "customId=" ) ) , composedObjectId ) ; }
Source:
protected void updateVMDetails ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmGuestAgentVersion ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateNetworkInterfacesFromDb ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( vm.getStaticData ( ) , true ) ; org.ovirt.engine.core.bll.VmHandler.updateNumaNodesFromDb ( vm ) ; }

Target:
protected void updateVMDetails ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmGuestAgentVersion ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateNetworkInterfacesFromDb ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( vm.getStaticData ( ) , true ) ; org.ovirt.engine.core.bll.VmHandler.updateNumaNodesFromDb ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmStatistics ( vm ) ; }
Source:
public void testValidateGatewayWhenGatewayIsNotSpecified ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; attachment.getIpConfiguration ( ) . getPrimaryAddress ( ) . setGateway ( "" ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . validateGateway ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateGatewayWhenGatewayIsNotSpecified ( ) throws java.lang.Exception { doTestValidateGateway ( "" , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { java.util.ArrayList < java.lang.String > networkList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView network : importModel.getNetworkProfiles ( ) ) { networkList.add ( network.getName ( ) ) ; } ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( networkList ) ; return networkList.isEmpty ( ) ? "" : networkList.get ( 0 ) ; }

Target:
public void update ( int index , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface , java.lang.String value ) { importModel.getNetworkImportData ( iface ) . setSelectedNetworkName ( value ) ; nicTable.asEditor ( ) . edit ( importModel.getImportNetworkInterfaceListModel ( ) ) ; }
Source:
public void syncNetworkQosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; org.ovirt.engine.core.compat.Guid qosId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.when ( qosDao.get ( qosId ) ) . thenReturn ( createQos ( ) ) ; network.setQosId ( qosId ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void syncNetworkQosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; org.ovirt.engine.core.compat.Guid qosId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.when ( qosDao.get ( qosId ) ) . thenReturn ( createQos ( ) ) ; network.setQosId ( qosId ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( iface ) ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }
Source:
protected boolean validateBonds ( java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > bonds , java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > > bondSlaves ) { boolean returnValue = true ; for ( java.lang.String bondName : bonds.keySet ( ) ) { if ( ( bondSlaves.containsKey ( bondName ) ) && ( ( bondSlaves.get ( bondName ) . size ( ) ) < 2 ) ) { returnValue = false ; violations.add ( VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; } } return returnValue ; }

Target:
protected boolean validateBonds ( java.util.Set < java.lang.String > bonds , java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > > bondSlaves ) { boolean returnValue = true ; for ( java.lang.String bondName : bonds ) { if ( ( bondSlaves.containsKey ( bondName ) ) && ( ( bondSlaves.get ( bondName ) . size ( ) ) < 2 ) ) { returnValue = false ; violations.add ( VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; } } return returnValue ; }
Source:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( cModel == null ) { return ; } else { cModel.stopProgress ( ) ; if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { cModel.setMessage ( result.getReturnValue ( ) . getFault ( ) . getMessage ( ) ) ; } else { setWindow ( null ) ; } } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { cModel.stopProgress ( ) ; if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { cModel.setMessage ( result.getReturnValue ( ) . getFault ( ) . getMessage ( ) ) ; } else { closeWindow ( ) ; } }
Source:
public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > getJobSubjectEntityByJobId ( org.ovirt.engine.core.compat.Guid jobId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "job_id" , jobId ) ; java.util.List < org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity > list = getCallsHandler ( ) . executeReadList ( "GetJobSubjectEntityByJobId" , org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.jobSubjectEntityRowMapper , parameterSource ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entityMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > ( ) ; for ( org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity jobSubjectEntity : list ) { entityMap.put ( jobSubjectEntity.getEntityId ( ) , jobSubjectEntity.getEntityType ( ) ) ; } return entityMap ; }

Target:
public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > getJobSubjectEntityByJobId ( org.ovirt.engine.core.compat.Guid jobId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "job_id" , jobId ) ; java.util.List < org.ovirt.engine.core.common.businessentities.SubjectEntity > list = getCallsHandler ( ) . executeReadList ( "GetJobSubjectEntityByJobId" , org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.jobSubjectEntityRowMapper , parameterSource ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entityMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > ( ) ; for ( org.ovirt.engine.core.common.businessentities.SubjectEntity jobSubjectEntity : list ) { entityMap.put ( jobSubjectEntity.getEntityId ( ) , jobSubjectEntity.getEntityType ( ) ) ; } return entityMap ; }
Source:
private void mockBackend ( ) { org.powermock.api.mockito.PowerMockito.when ( org.ovirt.engine.core.bll.Backend.getInstance ( ) ) . thenReturn ( backend ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; returnValue.setReturnValue ( java.lang.Boolean.FALSE ) ; org.powermock.api.mockito.PowerMockito.when ( backend.runInternalQuery ( org.mockito.Matchers.< org.ovirt.engine.core.common.queries.VdcQueryType > any ( org.ovirt.engine.core.common.queries.VdcQueryType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ) . thenReturn ( returnValue ) ; org.powermock.api.mockito.PowerMockito.when ( backend.getResourceManager ( ) ) . thenReturn ( vdsBrokerFrontend ) ; }

Target:
private void mockBackend ( org.ovirt.engine.core.bll.AddVmCommand < ? > cmd ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; returnValue.setReturnValue ( java.lang.Boolean.FALSE ) ; org.mockito.Mockito.when ( backend.runInternalQuery ( org.mockito.Matchers.< org.ovirt.engine.core.common.queries.VdcQueryType > any ( org.ovirt.engine.core.common.queries.VdcQueryType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ) . thenReturn ( returnValue ) ; org.mockito.Mockito.when ( backend.getResourceManager ( ) ) . thenReturn ( vdsBrokerFrontend ) ; org.mockito.Mockito.doReturn ( backend ) . when ( cmd ) . getBackend ( ) ; }
Source:
protected void cretaeVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setactive ( true ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; mockVmDevice ( false ) ; }

Target:
protected void cretaeVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setActive ( true ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; mockVmDevice ( false ) ; }
Source:
private org.ovirt.engine.api.model.Nic clone ( org.ovirt.engine.api.model.Nic parent ) { org.ovirt.engine.api.model.Nic nic = new org.ovirt.engine.api.model.Nic ( ) ; nic.setId ( parent.getId ( ) ) ; nic.setVm ( new org.ovirt.engine.api.model.VM ( ) ) ; nic.getVm ( ) . setId ( parent.getVm ( ) . getId ( ) ) ; return nic ; }

Target:
private org.ovirt.engine.api.model.Nic clone ( org.ovirt.engine.api.model.Nic parent ) { org.ovirt.engine.api.model.Nic nic = new org.ovirt.engine.api.model.Nic ( ) ; nic.setId ( parent.getId ( ) ) ; nic.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; nic.getVm ( ) . setId ( parent.getVm ( ) . getId ( ) ) ; return nic ; }
Source:
public void testVmUpAndDiskPlugged ( ) { org.ovirt.engine.core.common.businessentities.VM vm = createMockVm ( VMStatus.Up ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement diskVmElement = createMockDiskVmElement ( vm.getId ( ) , true ) ; org.mockito.Mockito.doReturn ( vm ) . when ( vmDao ) . get ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( ActionType.LiveMigrateDisk , command.getMoveActionType ( java.util.Collections.singletonList ( diskVmElement ) ) ) ; }

Target:
public void testVmUpAndDiskPlugged ( ) { org.ovirt.engine.core.common.businessentities.VM vm = createMockVm ( VMStatus.Up ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement diskVmElement = createMockDiskVmElement ( vm.getId ( ) , true ) ; org.mockito.Mockito.doReturn ( vm ) . when ( vmDao ) . get ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( ActionType.LiveMigrateDisk , command.getMoveActionType ( java.util.Collections.singletonList ( diskVmElement ) ) ) ; }
Source:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.storage.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testValidRemovedBondsWhenNotRemovingAnyBond ( ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . addExistingInterfaces ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( null ) ) ) . build ( ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidRemovedBondsWhenNotRemovingAnyBond ( ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . addExistingInterfaces ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( null ) ) ) . build ( ) ; org.hamcrest.MatcherAssert.assertThat ( validator.validRemovedBonds ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private void handleEngineDirectoryServiceException ( org.ovirt.engine.core.bll.adbroker.LdapSearchExceptionHandlingResponse response , java.lang.Throwable cause ) { response.setTranslatedException ( ( ( org.ovirt.engine.core.bll.adbroker.AuthenticationResultException ) ( cause ) ) ) ; switch ( ( ( org.ovirt.engine.core.bll.adbroker.AuthenticationResultException ) ( cause ) ) . getResult ( ) ) { case CONNECTION_ERROR : case CONNECTION_TIMED_OUT : case CLOCK_SKEW_TOO_GREAT : response.setServerScore ( Score.LOW ) . setTryNextServer ( true ) ; break ; default : response.setServerScore ( Score.HIGH ) . setTryNextServer ( false ) ; break ; } }

Target:
private void handleEngineDirectoryServiceException ( org.ovirt.engine.core.bll.adbroker.LdapSearchExceptionHandlingResponse response , java.lang.Throwable cause ) { response.setTranslatedException ( ( ( org.ovirt.engine.core.bll.adbroker.AuthenticationResultException ) ( cause ) ) ) ; switch ( ( ( org.ovirt.engine.core.bll.adbroker.AuthenticationResultException ) ( cause ) ) . getResult ( ) ) { case CONNECTION_ERROR : case CONNECTION_TIMED_OUT : case CLOCK_SKEW_TOO_GREAT : response.setOrderingAlgorithm ( OrderingAlgorithmType.PUT_LAST ) . setTryNextServer ( true ) ; break ; default : response.setOrderingAlgorithm ( OrderingAlgorithmType.NO_OP ) . setTryNextServer ( false ) ; break ; } }
Source:
public void update ( int index , org.ovirt.engine.core.common.businessentities.DiskImage disk , java.lang.String value ) { java.lang.String storageDomainName = value.substring ( 0 , value.lastIndexOf ( " (" ) ) ; importModel.getDiskImportData ( disk.getId ( ) ) . setSelectedStorageDomainString ( storageDomainName ) ; diskTable.edit ( importModel.getImportDiskListModel ( ) ) ; }

Target:
public void update ( int index , org.ovirt.engine.core.common.businessentities.DiskImage disk , java.lang.String value ) { java.lang.String storageDomainName = value.substring ( 0 , value.lastIndexOf ( " (" ) ) ; importModel.getDiskImportData ( disk.getId ( ) ) . setSelectedStorageDomainString ( storageDomainName ) ; diskTable.asEditor ( ) . edit ( importModel.getImportDiskListModel ( ) ) ; }
Source:
public void validate ( ) { java.util.List lunsFromDb = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun1 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun1.setLUNId ( "1" ) ; lun1.setStorageDomainId ( sdId ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun2 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun2.setLUNId ( "2" ) ; lun2.setStorageDomainId ( sdId ) ; lunsFromDb.add ( lun1 ) ; lunsFromDb.add ( lun2 ) ; org.mockito.Mockito.when ( lunsDao.getAllForVolumeGroup ( org.ovirt.engine.core.bll.storage.domain.RefreshLunsSizeCommandTest.STORAGE ) ) . thenReturn ( lunsFromDb ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }

Target:
public void validate ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun1 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun1.setLUNId ( "1" ) ; lun1.setStorageDomainId ( sdId ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun2 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun2.setLUNId ( "2" ) ; lun2.setStorageDomainId ( sdId ) ; org.mockito.Mockito.when ( lunsDao.getAllForVolumeGroup ( org.ovirt.engine.core.bll.storage.domain.RefreshLunsSizeCommandTest.STORAGE ) ) . thenReturn ( java.util.Arrays.asList ( lun1 , lun2 ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
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:
public final boolean acquireLockAsyncTask ( ) { org.ovirt.engine.core.common.action.LockProperties lockProperties = getLockProperties ( ) ; boolean returnValue = true ; if ( ! ( Scope.None.equals ( lockProperties.getScope ( ) ) ) ) { releaseLocksAtEndOfExecute = Scope.Execution.equals ( lockProperties.getScope ( ) ) ; if ( ! ( releaseLocksAtEndOfExecute ) ) { returnValue = acquireLockInternal ( ) ; } } return returnValue ; }
Source:
public java.lang.String load ( java.io.File file ) { try ( java.io.FileInputStream inputStream = new java.io.FileInputStream ( file ) ) { java.util.Properties props = new java.util.Properties ( ) ; props.load ( inputStream ) ; return loadImpl ( props , file ) ; } catch ( java.io.IOException exception ) { throw new org.ovirt.engine.core.extensions.mgr.ConfigurationException ( java.lang.String.format ( "Can't load object configuration file '%1$s': %2$s" , file.getAbsolutePath ( ) , exception.getMessage ( ) ) , exception ) ; } }

Target:
public java.lang.String load ( java.io.File file ) { try ( java.io.InputStream is = new java.io.FileInputStream ( file ) ; java.io.Reader reader = new java.io.InputStreamReader ( is , java.nio.charset.Charset.forName ( "UTF-8" ) ) ) { java.util.Properties props = new java.util.Properties ( ) ; props.load ( reader ) ; return loadImpl ( props , file ) ; } catch ( java.io.IOException exception ) { throw new org.ovirt.engine.core.extensions.mgr.ConfigurationException ( java.lang.String.format ( "Can't load object configuration file '%1$s': %2$s" , file.getAbsolutePath ( ) , exception.getMessage ( ) ) , exception ) ; } }
Source:
public void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getHostDevicesByHostId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExtendedHostDevicesByHostId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }
Source:
private void initInterface ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( getVmId ( ) ) ; iface.setVmName ( getVm ( ) . getName ( ) ) ; }

Target:
private void initInterface ( org.ovirt.engine.core.common.businessentities.network.VmNic iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( getVmId ( ) ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration > configs = org.ovirt.engine.core.bll.gluster.GetGlusterVolumeGeoRepConfigListQuery.getGeoRepDao ( ) . getGeoRepSessionConfig ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeGeoRepConfigListQuery.getParameters ( ) . getId ( ) ) ; configs.addAll ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeGeoRepConfigListQuery.getGeoRepDao ( ) . getGlusterGeoRepSessionUnSetConfig ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeGeoRepConfigListQuery.getParameters ( ) . getId ( ) ) ) ; org.ovirt.engine.core.bll.gluster.GetGlusterVolumeGeoRepConfigListQuery.getQueryReturnValue ( ) . setReturnValue ( configs ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration > configs = glusterGeoRepDao.getGeoRepSessionConfig ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeGeoRepConfigListQuery.getParameters ( ) . getId ( ) ) ; configs.addAll ( glusterGeoRepDao.getGlusterGeoRepSessionUnSetConfig ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeGeoRepConfigListQuery.getParameters ( ) . getId ( ) ) ) ; org.ovirt.engine.core.bll.gluster.GetGlusterVolumeGeoRepConfigListQuery.getQueryReturnValue ( ) . setReturnValue ( configs ) ; }
Source:
public void testValues ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "L" ) ) ; org.junit.Assert.assertTrue ( "luke" , comps.contains ( "luke" ) ) ; org.junit.Assert.assertTrue ( "leia" , comps.contains ( "leia" ) ) ; }

Target:
public void testValues ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "L" ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( comps.contains ( "luke" ) , "luke" ) ; org.junit.jupiter.api.Assertions.assertTrue ( comps.contains ( "leia" ) , "leia" ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.MoveDiskModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.MoveDiskModel ) ( result.getState ( ) ) ) ; localModel.StopProgress ( ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel listModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel ) ( localModel.getEntity ( ) ) ) ; listModel.setWindow ( null ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.MoveDiskModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.MoveDiskModel ) ( result.getState ( ) ) ) ; localModel.cancel ( ) ; }
Source:
public void testHotsetUpdateableWhenHotsetRequestedAndStatusOtherThanHotSettable ( ) { org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; oic.addHotsetField ( "name" , java.util.EnumSet.of ( VMStatus.Up ) ) ; org.junit.Assert.assertFalse ( "hot set requested for hot set fields should be false in state other than Up" , oic.isFieldUpdatable ( null , "name" , null , true ) ) ; }

Target:
public void testHotsetUpdateableWhenHotsetRequestedAndStatusOtherThanHotSettable ( ) { org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; oic.addHotsetField ( "name" , java.util.EnumSet.of ( VMStatus.Up ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( oic.isFieldUpdatable ( null , "name" , null , true ) , "hot set requested for hot set fields should be false in state other than Up" ) ; }
Source:
protected void endWithFailure ( ) { if ( isVmRunningStateless ( ) ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters createSnapshotParameters = buildCreateSnapshotParameters ( ) ; createSnapshotParameters.setImagesParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , createSnapshotParameters , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }

Target:
protected void endWithFailure ( ) { if ( isStatelessSnapshotExistsForVm ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , buildCreateSnapshotParametersForEndAction ( ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }
Source:
public void testUpdateReadOnly ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.UpdateVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "DiskInfo.ReadOnly" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.TRUE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }

Target:
public void testUpdateReadOnly ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "VmId" , "DiskInfo.ReadOnly" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.TRUE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }
Source:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
private void mockTransactionManagement ( ) throws javax.transaction.SystemException { javax.transaction.Transaction trans = org.mockito.Mockito.mock ( javax.transaction.Transaction.class ) ; javax.transaction.TransactionManager tm = org.mockito.Mockito.mock ( javax.transaction.TransactionManager.class ) ; org.mockito.Mockito.doReturn ( trans ) . when ( tm ) . getTransaction ( ) ; org.mockito.Mockito.doReturn ( tm ) . when ( mockStrategy ) . < javax.transaction.TransactionManager > findResource ( ContainerManagedResourceType.TRANSACTION_MANAGER ) ; }

Target:
public void mockBean ( org.ovirt.engine.core.utils.ejb.BeanType type , java.lang.Object bean ) { mockBeanMap.put ( type , bean ) ; org.mockito.Mockito.when ( mockStrategy.findBean ( org.mockito.Matchers.eq ( type ) , org.mockito.Matchers.any ( org.ovirt.engine.core.utils.ejb.BeanProxyType.class ) ) ) . thenReturn ( bean ) ; }
Source:
public void testAllDomainsWithinThresholdsOneLacking ( ) { domain1.getStorageDynamicData ( ) . setAvailableDiskSize ( ( ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) + 1 ) ) ; domain2.getStorageDynamicData ( ) . setAvailableDiskSize ( ( ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) - 1 ) ) ; domain1.setCriticalSpaceActionBlocker ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) ; domain2.setCriticalSpaceActionBlocker ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.allDomainsWithinThresholds ( ) ; org.junit.Assert.assertFalse ( "domain2 should not be within thresholds" , result.isValid ( ) ) ; org.junit.Assert.assertEquals ( "Wrong validation error" , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN , result.getMessage ( ) ) ; }

Target:
public void testAllDomainsWithinThresholdsOneLacking ( ) { domain1.getStorageDynamicData ( ) . setAvailableDiskSize ( ( ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) + 1 ) ) ; domain2.getStorageDynamicData ( ) . setAvailableDiskSize ( ( ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) - 1 ) ) ; domain1.setCriticalSpaceActionBlocker ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) ; domain2.setCriticalSpaceActionBlocker ( org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidatorTest.CRITICAL_SPACE_THRESHOLD ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.allDomainsWithinThresholds ( ) ; org.junit.Assert.assertThat ( "domain2 should not be within thresholds" , result , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; }
Source:
private int getOccupiedVmSlots ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.Map < java.lang.String , java.lang.String > parameters ) { int occupiedSlots = vds.getVmActive ( ) ; final int SPMVMCountGrace = org.apache.commons.lang.math.NumberUtils.toInt ( parameters.get ( PolicyUnitParameter.SPM_VM_GRACE.getDbName ( ) ) , spmVmGrace ) ; if ( vds.isSpm ( ) ) { occupiedSlots += SPMVMCountGrace ; } return occupiedSlots ; }

Target:
private int getOccupiedVmSlots ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.Map < java.lang.String , java.lang.String > parameters ) { int occupiedSlots = vds.getVmActive ( ) ; final int SPMVMCountGrace = org.apache.commons.lang.math.NumberUtils.toInt ( parameters.get ( PolicyUnitParameter.SPM_VM_GRACE.getDbName ( ) ) , spmVmGrace ) ; if ( vds.isSpm ( ) ) { occupiedSlots += SPMVMCountGrace ; } occupiedSlots += org.ovirt.engine.core.bll.scheduling.pending.PendingVM.collectForHost ( getPendingResourceManager ( ) , vds.getId ( ) ) . size ( ) ; return occupiedSlots ; }
Source:
private void initVmDiskImage ( boolean isShareable ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setVmEntityType ( VmEntityType.VM ) ; diskImage.setShareable ( isShareable ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( diskImage ) ; }

Target:
private void initVmDiskImage ( boolean isShareable ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setVmEntityType ( VmEntityType.VM ) ; diskImage.setShareable ( isShareable ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( diskImage ) ; }
Source:
public void testStart ( ) throws java.lang.Exception { setUpWindowsGetEntityExpectations ( 1 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RunVmOnce , org.ovirt.engine.core.common.action.RunVmOnceParams.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; javax.ws.rs.core.Response response = resource.start ( new org.ovirt.engine.api.model.Action ( ) ) ; verifyActionResponse ( response ) ; verifyActionModel ( ( ( org.ovirt.engine.api.model.Action ) ( response.getEntity ( ) ) ) . getVm ( ) , 0 ) ; }

Target:
public void testStart ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.RunVm , org.ovirt.engine.core.common.action.RunVmParams.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; javax.ws.rs.core.Response response = resource.start ( new org.ovirt.engine.api.model.Action ( ) ) ; verifyActionResponse ( response ) ; verifyActionModel ( ( ( org.ovirt.engine.api.model.Action ) ( response.getEntity ( ) ) ) . getVm ( ) , 0 ) ; }
Source:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void setObjectName ( java.lang.Object object , java.lang.String name , boolean isSuffix ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) . getVm ( ) ; if ( isSuffix ) { vm.setName ( ( ( vm.getName ( ) ) + name ) ) ; } else { vm.setName ( name ) ; } }

Target:
protected java.lang.String getObjectName ( java.lang.Object object ) { return ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) . getVm ( ) . getName ( ) ; }
Source:
protected boolean validateQuota ( ) { getParameters ( ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Disk dit : getVm ( ) . getDiskMap ( ) . values ( ) ) { ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( dit ) ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; } return true ; }

Target:
private java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > getStorageQuotaListParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : getVm ( ) . getDiskMap ( ) . values ( ) ) { if ( disk instanceof org.ovirt.engine.core.common.businessentities.DiskImage ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; list.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( diskImage.getQuotaId ( ) , imageToDestinationDomainMap.get ( diskImage.getId ( ) ) , diskImage.getSizeInGigabytes ( ) ) ) ; } } return list ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemovePermission , org.ovirt.engine.core.common.action.PermissionsOperationsParameters.class , new java.lang.String [ ] { "Permission.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemovePermission , org.ovirt.engine.core.common.action.PermissionsOperationsParameters.class , new java.lang.String [ ] { "Permission.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }