auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void decreasePendingVms ( org.ovirt.engine.core.compat.Guid vdsId , int numOfCpus , int minAllocatedMem , java.lang.String vmName ) { org.ovirt.engine.core.bll.VmHandler.getVdsDynamicDao ( ) . updatePartialVdsDynamicCalc ( vdsId , 0 , ( - numOfCpus ) , ( - minAllocatedMem ) , 0 , 0 ) ; org.ovirt.engine.core.bll.VmHandler.log.debug ( "Decreasing vds '{}' pending vcpu count by and vmem size by (Vm '{}')" , vdsId , numOfCpus , minAllocatedMem , vmName ) ; }

Target:
private static void decreasePendingResources ( org.ovirt.engine.core.compat.Guid vdsId , int numOfCpus , int minAllocatedMem , java.lang.String vmName ) { org.ovirt.engine.core.bll.VmHandler.getVdsDynamicDao ( ) . updatePartialVdsDynamicCalc ( vdsId , 0 , ( - numOfCpus ) , ( - minAllocatedMem ) , 0 , 0 ) ; org.ovirt.engine.core.bll.VmHandler.log.debug ( "Decreasing vds '{}' pending vcpu count by and vmem size by (Vm '{}')" , vdsId , numOfCpus , minAllocatedMem , vmName ) ; }
Source:
public void getDiskList ( 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.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getTemplateNicList ( 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.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM createVM ( java.lang.String vmName , java.lang.String networkName , boolean pluggedInterface ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setName ( vmName ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmIface = createNewViewableInterface ( pluggedInterface ) ; vmIface.setVmId ( vm.getId ( ) ) ; vmIface.setNetworkName ( networkName ) ; vm.getInterfaces ( ) . add ( vmIface ) ; return vm ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VM createVM ( java.lang.String vmName , java.lang.String networkName , boolean pluggedInterface ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setName ( vmName ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmIface = org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.createNewViewableInterface ( pluggedInterface ) ; vmIface.setVmId ( vm.getId ( ) ) ; vmIface.setNetworkName ( networkName ) ; vm.getInterfaces ( ) . add ( vmIface ) ; return vm ; }
Source:
protected void initSoundCard ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isSoundcardEnabled ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) , id ) ; }

Target:
private void setSelectedOSTypeById ( int osId ) { for ( java.lang.Integer osIdList : getModel ( ) . getOSType ( ) . getItems ( ) ) { if ( ( osIdList.intValue ( ) ) == osId ) { getModel ( ) . getOSType ( ) . setSelectedItem ( osIdList ) ; break ; } } }
Source:
private void setUpDAOMocks ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacadeMock = getDbFacadeMockInstance ( ) ; snapshotDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.SnapshotDao.class ) ; org.mockito.Mockito.when ( dbFacadeMock.getSnapshotDao ( ) ) . thenReturn ( snapshotDaoMock ) ; org.mockito.Mockito.when ( snapshotDaoMock.getAll ( vmId , getUser ( ) . getId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( java.util.Arrays.asList ( snapshot ) ) ; }

Target:
private void setUpDaoMocks ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacadeMock = getDbFacadeMockInstance ( ) ; snapshotDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.SnapshotDao.class ) ; org.mockito.Mockito.when ( dbFacadeMock.getSnapshotDao ( ) ) . thenReturn ( snapshotDaoMock ) ; org.mockito.Mockito.when ( snapshotDaoMock.getAll ( vmId , getUser ( ) . getId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( java.util.Arrays.asList ( snapshot ) ) ; }
Source:
private boolean changesAreClusterCompatible ( ) { if ( ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) == false ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.nonVmNetwork ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; return false ; } } return true ; }

Target:
private boolean changesAreClusterCompatible ( ) { if ( ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) == false ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.nonVmNetwork ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_NOT_SUPPORTED_FOR_POOL_LEVEL ) ; return false ; } } return true ; }
Source:
public void testList ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpGetEntityExpectations ( QueryType.GetDbUserByUserId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , getUserByIdx ( 1 ) , true ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }

Target:
public void testList ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpGetEntityExpectations ( QueryType.GetAnyDbUserByUserId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , getUserByIdx ( 1 ) , true ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }
Source:
public static void getVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , 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.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void canDoActionSucceedsWhenHasPeersThrowsException ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterUtil.getPeers ( org.mockito.Matchers.any ( org.ovirt.engine.core.utils.ssh.SSHClient.class ) ) ) . thenThrow ( new java.lang.RuntimeException ( ) ) ; org.junit.Assert.assertTrue ( commandMock.canDoAction ( ) ) ; }

Target:
public void canDoActionSucceedsWhenHasPeersThrowsException ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterUtil.getPeers ( org.mockito.Matchers.any ( org.ovirt.engine.core.bll.utils.EngineSSHClient.class ) ) ) . thenThrow ( new java.lang.RuntimeException ( ) ) ; org.junit.Assert.assertTrue ( commandMock.canDoAction ( ) ) ; }
Source:
public static void isVirtioScsiEnabledForVm ( 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 ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected void updateExistingEntity ( ) { existingEntity.setGlusterVersion ( new org.ovirt.engine.core.compat.RpmVersion ( "glusterfs-3.4.0.34.1u2rhs-1.el6rhs" ) ) ; existingEntity.setLibrbdVersion ( new org.ovirt.engine.core.compat.RpmVersion ( "librbd1-0.80.9-1.fc21.x86_64_updated" ) ) ; existingEntity.getReportedDnsResolverConfiguration ( ) . setNameServers ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "1.1.1.1" ) ) ) ; }

Target:
public void testUpdateDnsResolverConfiguration ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic before = dao.get ( getExistingEntityId ( ) ) ; before.getReportedDnsResolverConfiguration ( ) . setNameServers ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "1.1.1.1" ) ) ) ; dao.updateDnsResolverConfiguration ( before.getId ( ) , before.getReportedDnsResolverConfiguration ( ) ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic after = dao.get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertEquals ( before.getReportedDnsResolverConfiguration ( ) , after.getReportedDnsResolverConfiguration ( ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkLabelsByHostNicId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.nicId } , getEntityList ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetNetworkLabelsByHostNicId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.nicId } , getEntityList ( ) , failure ) ; }
Source:
public static void getStorageDomainList ( 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.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public org.ovirt.engine.sdk.decorators.Host update ( java.lang.Boolean async , java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . add ( "Correlation-Id" , correlationId ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . add ( "async" , async , UrlParameterType.MATRIX ) . build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Host.class , org.ovirt.engine.sdk.decorators.Host.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Host update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Host.class , org.ovirt.engine.sdk.decorators.Host.class , headers ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DataCenter dataCenter ) { validateParameters ( dataCenter , "name" , "storageType" ) ; validateEnums ( org.ovirt.engine.api.model.DataCenter.class , dataCenter ) ; validateEnum ( org.ovirt.engine.api.model.StorageType.class , dataCenter.getStorageType ( ) . toUpperCase ( ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool entity = map ( dataCenter ) ; return performCreate ( VdcActionType.AddEmptyStoragePool , new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DataCenter dataCenter ) { validateParameters ( dataCenter , "name" , "storageType" ) ; validateEnums ( org.ovirt.engine.api.model.DataCenter.class , dataCenter ) ; validateEnum ( org.ovirt.engine.api.model.StorageType.class , dataCenter.getStorageType ( ) . toUpperCase ( ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool entity = map ( dataCenter ) ; return performCreate ( VdcActionType.AddEmptyStoragePool , new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
protected void endWithFailure ( ) { org.ovirt.engine.core.bll.HibernateVmCommand.revertTasks ( ) ; if ( ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getRunOnVds ( ) ) != null ) { org.ovirt.engine.core.bll.HibernateVmCommand.getSnapshotDAO ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.HibernateVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.HibernateVmCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.HibernateVmCommand.log.warn ( "VM '{}' doesn't have 'run_on_vds' value - not clearing 'hibernation_vol_handle' info." , org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getName ( ) ) ; org.ovirt.engine.core.bll.HibernateVmCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; } }

Target:
protected void endWithFailure ( ) { org.ovirt.engine.core.bll.HibernateVmCommand.endActionOnDisks ( ) ; org.ovirt.engine.core.bll.HibernateVmCommand.revertTasks ( ) ; if ( ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getRunOnVds ( ) ) != null ) { org.ovirt.engine.core.bll.HibernateVmCommand.getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.HibernateVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.HibernateVmCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.HibernateVmCommand.log.warn ( "VM '{}' doesn't have 'run_on_vds' value - not clearing 'hibernation_vol_handle' info." , org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getName ( ) ) ; org.ovirt.engine.core.bll.HibernateVmCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; } }
Source:
public void tearDown ( ) throws java.lang.Exception { org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.atLeastOnce ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationStartedEvent ( mockAsyncQuery.getModel ( ) ) ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.atLeastOnce ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( mockAsyncQuery.getModel ( ) ) ) ; }

Target:
public void tearDown ( ) throws java.lang.Exception { org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.atLeastOnce ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationStartedEvent ( mockAsyncQuery.getModel ( ) ) ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.never ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( mockAsyncQuery.getModel ( ) , true , true ) ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.never ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( mockAsyncQuery.getModel ( ) , true , false ) ) ; }
Source:
public void onSucceeded ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onSucceeded ( cmdId , childCmdIds ) ; log.info ( "Disk has been successfully deleted from Cinder. ID: {}" , getDiskId ( ) ) ; if ( getCommand ( ) . getParameters ( ) . getShouldBeLogged ( ) ) { new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( getCommand ( ) , AuditLogType.USER_FINISHED_REMOVE_DISK ) ; } getCommand ( ) . removeDiskFromDb ( ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getDiskId ( ) { return getCommand ( ) . getParameters ( ) . getRemovedVolume ( ) . getImageId ( ) ; }
Source:
public void testRefreshStatus ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( true ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepStatusDetail ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.Matchers.any ( java.util.List.class ) ) ; }

Target:
public void testRefreshStatus ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( true ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionStatus ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.Matchers.any ( java.util.List.class ) ) ; }
Source:
private void auditLogForNoMetadataDescriptionUpdate ( org.ovirt.engine.core.common.AuditLogType auditLogType , org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogableBase = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; auditLogableBase.addCustomValue ( "DataCenterName" , org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) . getName ( ) ) ; auditLogableBase.addCustomValue ( "StorageDomainName" , storageDomain.getName ( ) ) ; auditLogableBase.addCustomValue ( "DiskName" , diskImage.getDiskAlias ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( auditLogableBase , auditLogType ) ; }

Target:
private void auditLogForNoMetadataDescriptionUpdate ( org.ovirt.engine.core.common.AuditLogType auditLogType , org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogableBase = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; auditLogableBase.addCustomValue ( "DataCenterName" , org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) . getName ( ) ) ; auditLogableBase.addCustomValue ( "StorageDomainName" , storageDomain.getName ( ) ) ; auditLogableBase.addCustomValue ( "DiskName" , diskImage.getDiskAlias ( ) ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( auditLogableBase , auditLogType ) ; }
Source:
private static java.util.List < org.ovirt.engine.api.extensions.ExtMap > flatGroups ( org.ovirt.engine.api.extensions.ExtMap entity , org.ovirt.engine.api.extensions.ExtKey key , java.util.List < org.ovirt.engine.api.extensions.ExtMap > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : entity.< java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > > get ( key , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { accumulator.add ( group ) ; org.ovirt.engine.core.bll.aaa.DirectoryUtils.flatGroups ( group , GroupRecord.GROUPS , accumulator ) ; } return accumulator ; }

Target:
private static void flatGroups ( org.ovirt.engine.api.extensions.ExtMap entity , org.ovirt.engine.api.extensions.ExtKey key , java.util.Map < java.lang.String , org.ovirt.engine.api.extensions.ExtMap > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : entity.< java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > > get ( key , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { if ( ! ( accumulator.containsKey ( group.< java.lang.String > get ( GroupRecord.ID ) ) ) ) { accumulator.put ( group.< java.lang.String > get ( GroupRecord.ID ) , group ) ; org.ovirt.engine.core.bll.aaa.DirectoryUtils.flatGroups ( group , GroupRecord.GROUPS , accumulator ) ; } } }
Source:
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.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; return getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }

Target:
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.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }
Source:
private static < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > boolean isNameAndIdIncoherent ( org.ovirt.engine.core.compat.Guid id , java.lang.String name , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { T entityById = map.get ( id ) ; T entityByName = map.get ( name ) ; return ! ( java.util.Objects.equals ( entityById , entityByName ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateAttachmentNotReferenceVlanDevice ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = existingInterfacesMap.get ( attachment.getNicName ( ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ATTACHMENT_REFERENCE_VLAN_DEVICE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "ATTACHMENT_REFERENCE_VLAN_DEVICE_ENTITY" , attachment.getNetworkName ( ) ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "nicName" , attachment.getNicName ( ) ) ) . when ( ( ( nic != null ) && ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( nic ) ) ) ) ; }
Source:
protected boolean validate ( ) { org.ovirt.engine.core.bll.validator.HostValidator validator = new org.ovirt.engine.core.bll.validator.HostValidator ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) ) ; return ( ( validate ( validator.hostExists ( ) ) ) && ( validate ( validator.validateStatusForActivation ( ) ) ) ) && ( validate ( validator.validateUniqueId ( ) ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.bll.validator.HostValidator validator = org.ovirt.engine.core.bll.validator.HostValidator.createInstance ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) ) ; return ( ( validate ( validator.hostExists ( ) ) ) && ( validate ( validator.validateStatusForActivation ( ) ) ) ) && ( validate ( validator.validateUniqueId ( ) ) ) ; }
Source:
protected boolean validateBonds ( java.util.Set < java.lang.String > bonds , java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > > bondSlaves ) { boolean returnValue = true ; for ( java.lang.String bondName : bonds ) { if ( ( bondSlaves.containsKey ( bondName ) ) && ( ( bondSlaves.get ( bondName ) . size ( ) ) < 2 ) ) { returnValue = false ; violations.add ( VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; } } return returnValue ; }

Target:
private boolean bondWasModified ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface existingIface = getExistingIfaces ( ) . get ( iface.getName ( ) ) ; if ( existingIface == null ) { return true ; } return ! ( org.apache.commons.lang.ObjectUtils.equals ( iface.getBondOptions ( ) , existingIface.getBondOptions ( ) ) ) ; }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateCluster , org.ovirt.engine.core.common.action.ClusterOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateCluster , org.ovirt.engine.core.common.action.ClusterOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void vmIdRefNullVm ( ) { b.setVmId ( null ) ; final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; v.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVm ( v ) ; final org.ovirt.engine.core.compat.Guid g = b.getVmIdRef ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }

Target:
public void vmIdRefNullVm ( ) { b.setVmId ( null ) ; final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; v.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVm ( v ) ; final org.ovirt.engine.core.compat.Guid g = b.getVmIdRef ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }
Source:
public void testCleanNotExpiredUsersSessionsWithUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( "VdcUser" ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , "VdcUser" ) ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID ) ) ; org.mockito.Mockito.verifyZeroInteractions ( dbUserDAOMcok ) ; }

Target:
public void testCleanNotExpiredUsersSessionsWithUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; org.mockito.Mockito.verifyZeroInteractions ( dbUserDAOMcok ) ; }
Source:
public javax.ws.rs.core.Response copy ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.compat.Guid storageDomainId = getStorageDomainId ( action ) ; org.ovirt.engine.api.model.Disk disk = getDisk ( ) ; org.ovirt.engine.core.compat.Guid imageId = asGuid ( disk.getImageId ( ) ) ; org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( imageId , org.ovirt.engine.core.compat.Guid.Empty , storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Copy ) ; params.setImageGroupID ( asGuid ( disk.getId ( ) ) ) ; return doAction ( VdcActionType.MoveOrCopyDisk , params , action ) ; }

Target:
public javax.ws.rs.core.Response copy ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.compat.Guid storageDomainId = getStorageDomainId ( action ) ; org.ovirt.engine.api.model.Disk disk = getDisk ( ) ; org.ovirt.engine.core.compat.Guid imageId = asGuid ( disk.getImageId ( ) ) ; org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( imageId , org.ovirt.engine.core.compat.Guid.Empty , storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Copy ) ; params.setImageGroupID ( asGuid ( disk.getId ( ) ) ) ; return doAction ( ActionType.MoveOrCopyDisk , params , action ) ; }
Source:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
private java.lang.Boolean getMigrateCompressed ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.migrationCompression ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getClusterCompatibilityVersion ( ) ) ) { if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getMigrateCompressed ( ) ) != null ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getMigrateCompressed ( ) ; } if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getCluster ( ) . getMigrateCompressed ( ) ) != null ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getCluster ( ) . getMigrateCompressed ( ) ; } return org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DefaultMigrationCompression ) ; } return null ; }

Target:
private java.lang.Boolean getMigrateCompressed ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.migrationCompression ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getCompatibilityVersion ( ) ) ) { if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getMigrateCompressed ( ) ) != null ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getMigrateCompressed ( ) ; } if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getCluster ( ) . getMigrateCompressed ( ) ) != null ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getCluster ( ) . getMigrateCompressed ( ) ; } return org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DefaultMigrationCompression ) ; } return null ; }
Source:
public static void countAllTemplates ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getStorageDomainById ( 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public void qosOverCommitmentReportedNicSpeed ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosCommitmentNicSetup ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_OVERCOMMITMENT , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
private void setUpGetBallooningExpectations ( int times , int index ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , true ) ; } }

Target:
protected void setUpGetPayloadExpectations ( int times ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , payload ) ; } }
Source:
public void testMigratoinCanBeSetWhenVMUsesScsiReservation ( ) { prepareVmToPassCanDoAction ( ) ; vm.setMigrationSupport ( MigrationSupport.MIGRATABLE ) ; org.ovirt.engine.core.common.businessentities.VmDevice device = createVmDevice ( ) ; device.setUsingScsiReservation ( false ) ; mockVmDevice ( device ) ; mockVmValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void testMigratoinCanBeSetWhenVMUsesScsiReservation ( ) { prepareVmToPassValidate ( ) ; vm.setMigrationSupport ( MigrationSupport.MIGRATABLE ) ; org.ovirt.engine.core.common.businessentities.VmDevice device = createVmDevice ( ) ; device.setUsingScsiReservation ( false ) ; mockVmDevice ( device ) ; mockVmValidator ( ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
protected void executeCommand ( ) { if ( org.ovirt.engine.core.bll.VmTemplateHandler.isTemplateStatusIsNotLocked ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ) { org.ovirt.engine.core.bll.VmTemplateHandler.lockVmTemplateInTransaction ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) , org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getCompensationContext ( ) ) ; if ( ! ( getTemplateDisks ( ) . isEmpty ( ) ) ) { MoveOrCopyAllImageGroups ( ) ; } else { endVmTemplateRelatedOps ( ) ; } org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { if ( org.ovirt.engine.core.bll.VmTemplateHandler.isTemplateStatusIsNotLocked ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ) { org.ovirt.engine.core.bll.VmTemplateHandler.lockVmTemplateInTransaction ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) , org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getCompensationContext ( ) ) ; if ( ! ( getTemplateDisks ( ) . isEmpty ( ) ) ) { moveOrCopyAllImageGroups ( ) ; } else { endVmTemplateRelatedOps ( ) ; } org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setSucceeded ( true ) ; } }
Source:
private void resetTabsValidity ( ) { setValidTab ( TabName.HOST_TAB , true ) ; setIsCustomPropertiesTabAvailable ( true ) ; setValidTab ( TabName.TAB_RNG , true ) ; setValidTab ( TabName.CUSTOM_PROPERTIES_TAB , true ) ; setValidTab ( TabName.BOOT_OPTIONS_TAB , true ) ; setValidTab ( TabName.RESOURCE_ALLOCATION_TAB , true ) ; setValidTab ( TabName.CONSOLE_TAB , true ) ; setValidTab ( TabName.INITIAL_RUN_TAB , true ) ; setValidTab ( TabName.GENERAL_TAB , true ) ; getValid ( ) . setEntity ( true ) ; }

Target:
private void resetTabsValidity ( ) { setValidTab ( TabName.HOST_TAB , true ) ; setIsCustomPropertiesTabAvailable ( true ) ; setValidTab ( TabName.TAB_RNG , true ) ; setValidTab ( TabName.CUSTOM_PROPERTIES_TAB , true ) ; setValidTab ( TabName.BOOT_OPTIONS_TAB , true ) ; setValidTab ( TabName.RESOURCE_ALLOCATION_TAB , true ) ; setValidTab ( TabName.CONSOLE_TAB , true ) ; setValidTab ( TabName.INITIAL_RUN_TAB , true ) ; setValidTab ( TabName.GENERAL_TAB , true ) ; setValidTab ( TabName.ICON_TAB , true ) ; getValid ( ) . setEntity ( true ) ; }
Source:
public void testStorageLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Storage storage = new org.ovirt.engine.api.model.Storage ( ) ; storage.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_ID ) ; storage.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; storage.getHost ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.HOST_ID ) ; org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , storage ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_HREF , storage.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.HOST_HREF , storage.getHost ( ) . getHref ( ) ) ; }

Target:
public void testStorageLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.HostStorage storage = new org.ovirt.engine.api.model.HostStorage ( ) ; storage.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_ID ) ; storage.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; storage.getHost ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.HOST_ID ) ; org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , storage ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_HREF , storage.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.HOST_HREF , storage.getHost ( ) . getHref ( ) ) ; }
Source:
public void setAutomaticLargePage ( java.lang.Object value ) { if ( ( automaticLargePage ) != value ) { automaticLargePage = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "AutomaticLargePage" ) ) ; } }

Target:
public void setSwapTotal ( java.lang.Long value ) { if ( ( ( swapTotal ) == null ) && ( value == null ) ) { return ; } if ( ( ( swapTotal ) == null ) || ( ! ( swapTotal.equals ( value ) ) ) ) { swapTotal = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SwapTotal" ) ) ; } }