auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void initializeCommand ( org.ovirt.engine.core.common.businessentities.ImageOperation operation ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.MoveOrCopyDiskCommandDummy ( new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( diskImageGuid , srcStorageId , destStorageId , operation ) ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isStorageDomainSpaceWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . checkImageConfiguration ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( command ) . getAllImageSnapshots ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . acquireLock ( ) ; }

Target:
public void canDoActionEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public void vmNotRunningOnHostWithBalloonEnabled ( org.ovirt.engine.core.vdsbroker.VmTestPairs data ) { initMocks ( data , false ) ; org.mockito.Mockito.when ( vdsManagerVds.isBalloonEnabled ( ) ) . thenReturn ( true ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) ) == null ) ) ; vmAnalyzer.analyze ( ) ; junit.framework.Assert.assertTrue ( vmAnalyzer.isMovedToDown ( ) ) ; }

Target:
public void vmNotRunningOnHostWithBalloonEnabled ( org.ovirt.engine.core.vdsbroker.VmTestPairs data ) { initMocks ( data , false ) ; org.mockito.Mockito.when ( vdsManagerVds.isBalloonEnabled ( ) ) . thenReturn ( true ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) ) == null ) ) ; vmAnalyzer.analyze ( ) ; org.junit.Assert.assertTrue ( vmAnalyzer.isMovedToDown ( ) ) ; }
Source:
private void scanAlignment ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameterList = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( getSelectedItems ( ) ) ) ) { parameterList.add ( new org.ovirt.engine.core.common.action.GetDiskAlignmentParameters ( disk.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.GetDiskAlignment , parameterList , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , this ) ; }

Target:
private void plug ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.HotPlugDiskToVm , createHotPlugDiskToVmParameters ( true ) , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , this ) ; }
Source:
protected void initVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setstatus ( VMStatus.PoweredDown ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( command , vmDao ) ; org.mockito.Mockito.when ( vmDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vm ) ; mockGetVmsListForDisk ( ) ; }

Target:
protected void initVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.PoweredDown ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( command , vmDao ) ; org.mockito.Mockito.when ( vmDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vm ) ; mockGetVmsListForDisk ( ) ; }
Source:
public static void GetPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void GetVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.GetVmConfigurationBySnapshotQueryParams ( snapshotSourceId ) , aQuery ) ; }
Source:
public static void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private void newPoolNameIsAlreadyTaken ( ) { org.mockito.Mockito.when ( spDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePoolList = new java.util.ArrayList < > ( ) ; storagePoolList.add ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.createStoragePool ( ) ) ; org.mockito.Mockito.when ( spDao.getByName ( org.mockito.Matchers.anyString ( ) , org.mockito.Matchers.anyBoolean ( ) ) ) . thenReturn ( new java.util.ArrayList ( storagePoolList ) ) ; }

Target:
private void newPoolNameIsAlreadyTaken ( ) { org.mockito.Mockito.when ( spDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagePoolList = new java.util.ArrayList < > ( ) ; storagePoolList.add ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.createStoragePool ( ) ) ; org.mockito.Mockito.when ( spDao.getByName ( org.mockito.Matchers.anyString ( ) , org.mockito.Matchers.anyBoolean ( ) ) ) . thenReturn ( new java.util.ArrayList ( storagePoolList ) ) ; }
Source:
public void testActivateNic ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmNicResource backendVmNicResource = ( ( org.ovirt.engine.api.restapi.resource.BackendVmNicResource ) ( resource ) ) ; setUpGetEntityExpectations ( 3 ) ; setAllContentHeaderExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } ) ) ; verifyActionResponse ( backendVmNicResource.activate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testActivateNic ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmNicResource backendVmNicResource = ( ( org.ovirt.engine.api.restapi.resource.BackendVmNicResource ) ( resource ) ) ; setUpGetEntityExpectations ( 3 ) ; setAllContentHeaderExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } ) ) ; verifyActionResponse ( backendVmNicResource.activate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Provider getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.Provider provider = control.createMock ( org.ovirt.engine.core.common.businessentities.Provider.class ) ; org.easymock.EasyMock.expect ( provider.getId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( provider.getName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( provider.getDescription ( ) ) . andReturn ( DESCRIPTIONS [ index ] ) . anyTimes ( ) ; return provider ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Provider getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.Provider provider = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Provider.class ) ; org.mockito.Mockito.when ( provider.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( provider.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( provider.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; return provider ; }
Source:
private void addVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( getVmId ( ) ) ; tempVar.setstatus ( VMStatus.ImageLocked ) ; tempVar.setvm_host ( "" ) ; tempVar.setvm_ip ( "" ) ; tempVar.setapp_list ( getParameters ( ) . getVm ( ) . getDynamicData ( ) . getapp_list ( ) ) ; getVmDynamicDAO ( ) . save ( tempVar ) ; getCompensationContext ( ) . snapshotNewEntity ( tempVar ) ; }

Target:
private void addVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( getVmId ( ) ) ; tempVar.setStatus ( VMStatus.ImageLocked ) ; tempVar.setVmHost ( "" ) ; tempVar.setVmIp ( "" ) ; tempVar.setAppList ( getParameters ( ) . getVm ( ) . getDynamicData ( ) . getAppList ( ) ) ; getVmDynamicDAO ( ) . save ( tempVar ) ; getCompensationContext ( ) . snapshotNewEntity ( tempVar ) ; }
Source:
public void completeExternalNetworkProviderConfigurationsNoNameTest ( ) { org.ovirt.engine.api.model.ExternalNetworkProviderConfigurations configurations = getExternalNetworkProviderConfigurations ( 1 ) ; configurations.getExternalNetworkProviderConfigurations ( ) . get ( 0 ) . getExternalNetworkProvider ( ) . setName ( null ) ; try { org.ovirt.engine.api.restapi.resource.BackendExternalProviderHelper.completeExternalNetworkProviderConfigurations ( resource , configurations ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , Response.Status.BAD_REQUEST.getStatusCode ( ) ) ; } }

Target:
public void completeExternalNetworkProviderConfigurationsNoNameTest ( ) { org.ovirt.engine.api.model.ExternalNetworkProviderConfigurations configurations = getExternalNetworkProviderConfigurations ( 1 ) ; configurations.getExternalNetworkProviderConfigurations ( ) . get ( 0 ) . getExternalNetworkProvider ( ) . setName ( null ) ; try { org.ovirt.engine.api.restapi.resource.BackendExternalProviderHelper.completeExternalNetworkProviderConfigurations ( resource , configurations ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , Response.Status.BAD_REQUEST.getStatusCode ( ) ) ; } }
Source:
protected void setImageStatus ( org.ovirt.engine.core.common.businessentities.ImageStatus imageStatus ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getRelevantDiskImage ( ) ; if ( diskImage != null ) { diskImage.setImageStatus ( imageStatus ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( diskImage.getImage ( ) . getId ( ) , imageStatus ) ; } }

Target:
protected void setImageStatus ( org.ovirt.engine.core.common.businessentities.ImageStatus imageStatus ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getRelevantDiskImage ( ) ; if ( ( diskImage != null ) && ( ( diskImage.getImageStatus ( ) ) != imageStatus ) ) { diskImage.setImageStatus ( imageStatus ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( diskImage.getImage ( ) . getId ( ) , imageStatus ) ; } }
Source:
private void initCommand ( ) { org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( ) ; params.setVdsId ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_ID ) ; command = new org.ovirt.engine.core.bll.StartVdsCommand ( params ) ; command.setFenceExecutor ( executor ) ; command = org.mockito.Mockito.spy ( command ) ; org.mockito.Mockito.stub ( command.getSleepBeforeFirstAttempt ( ) ) . toReturn ( 0 ) ; command.setAuditLogDirector ( auditLogDirector ) ; command.setVdsGroupId ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_CLUSTER_ID ) ; }

Target:
private void initCommand ( ) { org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( ) ; params.setVdsId ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_ID ) ; command = new org.ovirt.engine.core.bll.StartVdsCommand ( params ) ; command.setAuditLogDirector ( auditLogDirector ) ; command = org.mockito.Mockito.spy ( command ) ; org.mockito.Mockito.doReturn ( executor ) . when ( command ) . createHostFenceActionExecutor ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.FencingPolicy.class ) ) ; command.setVdsGroupId ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_CLUSTER_ID ) ; }
Source:
public static 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.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , 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:
public void testActivateNic ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmNicResource backendVmNicResource = ( ( org.ovirt.engine.api.restapi.resource.BackendVmNicResource ) ( resource ) ) ; setUpGetEntityExpectations ( 4 ) ; setGetVmQueryExpectations ( 4 ) ; setGetNetworksQueryExpectations ( 4 ) ; setGetGuestAgentQueryExpectations ( 3 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } ) ) ; verifyActionResponse ( backendVmNicResource.activate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testActivateNic ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmNicResource backendVmNicResource = ( ( org.ovirt.engine.api.restapi.resource.BackendVmNicResource ) ( resource ) ) ; setUpGetEntityExpectations ( 4 ) ; setGetVmQueryExpectations ( 4 ) ; setGetNetworksQueryExpectations ( 4 ) ; setGetGuestAgentQueryExpectations ( 3 ) ; setAllContentHeaderExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } ) ) ; verifyActionResponse ( backendVmNicResource.activate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
public void testDoGet_ExistingFile ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getPathInfo ( ) ) . thenReturn ( "/org/ovirt/engine/core/utils/branding/BrandingServletTest.class" ) ; org.mockito.Mockito.when ( mockFile.getAbsolutePath ( ) ) . thenReturn ( this . getClass ( ) . getClassLoader ( ) . getResource ( "." ) . getFile ( ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . setHeader ( org.mockito.Matchers.eq ( "ETag" ) , org.mockito.Matchers.anyString ( ) ) ; }

Target:
public void testDoGet_ExistingFile ( ) throws java.io.IOException , java.net.URISyntaxException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getPathInfo ( ) ) . thenReturn ( "/org/ovirt/engine/core/utils/branding/BrandingServletTest.class" ) ; org.mockito.Mockito.when ( mockFile.getAbsolutePath ( ) ) . thenReturn ( this . getClass ( ) . getClassLoader ( ) . getResource ( "." ) . toURI ( ) . getPath ( ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockResponse ) . setHeader ( org.mockito.Matchers.eq ( "ETag" ) , org.mockito.Matchers.anyString ( ) ) ; }
Source:
org.ovirt.engine.api.model.Group lookupGroup ( org.ovirt.engine.core.compat.Guid guid ) { java.lang.String id = guid.toString ( ) ; for ( org.ovirt.engine.core.common.businessentities.ad_groups group : getGroupsFromDomain ( ) ) { if ( group.getid ( ) . toString ( ) . equals ( id ) ) return mapAdGroup ( group ) ; } return notFound ( ) ; }

Target:
org.ovirt.engine.api.model.Group lookupGroup ( org.ovirt.engine.core.compat.Guid guid ) { java.lang.String id = guid.toString ( ) ; for ( org.ovirt.engine.core.common.businessentities.LdapGroup group : getGroupsFromDomain ( ) ) { if ( group.getid ( ) . toString ( ) . equals ( id ) ) return mapAdGroup ( group ) ; } return notFound ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc refreshStoragePool ( java.lang.String spUUID , java.lang.String msdUUID , int masterVersion ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.refreshStoragePool ( spUUID , msdUUID , masterVersion ) ; 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.irsbroker.StatusReturnForXmlRpc verifyUntrustedVolume ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.verifyUntrustedVolume ( sdID , spID , imageID , volumeID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void mapPropertiesSyntaxNullValue ( ) { org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils utils = new org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils ( ) ; java.util.Map < java.lang.String , java.lang.String > propMap = new java.util.LinkedHashMap < java.lang.String , java.lang.String > ( ) ; propMap.put ( "speed" , "1024" ) ; propMap.put ( "duplex" , null ) ; propMap.put ( "debug" , "" ) ; org.junit.Assert.assertFalse ( utils.syntaxErrorInProperties ( propMap ) ) ; }

Target:
public void mapPropertiesSyntaxNullValue ( ) { org.ovirt.engine.core.common.utils.customprop.CustomPropertiesUtils utils = new org.ovirt.engine.core.common.utils.customprop.CustomPropertiesUtils ( ) ; java.util.Map < java.lang.String , java.lang.String > propMap = new java.util.LinkedHashMap < java.lang.String , java.lang.String > ( ) ; propMap.put ( "speed" , "1024" ) ; propMap.put ( "duplex" , null ) ; propMap.put ( "debug" , "" ) ; org.junit.Assert.assertFalse ( utils.syntaxErrorInProperties ( propMap ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getSecondaryDestinations ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { long requiredMemory = ( parameters.containsKey ( org.ovirt.engine.core.bll.scheduling.policyunits.HIGH_MEMORY_LIMIT_FOR_UNDER_UTILIZED ) ) ? java.lang.Long.parseLong ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.HIGH_MEMORY_LIMIT_FOR_UNDER_UTILIZED ) ) : 0L ; return getUnderUtilizedMemoryHosts ( candidateHosts , requiredMemory , 0 ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getSecondaryDestinations ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { long requiredMemory = ( parameters.containsKey ( PolicyUnitParameter.HIGH_MEMORY_LIMIT_FOR_UNDER_UTILIZED.getDbName ( ) ) ) ? java.lang.Long.parseLong ( parameters.get ( PolicyUnitParameter.HIGH_MEMORY_LIMIT_FOR_UNDER_UTILIZED.getDbName ( ) ) ) : 0L ; return getUnderUtilizedMemoryHosts ( candidateHosts , requiredMemory , 0 ) ; }
Source:
protected boolean canDoAction ( ) { boolean result = isUserCanBeAuthenticated ( ) ; if ( ! result ) { logAutheticationFailure ( ) ; } return result ; }

Target:
protected boolean canDoAction ( ) { java.lang.String user = org.ovirt.engine.core.bll.aaa.LoginBaseCommand.getParameters ( ) . getLoginName ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( user ) ) { org.ovirt.engine.api.extensions.ExtMap authRecord = ( ( org.ovirt.engine.api.extensions.ExtMap ) ( org.ovirt.engine.core.bll.aaa.LoginBaseCommand.getParameters ( ) . getAuthRecord ( ) ) ) ; if ( authRecord != null ) { user = authRecord.get ( AuthRecord.PRINCIPAL ) ; } } java.lang.String profile = org.ovirt.engine.core.bll.aaa.LoginBaseCommand.getParameters ( ) . getProfileName ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( profile ) ) { profile = "N/A" ; } org.ovirt.engine.core.bll.aaa.LoginBaseCommand.setUserName ( java.lang.String.format ( "%s@%s" , user , profile ) ) ; boolean result = isUserCanBeAuthenticated ( ) ; if ( ! result ) { logAutheticationFailure ( ) ; } return result ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( getVm ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , VMStatus.Down ) ) ; setUpEntityQueryExpectations ( getVm ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO , org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , VMStatus.Down ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVm , org.ovirt.engine.core.common.action.VmManagementParametersBase.class , new java.lang.String [ ] { "VmStaticData.IsoPath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO } , true , true ) ) ; org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO ) ; cdrom = resource.update ( cdrom ) ; assertTrue ( cdrom.isSetFile ( ) ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( getVm ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , VMStatus.Down ) ) ; setUpEntityQueryExpectations ( getVm ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO , org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO , VMStatus.Down ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVm , org.ovirt.engine.core.common.action.VmManagementParametersBase.class , new java.lang.String [ ] { "VmStaticData.IsoPath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO } , true , true ) ) ; org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO ) ; cdrom = resource.update ( cdrom ) ; assertTrue ( cdrom.isSetFile ( ) ) ; }
Source:
private void addManagementNetworkToPool ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setName ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.DefaultManagementNetwork ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = new java.util.ArrayList < > ( ) ; networks.add ( network ) ; org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( networks ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network createNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( networkId ) ; return network ; }
Source:
public org.ovirt.engine.sdk.decorators.DataCenterQuota add ( org.ovirt.engine.sdk.decorators.Quota quota ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; return getProxy ( ) . add ( url , quota , org.ovirt.engine.sdk.entities.Quota.class , org.ovirt.engine.sdk.decorators.DataCenterQuota.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.DataCenterQuota add ( org.ovirt.engine.sdk.decorators.Quota quota ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , quota , org.ovirt.engine.sdk.entities.Quota.class , org.ovirt.engine.sdk.decorators.DataCenterQuota.class , headers ) ; }
Source:
public org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message execute ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message message ) { return new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . connected ( ) . withHeader ( "session" , java.util.UUID.randomUUID ( ) . toString ( ) ) ; }

Target:
public org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message execute ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message message ) { java.lang.String heartbeats = message.getHeaders ( ) . get ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_HEART_BEAT ) ; org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message response = new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . connected ( ) . withHeader ( "session" , java.util.UUID.randomUUID ( ) . toString ( ) ) ; if ( heartbeats != null ) { response.withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_HEART_BEAT , org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.swapHeartbeat ( heartbeats ) ) ; } return response ; }
Source:
public void testDefaultRouteNetworkCannotBeExternal ( ) { networkCluster.setDefaultRoute ( true ) ; setNetworkExternal ( network , true ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DEFAULT_ROUTE_NETWORK_CANNOT_BE_EXTERNAL ; org.junit.Assert.assertThat ( validator.defaultRouteNetworkCannotBeExternal ( network ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( message ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.hasItem ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.NETWORK_NAME_REPLACEMENT ) ) ) ) ; }

Target:
public void testDefaultRouteNetworkCannotBeExternal ( ) { networkCluster.setDefaultRoute ( true ) ; setNetworkExternal ( network , true ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DEFAULT_ROUTE_NETWORK_CANNOT_BE_EXTERNAL ; org.hamcrest.MatcherAssert.assertThat ( validator.defaultRouteNetworkCannotBeExternal ( network ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( message ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.hasItem ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.NETWORK_NAME_REPLACEMENT ) ) ) ) ; }
Source:
private void addInterfaceToDb ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmNetworkInterface ) { org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getVmNetworkInterfaceDao ( ) . save ( vmNetworkInterface ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getDbFacade ( ) . getVmNetworkStatisticsDao ( ) . save ( vmNetworkInterface.getStatistics ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface.getStatistics ( ) ) ; }

Target:
private void addInterfaceToDb ( org.ovirt.engine.core.common.businessentities.network.VmNic vmNetworkInterface ) { org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getVmNicDao ( ) . save ( vmNetworkInterface ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getDbFacade ( ) . getVmNetworkStatisticsDao ( ) . save ( vmNetworkInterface.getStatistics ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface.getStatistics ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( target ) ) ; boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( returnValue ) ) ; diskModel.getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . shareableDiskNotSupported ( ) ) ; diskModel.getIsShareable ( ) . setIsChangable ( isShareableDiskEnabled ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImageBase > presets = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImageBase > ) ( returnValue ) ) ; diskModel.getPreset ( ) . setItems ( presets ) ; diskModel.getPreset ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( presets ) ) ; }
Source:
public void shouldCreateNiceJsonValidationResult ( ) throws java.io.IOException { invalidVM.setCpuPinning ( "i am pinned" ) ; invalidVM.setDedicatedVmForVdsList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; invalidVM.setMigrationSupport ( org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ) ; invalidVM.setId ( Guid.Empty ) ; newHost1.setHostOs ( "invalid os" ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = validator.isUpgradePossible ( java.util.Arrays.asList ( newHost1 ) , java.util.Arrays.asList ( invalidVM ) ) ; org.assertj.core.api.Assertions.assertThat ( validationResult.getVariableReplacements ( ) . get ( 0 ) ) . contains ( "VM_CPUS_PINNED" , "VM_PINNED_TO_HOSTS" , "HOST_INVALID_OS" ) ; }

Target:
public void shouldCreateNiceJsonValidationResult ( ) throws java.io.IOException { invalidVM.setCpuPinning ( "i am pinned" ) ; invalidVM.setDedicatedVmForVdsList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; invalidVM.setMigrationSupport ( org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ) ; invalidVM.setId ( Guid.Empty ) ; newHost1.setHostOs ( "invalid os" ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = validator.isUpgradePossible ( java.util.Arrays.asList ( newHost1 ) , java.util.Arrays.asList ( invalidVM ) ) ; org.assertj.core.api.Assertions.assertThat ( validationResult.getVariableReplacements ( ) . get ( 0 ) ) . contains ( "VM_CPUS_PINNED" , "VM_NOT_MIGRATABLE" , "HOST_INVALID_OS" ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc migrateStatus ( java.lang.String vmId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.getMigrationStatus" ) . withParameter ( "vmID" , vmId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusReturnForXmlRpc migrateStatus ( java.lang.String vmId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.getMigrationStatus" ) . withParameter ( "vmID" , vmId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "response" ) . withResponseType ( java.lang.Long.class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusReturnForXmlRpc ( response ) ; }
Source:
private void storageDomain_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain selectedStorage = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getStorageDomain ( ) . getSelectedItem ( ) ) ) ; if ( selectedStorage != null ) { updateVolumeType ( selectedStorage.getStorageType ( ) ) ; } updateQuota ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) ) ; }

Target:
private void storageDomain_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain selectedStorage = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getStorageDomain ( ) . getSelectedItem ( ) ) ) ; if ( selectedStorage != null ) { updateVolumeType ( selectedStorage.getStorageType ( ) ) ; updateWipeAfterDelete ( selectedStorage.getStorageType ( ) ) ; } updateQuota ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { PARENT_ID , GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { PARENT_ID , GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.deprecatedRemove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
private boolean updateImageParametersRequiringVmDownRequested ( ) { if ( ( getOldDisk ( ) . getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { return false ; } org.ovirt.engine.core.compat.Guid oldQuotaId = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getOldDisk ( ) ) ) . getQuotaId ( ) ; return ! ( java.util.Objects.equals ( oldQuotaId , getQuotaId ( ) ) ) ; }

Target:
private boolean updateImageParametersRequiringVmDownRequested ( ) { if ( getOldDisk ( ) . getDiskStorageType ( ) . isInternal ( ) ) { return false ; } org.ovirt.engine.core.compat.Guid oldQuotaId = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getOldDisk ( ) ) ) . getQuotaId ( ) ; return ! ( java.util.Objects.equals ( oldQuotaId , getQuotaId ( ) ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > createDiskDummiesForSpaceValidations ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > dummies = new java.util.ArrayList ( disksList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : disksList ) { org.ovirt.engine.core.compat.Guid targetSdId = imageToDestinationDomainMap.get ( image.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.DiskImage dummy = org.ovirt.engine.core.bll.ImagesHandler.createDiskImageWithExcessData ( image , targetSdId ) ; dummies.add ( dummy ) ; } return dummies ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > createDiskDummiesForSpaceValidations ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > dummies = new java.util.ArrayList ( disksList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : disksList ) { org.ovirt.engine.core.compat.Guid targetSdId = imageToDestinationDomainMap.get ( image.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage dummy = org.ovirt.engine.core.bll.ImagesHandler.createDiskImageWithExcessData ( image , targetSdId ) ; dummies.add ( dummy ) ; } return dummies ; }
Source:
protected org.ovirt.engine.core.common.queries.VdcQueryParametersBase createQueryParams ( java.lang.String sessionId , boolean isFiltered ) { org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams = new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ; queryParams.setSessionId ( sessionId ) ; queryParams.setHttpSessionId ( sessionId ) ; queryParams.setFiltered ( isFiltered ) ; return queryParams ; }

Target:
protected java.lang.Object runPublicQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , javax.servlet.http.HttpServletRequest request ) { initQueryParams ( queryParams , request ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.RunPublicQuery ( queryType , queryParams ) ; if ( result.getSucceeded ( ) ) { return result.getReturnValue ( ) ; } else { return null ; } }
Source:
public void tJava_3_onSubJobError ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.sampletimekeepingjob_3_2.SampleTimeKeepingJob.TalendException { resumeUtil.addLog ( "SYSTEM_LOG" , ( "NODE:" + errorComponent ) , "" , ( ( java.lang.Thread.currentThread ( ) . getId ( ) ) + "" ) , "FATAL" , "" , exception.getMessage ( ) , ovirt_engine_dwh.sampletimekeepingjob_3_2.ResumeUtil.getExceptionStackTrace ( exception ) , "" ) ; }

Target:
public void tWarn_1_error ( java.lang.Exception exception , java.lang.String errorComponent , final java.util.Map < java.lang.String , java.lang.Object > globalMap ) throws ovirt_engine_dwh.sampletimekeepingjob_3_2.SampleTimeKeepingJob.TalendException { end_Hash.put ( "tWarn_1" , java.lang.System.currentTimeMillis ( ) ) ; ( ( java.util.Map ) ( threadLocal.get ( ) ) ) . put ( "status" , "failure" ) ; tWarn_1_onSubJobError ( exception , errorComponent , globalMap ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotplugMemory ( java.util.Map info ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.hotplugMemory" ) . withParameter ( "vmID" , getVmId ( info ) ) . withParameter ( "params" , info ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn hotplugMemory ( java.util.Map info ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.hotplugMemory" ) . withParameter ( "vmID" , getVmId ( info ) ) . withParameter ( "params" , info ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , parentParameters , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , parentParameters.getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }

Target:
protected void startPollingAsyncTasks ( java.util.Collection < org.ovirt.engine.core.compat.Guid > taskIds ) { for ( org.ovirt.engine.core.compat.Guid taskID : taskIds ) { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.startPollingTask ( taskID ) ; } }
Source:
private double getVdsMemLimit ( org.ovirt.engine.core.common.businessentities.VDS curVds ) { int computedMemoryOverCommit = ( ( curVds.getVmCount ( ) ) == 0 ) ? 100 : curVds.getMaxVdsMemoryOverCommit ( ) ; return ( computedMemoryOverCommit * ( curVds.getPhysicalMemMb ( ) ) ) / 100.0 ; }

Target:
public boolean hasOvercommitMemoryToRunVM ( org.ovirt.engine.core.common.businessentities.VDS curVds , org.ovirt.engine.core.common.businessentities.VM vm ) { double vmMemRequired = ( vm.getMemSizeMb ( ) ) + ( curVds.getGuestOverhead ( ) ) ; double vdsMemLimit = curVds.getMaxSchedulingMemory ( ) ; org.ovirt.engine.core.bll.scheduling.SlaValidator.log.debug ( "hasOvercommitMemoryToRunVM: host '{}'; max scheduling memory : MB; required memory is MB; Guest overhead MB" , curVds.getName ( ) , vdsMemLimit , vmMemRequired , curVds.getGuestOverhead ( ) ) ; org.ovirt.engine.core.bll.scheduling.SlaValidator.log.debug ( "{} <= ??? {}" , vmMemRequired , vdsMemLimit ) ; return vmMemRequired <= vdsMemLimit ; }