auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected java.lang.Long getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) . getSize ( ) : ( ( long ) ( ( ( ( org.ovirt.engine.core.common.businessentities.LunDisk ) ( object ) ) . getLun ( ) . getDeviceSize ( ) ) * ( java.lang.Math.pow ( 1024 , 3 ) ) ) ) ; }

Target:
protected java.lang.Long getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) . getSize ( ) : ( ( long ) ( ( ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( object ) ) . getLun ( ) . getDeviceSize ( ) ) * ( java.lang.Math.pow ( 1024 , 3 ) ) ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean authenticationRequired = requiresAuthentication.getEntity ( ) ; getUsername ( ) . setIsChangable ( authenticationRequired ) ; getPassword ( ) . setIsChangable ( authenticationRequired ) ; getTenantName ( ) . setIsChangable ( authenticationRequired ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean authenticationRequired = requiresAuthentication.getEntity ( ) ; getUsername ( ) . setIsChangable ( authenticationRequired ) ; getPassword ( ) . setIsChangable ( authenticationRequired ) ; getTenantName ( ) . setIsChangable ( authenticationRequired ) ; getAuthUrl ( ) . setIsChangable ( authenticationRequired ) ; }
Source:
private org.ovirt.engine.core.common.action.AddSANStorageDomainParameters getSanAddParams ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic entity , org.ovirt.engine.core.compat.Guid hostId , java.util.ArrayList < java.lang.String > lunIds , boolean force ) { org.ovirt.engine.core.common.action.AddSANStorageDomainParameters params = new org.ovirt.engine.core.common.action.AddSANStorageDomainParameters ( entity ) ; params.setVdsId ( hostId ) ; params.setLunIds ( lunIds ) ; params.setForce ( force ) ; return params ; }

Target:
private org.ovirt.engine.core.common.action.AddSANStorageDomainParameters getSanAddParams ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic entity , org.ovirt.engine.core.compat.Guid hostId , java.util.Set < java.lang.String > lunIds , boolean force ) { org.ovirt.engine.core.common.action.AddSANStorageDomainParameters params = new org.ovirt.engine.core.common.action.AddSANStorageDomainParameters ( entity ) ; params.setVdsId ( hostId ) ; params.setLunIds ( lunIds ) ; params.setForce ( force ) ; return params ; }
Source:
public void testUpdateVolumeStatusByName ( ) { org.junit.Assert.assertTrue ( existingDistVol.isOnline ( ) ) ; dao.updateVolumeStatusByName ( existingDistVol.getClusterId ( ) , existingDistVol.getName ( ) , GlusterStatus.DOWN ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = dao.getById ( existingDistVol.getId ( ) ) ; org.junit.Assert.assertNotNull ( volume ) ; org.junit.Assert.assertFalse ( volume.isOnline ( ) ) ; org.junit.Assert.assertFalse ( volume.equals ( existingDistVol ) ) ; existingDistVol.setStatus ( GlusterStatus.DOWN ) ; org.junit.Assert.assertEquals ( existingDistVol , volume ) ; }

Target:
public void testUpdateVolumeStatusByName ( ) { org.junit.Assert.assertTrue ( existingDistVol.isOnline ( ) ) ; dao.updateVolumeStatusByName ( existingDistVol.getClusterId ( ) , existingDistVol.getName ( ) , GlusterStatus.DOWN ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = dao.getById ( existingDistVol.getId ( ) ) ; org.junit.Assert.assertNotNull ( volume ) ; org.junit.Assert.assertFalse ( volume.isOnline ( ) ) ; org.junit.Assert.assertNotEquals ( volume , existingDistVol ) ; existingDistVol.setStatus ( GlusterStatus.DOWN ) ; org.junit.Assert.assertEquals ( existingDistVol , volume ) ; }
Source:
protected void executeCommand ( ) { if ( ! ( org.ovirt.engine.core.bll.ExportVmTemplateCommand.getTemplateDisks ( ) . isEmpty ( ) ) ) { moveOrCopyAllImageGroups ( ) ; } else { org.ovirt.engine.core.bll.ExportVmTemplateCommand.endVmTemplateRelatedOps ( ) ; } org.ovirt.engine.core.bll.ExportVmTemplateCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( org.ovirt.engine.core.bll.ExportVmTemplateCommand.getVmTemplate ( ) , true ) ; if ( ! ( org.ovirt.engine.core.bll.ExportVmTemplateCommand.getTemplateDisks ( ) . isEmpty ( ) ) ) { moveOrCopyAllImageGroups ( ) ; } else { org.ovirt.engine.core.bll.ExportVmTemplateCommand.endVmTemplateRelatedOps ( ) ; } org.ovirt.engine.core.bll.ExportVmTemplateCommand.setSucceeded ( true ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OvfReturnForXmlRpc getConvertedVm ( java.lang.String jobUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getConvertedVm" ) . withParameter ( "jobid" , jobUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "ovf" ) . withResponseType ( java.lang.String.class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OvfReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OvfReturn getConvertedVm ( java.lang.String jobUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getConvertedVm" ) . withParameter ( "jobid" , jobUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "ovf" ) . withResponseType ( java.lang.String.class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OvfReturn ( response ) ; }
Source:
private void initSrcStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain stDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; stDomain.setstatus ( StorageDomainStatus.Active ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( command ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( stDomain ) ; }

Target:
private void initSrcStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain stDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; stDomain.setStatus ( StorageDomainStatus.Active ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( command ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( stDomain ) ; }
Source:
protected void updateExtendImageSizeSupported ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.ui.frontend.AsyncQuery query = new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override 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.setExtendImageSizeSupported ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isCommandCompatible ( query , VdcActionType.ExtendImageSize , vm.getVdsGroupCompatibilityVersion ( ) , dataCenterVersion ) ; }

Target:
protected void updateExtendImageSizeSupported ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.ui.frontend.AsyncQuery query = new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override 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.setExtendImageSizeSupported ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isCommandCompatible ( query , VdcActionType.ExtendImageSize , vm.getClusterCompatibilityVersion ( ) , dataCenterVersion ) ; }
Source:
public static void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public static void getVmGuestAgentInterfacesByVmId ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmStatic [ ] initVmStaticsOrderedByAutoStartup ( java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > vmStatics ) { org.ovirt.engine.core.common.businessentities.VmStatic [ ] vmStaticArray = new org.ovirt.engine.core.common.businessentities.VmStatic [ org.ovirt.engine.core.dao.DbFacadeDAOTest.NUM_OF_VM_STATIC_IN_FIXTURES ] ; vmStaticArray = initVmStaticsOrderedByPriority ( vmStatics ) ; org.ovirt.engine.core.common.businessentities.VmStatic tempVmStatic = vmStaticArray [ 0 ] ; vmStaticArray [ 0 ] = vmStaticArray [ 1 ] ; vmStaticArray [ 1 ] = tempVmStatic ; vmStaticArray [ 0 ] . setauto_startup ( true ) ; updateArrayOfVmStaticsInDb ( vmStaticArray ) ; return vmStaticArray ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmStatic [ ] initVmStaticsOrderedByAutoStartup ( java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > vmStatics ) { org.ovirt.engine.core.common.businessentities.VmStatic [ ] vmStaticArray = new org.ovirt.engine.core.common.businessentities.VmStatic [ org.ovirt.engine.core.dao.DbFacadeDAOTest.NUM_OF_VM_STATIC_IN_FIXTURES ] ; vmStaticArray = initVmStaticsOrderedByPriority ( vmStatics ) ; org.ovirt.engine.core.common.businessentities.VmStatic tempVmStatic = vmStaticArray [ 0 ] ; vmStaticArray [ 0 ] = vmStaticArray [ 1 ] ; vmStaticArray [ 1 ] = tempVmStatic ; vmStaticArray [ 0 ] . setAutoStartup ( true ) ; updateArrayOfVmStaticsInDb ( vmStaticArray ) ; return vmStaticArray ; }
Source:
public void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }

Target:
public void getAAAProfilesEntriesList ( 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.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void validateBeanValidations ( ) { org.junit.Assert.assertTrue ( command.validateInputs ( ) ) ; }

Target:
public void validatePatternBasedPoolName ( ) { java.lang.String patternBaseName = "aa-??bb" ; command.getParameters ( ) . getVmStaticData ( ) . setName ( patternBaseName ) ; command.getParameters ( ) . getVmPool ( ) . setName ( patternBaseName ) ; org.junit.jupiter.api.Assertions.assertTrue ( command.validateInputs ( ) ) ; }
Source:
public void onTimer ( ) { try { org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.info ( "Start deleteAgedOutCommandEntities" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . addDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.CommandEntityAgingThreshold ) ) * ( - 1 ) ) ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsBeforeDate ( latestTimeToKeep ) ; org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.info ( "Finished deleteAgedOutCommandEntities" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.error ( "deleteAgedOutCommandEntities failed with exception" , e ) ; } }

Target:
private void cleanup ( ) { try { org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.debug ( "Start cleanup" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . addDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.CommandEntityAgingThreshold ) ) * ( - 1 ) ) ) ; commandCoordinatorUtil.removeAllCommandsBeforeDate ( latestTimeToKeep ) ; org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.debug ( "Finished cleanup" ) ; } catch ( java.lang.Throwable t ) { org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.error ( "Exception in performing command entity cleanup: {}" , org.apache.commons.lang.exception.ExceptionUtils.getRootCauseMessage ( t ) ) ; org.ovirt.engine.core.bll.CommandEntityCleanupManager.log.debug ( "Exception" , t ) ; } }
Source:
public void setPopupKeyPressHandler ( org.ovirt.engine.ui.common.widget.dialog.PopupNativeKeyPressHandler keyPressHandler ) { popup.setKeyPressHandler ( keyPressHandler ) ; }

Target:
void localize ( org.ovirt.engine.ui.userportal.ApplicationConstants constants ) { headerLabel.setText ( constants.loginHeaderLabel ( ) ) ; userNameLabel.setText ( constants.loginFormUserNameLabel ( ) ) ; passwordLabel.setText ( constants.loginFormPasswordLabel ( ) ) ; domainLabel.setText ( constants.loginFormDomainLabel ( ) ) ; connectAutomatically.setLabel ( constants.loginFormConnectAutomaticallyLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.scheduling.AffinityGroup > getAllHardAffinityGroups ( org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup ) { return org.ovirt.engine.core.utils.linq.LinqUtils.filter ( affinityGroupDao.getAllAffinityGroupsByClusterId ( vdsGroup.getId ( ) ) , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.scheduling.AffinityGroup > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.scheduling.AffinityGroup affinityGroup ) { return affinityGroup.isEnforcing ( ) ; } } ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.scheduling.AffinityGroup > getAllHardAffinityGroups ( org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup ) { return affinityGroupDao.getAllAffinityGroupsByClusterId ( vdsGroup.getId ( ) ) . stream ( ) . filter ( AffinityGroup :: isEnforcing ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
public void shouldCheckIfClusterCanBeUpgraded ( ) { createCommandWithDefaultCluster ( ) ; cpuExists ( ) ; architectureIsUpdatable ( ) ; cmd.getCluster ( ) . setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 1 ) ) . isUpgradePossible ( org.mockito.Matchers.anyList ( ) , org.mockito.Matchers.anyList ( ) ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 0 ) ) . isUpgradeDone ( org.mockito.Matchers.anyList ( ) ) ; }

Target:
public void shouldCheckIfClusterCanBeUpgraded ( ) { createCommandWithDefaultCluster ( ) ; cpuExists ( ) ; architectureIsUpdatable ( ) ; cmd.getCluster ( ) . setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; initAndAssertValidation ( true ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 1 ) ) . isUpgradePossible ( org.mockito.Matchers.anyList ( ) , org.mockito.Matchers.anyList ( ) ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 0 ) ) . isUpgradeDone ( org.mockito.Matchers.anyList ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.storage_pool_iso_map 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:
private java.util.Map < org.ovirt.engine.core.common.businessentities.network.Network , java.util.Set < org.ovirt.engine.core.compat.Guid > > getBackendCollection ( ) { try { org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( providerId ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = runQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , parameters ) ; if ( ! ( result.getSucceeded ( ) ) ) { backendFailure ( result.getExceptionString ( ) ) ; } return result.getReturnValue ( ) ; } catch ( java.lang.Exception exception ) { return handleError ( exception , false ) ; } }

Target:
private java.util.Map < org.ovirt.engine.core.common.businessentities.network.Network , java.util.Set < org.ovirt.engine.core.compat.Guid > > getBackendCollection ( ) { try { org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( providerId ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = runQuery ( QueryType.GetAllExternalNetworksOnProvider , parameters ) ; if ( ! ( result.getSucceeded ( ) ) ) { backendFailure ( result.getExceptionString ( ) ) ; } return result.getReturnValue ( ) ; } catch ( java.lang.Exception exception ) { return handleError ( exception , false ) ; } }
Source:
protected void mockFenceActionResults ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult [ ] results ) { org.mockito.stubbing.OngoingStubbing < org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult > fenceMethodResult = org.mockito.Mockito.when ( fenceAgentExecutor.fence ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent.class ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result : results ) { fenceMethodResult = fenceMethodResult.thenReturn ( result ) ; } }

Target:
protected void mockFenceActionResults ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult [ ] results ) { org.mockito.stubbing.OngoingStubbing < org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult > fenceMethodResult = org.mockito.Mockito.when ( fenceAgentExecutor.fence ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent.class ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result : results ) { fenceMethodResult = fenceMethodResult.thenReturn ( result ) ; } }
Source:
public void canSetNumaPinning ( ) { paramNumaNodes.clear ( ) ; paramNumaNodes.add ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ; mockCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massSaveNumaNode ( org.mockito.Matchers.eq ( paramNumaNodes ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
public void canSetNumaPinning ( ) { paramNumaNodes.clear ( ) ; paramNumaNodes.add ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ; mockCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massSaveNumaNode ( org.mockito.ArgumentMatchers.eq ( paramNumaNodes ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
protected boolean validateVdsCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > groups = org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroupDAO ( ) . getAllForStoragePool ( getParameters ( ) . getStoragePoolId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup group : groups ) { if ( group.getId ( ) . equals ( getParameters ( ) . getVdsGroupId ( ) ) ) { return true ; } } return failCanDoAction ( VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID ) ; }

Target:
protected boolean validateVdsCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > groups = org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroupDAO ( ) . getAllForStoragePool ( getParameters ( ) . getStoragePoolId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup group : groups ) { if ( group.getId ( ) . equals ( getParameters ( ) . getVdsGroupId ( ) ) ) { if ( ( group.getArchitecture ( ) ) != ( getVm ( ) . getClusterArch ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_CANNOT_IMPORT_VM_ARCHITECTURE_NOT_SUPPORTED_BY_CLUSTER ) ; } return true ; } } return failCanDoAction ( VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID ) ; }
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 getVmNicList ( 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.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void setEnabled ( boolean enabled ) { decorated.setEnabled ( enabled ) ; if ( enabled ) { label.replaceClassName ( style.labelDisabled ( ) , style.labelEnabled ( ) ) ; } else { label.replaceClassName ( style.labelEnabled ( ) , style.labelDisabled ( ) ) ; } }

Target:
public void setLabelColSize ( org.gwtbootstrap3.client.ui.constants.ColumnSize size ) { label.addStyleName ( size.getCssName ( ) ) ; }
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.vdsbroker.PrepareImageReturnForXmlRpc prepareImage ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID , boolean allowIllegal ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.prepareImage ( sdID , spID , imageID , volumeID , allowIllegal ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private static void setDiskList ( org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommandTestAbstract.getDiskImageList ( ) ) { vmTemplate.getDiskList ( ) . add ( diskImage ) ; } java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImageTemplate = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommandTestAbstract.getDiskImageTempalteList ( ) ; vmTemplate.getDiskTemplateMap ( ) . putAll ( diskImageTemplate ) ; }

Target:
private static void setDiskList ( org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : org.ovirt.engine.core.bll.CommonVmPoolCommandTestAbstract.getDiskImageList ( ) ) { vmTemplate.getDiskList ( ) . add ( diskImage ) ; } java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImageTemplate = org.ovirt.engine.core.bll.CommonVmPoolCommandTestAbstract.getDiskImageTempalteList ( ) ; vmTemplate.getDiskTemplateMap ( ) . putAll ( diskImageTemplate ) ; }
Source:
private void validateDisksStatsList ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.Map < java.lang.String , java.lang.Object > xml , boolean assertNullValues ) { vdsBrokerObjectsBuilder.updateLocalDisksUsage ( vds , xml ) ; org.junit.Assert.assertNotNull ( vds.getLocalDisksUsage ( ) ) ; for ( java.lang.Long usage : vds.getLocalDisksUsage ( ) . values ( ) ) { if ( assertNullValues ) { org.junit.Assert.assertNull ( usage ) ; } else { org.junit.Assert.assertEquals ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.SIZE_FOR_DISK_STATS , usage.longValue ( ) ) ; } } }

Target:
private void validateDisksStatsList ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.Map < java.lang.String , java.lang.Object > xml , boolean assertNullValues ) { vdsBrokerObjectsBuilder.updateLocalDisksUsage ( vds , xml ) ; org.junit.jupiter.api.Assertions.assertNotNull ( vds.getLocalDisksUsage ( ) ) ; for ( java.lang.Long usage : vds.getLocalDisksUsage ( ) . values ( ) ) { if ( assertNullValues ) { org.junit.jupiter.api.Assertions.assertNull ( usage ) ; } else { org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.SIZE_FOR_DISK_STATS , usage.longValue ( ) ) ; } } }
Source:
public void process ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { processIncoming ( ) ; processHeartbeat ( ) ; processOutgoing ( ) ; }

Target:
public void process ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { processIncoming ( ) ; if ( this . closing.get ( ) ) { return ; } processHeartbeat ( ) ; if ( this . closing.get ( ) ) { return ; } processOutgoing ( ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isReadOnlyPropertyCompatibleWithInterface ( ) { if ( java.lang.Boolean.TRUE.equals ( disk.getReadOnly ( ) ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface = disk.getDiskInterface ( ) ; if ( diskInterface == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.IDE ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR , java.lang.String.format ( "$interface %1$s" , diskInterface ) ) ; } if ( disk.isScsiPassthrough ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.SCSI_PASSTHROUGH_IS_NOT_SUPPORTED_FOR_READ_ONLY_DISK ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isReadOnlyPropertyCompatibleWithInterface ( ) { if ( java.lang.Boolean.TRUE.equals ( disk.getReadOnly ( ) ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface = disk.getDiskInterface ( ) ; if ( diskInterface == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.IDE ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR , java.lang.String.format ( "$interface %1$s" , diskInterface ) ) ; } if ( disk.isScsiPassthrough ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.SCSI_PASSTHROUGH_IS_NOT_SUPPORTED_FOR_READ_ONLY_DISK ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.vdsbroker.VmsMonitoring getVmsMonitoring ( org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher , long fetchTime ) { return new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( vdsManager , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , auditLogDirector , fetchTime , isTimeToRefreshStatistics ( ) ) ; }

Target:
public void poll ( ) { if ( vdsManager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = getVmsFetcher ( ) ; long fetchTime = java.lang.System.nanoTime ( ) ; if ( fetcher.fetch ( ) ) { getVmsMonitoring ( fetchTime ) . perform ( fetcher.getChangedVms ( ) ) ; processDevices ( fetcher.getVdsmVms ( ) . stream ( ) . map ( VmInternalData :: getVmDynamic ) , fetchTime ) ; } else { org.ovirt.engine.core.vdsbroker.PollVmStatsRefresher.log.info ( "Failed to fetch vms info for host '{}' - skipping VMs monitoring." , vdsManager.getVdsName ( ) ) ; } } }
Source:
private static void mapAgentToPm ( org.ovirt.engine.core.common.businessentities.FenceAgent primaryAgentEngine , org.ovirt.engine.api.model.PowerManagement pm ) { pm.setType ( primaryAgentEngine.getType ( ) ) ; pm.setAddress ( primaryAgentEngine.getIp ( ) ) ; pm.setUsername ( primaryAgentEngine.getUser ( ) ) ; if ( ( primaryAgentEngine.getOptionsMap ( ) ) != null ) { pm.setOptions ( org.ovirt.engine.api.restapi.types.HostMapper.map ( primaryAgentEngine.getOptionsMap ( ) , null ) ) ; } }

Target:
private static void mapAgentToPm ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent primaryAgentEngine , org.ovirt.engine.api.model.PowerManagement pm ) { pm.setType ( primaryAgentEngine.getType ( ) ) ; pm.setAddress ( primaryAgentEngine.getIp ( ) ) ; pm.setUsername ( primaryAgentEngine.getUser ( ) ) ; if ( ( primaryAgentEngine.getOptionsMap ( ) ) != null ) { pm.setOptions ( org.ovirt.engine.api.restapi.types.HostMapper.map ( primaryAgentEngine.getOptionsMap ( ) , null ) ) ; } }
Source:
public boolean existsPluggedInterfaceWithSameMac ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface interfaceToPlug ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vmNetworkIntrefaces = getVmNetworkInterfaceDao ( ) . getPluggedForMac ( interfaceToPlug.getMacAddress ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmNetworkInterface : vmNetworkIntrefaces ) { if ( ! ( interfaceToPlug.getId ( ) . equals ( vmNetworkInterface.getId ( ) ) ) ) { return true ; } } return false ; }

Target:
public boolean existsPluggedInterfaceWithSameMac ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface interfaceToPlug ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > vmNetworkIntrefaces = getVmNicDao ( ) . getPluggedForMac ( interfaceToPlug.getMacAddress ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNic vmNetworkInterface : vmNetworkIntrefaces ) { if ( ! ( interfaceToPlug.getId ( ) . equals ( vmNetworkInterface.getId ( ) ) ) ) { return true ; } } return false ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getVdsGroup ( ) ; if ( cluster == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID ) ; return false ; } if ( ! ( cluster.supportsGlusterService ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER ) ; return false ; } return validateBricks ( volume ) ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getVdsGroup ( ) ; if ( cluster == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID ) ; return false ; } if ( ! ( cluster.supportsGlusterService ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER ) ; return false ; } if ( volumeNameExists ( volume.getName ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NAME_ALREADY_EXISTS ) ; return false ; } return validateBricks ( volume ) ; }
Source:
static void verifyModelSpecific ( org.ovirt.engine.api.model.CdRom model , int index ) { assertEquals ( Guid.Empty.toString ( ) , model.getId ( ) ) ; assertTrue ( model.isSetVm ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.AbstractBackendCdRomsResourceTest.PARENT_ID.toString ( ) , model.getVm ( ) . getId ( ) ) ; assertTrue ( model.isSetFile ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.AbstractBackendCdRomsResourceTest.ISO_PATH , model.getFile ( ) . getId ( ) ) ; }

Target:
static void verifyModelWithIso ( org.ovirt.engine.api.model.CdRom model , java.lang.String isoPath ) { assertEquals ( Guid.Empty.toString ( ) , model.getId ( ) ) ; assertTrue ( model.isSetVm ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.AbstractBackendCdRomsResourceTest.PARENT_ID.toString ( ) , model.getVm ( ) . getId ( ) ) ; assertTrue ( model.isSetFile ( ) ) ; assertEquals ( isoPath , model.getFile ( ) . getId ( ) ) ; }
Source:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getParameters ( ) . getImagesParameters ( ) ) { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getBackend ( ) . endAction ( ActionType.CopyImageGroup , p , org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }

Target:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.ActionParametersBase p : org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getParameters ( ) . getImagesParameters ( ) ) { org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getBackend ( ) . endAction ( ActionType.CopyImageGroup , p , org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetworkAttachment , org.ovirt.engine.core.common.action.RemoveNetworkAttachmentParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.remove ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentResourceTest.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 { setUpEntityQueryExpectations ( 1 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetworkAttachment , org.ovirt.engine.core.common.action.RemoveNetworkAttachmentParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.remove ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void testGetUserID ( ) { org.ovirt.engine.core.common.businessentities.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.DbUser.class ) ; org.mockito.Mockito.when ( user.getId ( ) ) . thenReturn ( Guid.EVERYONE ) ; java.lang.String session = org.jgroups.util.UUID.randomUUID ( ) . toString ( ) ; org.ovirt.engine.core.bll.session.SessionDataContainer.getInstance ( ) . setUser ( session , user ) ; org.ovirt.engine.core.common.queries.VdcQueryParametersBase params = new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( session ) ; params.setRefresh ( false ) ; org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery query = new org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery ( params ) ; org.junit.Assert.assertEquals ( "wrong guid" , Guid.EVERYONE , query.getUserID ( ) ) ; }

Target:
public void testGetUserID ( ) { org.ovirt.engine.core.common.businessentities.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.DbUser.class ) ; org.mockito.Mockito.when ( user.getId ( ) ) . thenReturn ( Guid.EVERYONE ) ; java.lang.String session = org.jgroups.util.UUID.randomUUID ( ) . toString ( ) ; org.ovirt.engine.core.bll.aaa.SessionDataContainer.getInstance ( ) . setUser ( session , user ) ; org.ovirt.engine.core.common.queries.VdcQueryParametersBase params = new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( session ) ; params.setRefresh ( false ) ; org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery query = new org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery ( params ) ; org.junit.Assert.assertEquals ( "wrong guid" , Guid.EVERYONE , query.getUserID ( ) ) ; }
Source:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VDSGroup getByName ( java.lang.String name ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vds_group_name" , name ) ; return ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( org.ovirt.engine.core.dal.dbbroker.DbFacadeUtils.asSingleResult ( getCallsHandler ( ) . executeReadList ( "GetVdsGroupByVdsGroupName" , org.ovirt.engine.core.dao.VdsGroupDAODbFacadeImpl.VdsGroupRowMapper.instance , parameterSource ) ) ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.VDSGroup getByName ( java.lang.String name ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vds_group_name" , name ) . addValue ( "is_case_sensitive" , true ) ; return ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( org.ovirt.engine.core.dal.dbbroker.DbFacadeUtils.asSingleResult ( getCallsHandler ( ) . executeReadList ( "GetVdsGroupByVdsGroupName" , org.ovirt.engine.core.dao.VdsGroupDAODbFacadeImpl.VdsGroupRowMapper.instance , parameterSource ) ) ) ) ; }
Source:
public static java.lang.String getRandomNumWithHighValue ( int min , int high ) { java.lang.String HighValue ; int Low = 1 ; if ( min > 1 ) { Low = min ; } int High = high ; HighValue = java.lang.String.valueOf ( ( ( org.ovirt.vdsmfake.Utils.RND.nextInt ( ( High - Low ) ) ) + Low ) ) ; return HighValue ; }

Target:
public static void getLatency ( java.lang.Long latency ) { java.lang.Long innerLatency ; if ( latency != ( ( long ) ( org.ovirt.vdsmfake.Utils.minimum ) ) ) { innerLatency = latency ; } else { innerLatency = org.ovirt.vdsmfake.Utils.getDelayFromXml ( ) ; } try { java.util.concurrent.TimeUnit.MILLISECONDS.sleep ( innerLatency ) ; } catch ( java.lang.InterruptedException e ) { org.ovirt.vdsmfake.Utils.log.error ( "failed to to run getLatency error is:{}" , e ) ; } }