auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setUp ( ) { org.mockito.Mockito.when ( spDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.createDefaultStoragePool ( ) ) ; org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( sdList ) ; org.mockito.Mockito.when ( vdsDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.createClusterList ( ) ) ; spyCommand ( new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.createNewStoragePool ( ) ) ) ; }

Target:
public void setUp ( ) { org.mockito.Mockito.when ( spDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.createDefaultStoragePool ( ) ) ; org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( sdList ) ; org.mockito.Mockito.when ( vdsGroupDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.createClusterList ( ) ) ; spyCommand ( new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.createNewStoragePool ( ) ) ) ; }
Source:
public void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public void getDefaultSpmPriority ( 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 ) ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
public org.ovirt.engine.api.v3.types.V3SpecialObjects adapt ( org.ovirt.engine.api.model.SpecialObjects from ) { org.ovirt.engine.api.v3.types.V3SpecialObjects to = new org.ovirt.engine.api.v3.types.V3SpecialObjects ( ) ; if ( from.isSetLinks ( ) ) { to.getLinks ( ) . addAll ( org.ovirt.engine.api.v3.adapters.V3OutAdapters.adaptOut ( from.getLinks ( ) ) ) ; } return to ; }

Target:
public org.ovirt.engine.api.v3.types.V3SpecialObjects adapt ( org.ovirt.engine.api.model.SpecialObjects from ) { org.ovirt.engine.api.v3.types.V3SpecialObjects to = new org.ovirt.engine.api.v3.types.V3SpecialObjects ( ) ; if ( from.isSetActions ( ) ) { to.setActions ( org.ovirt.engine.api.v3.adapters.V3OutAdapters.adaptOut ( from.getActions ( ) ) ) ; } if ( from.isSetLinks ( ) ) { to.getLinks ( ) . addAll ( org.ovirt.engine.api.v3.adapters.V3OutAdapters.adaptOut ( from.getLinks ( ) ) ) ; } return to ; }
Source:
private void setVmWatchdogToParams ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.action.VmTemplateParametersBase updateVmParams ) { org.ovirt.engine.core.common.businessentities.VmWatchdogType wdModel = model.getWatchdogModel ( ) . getSelectedItem ( ) ; updateVmParams.setUpdateWatchdog ( true ) ; if ( wdModel != null ) { org.ovirt.engine.core.common.businessentities.VmWatchdog vmWatchdog = new org.ovirt.engine.core.common.businessentities.VmWatchdog ( ) ; vmWatchdog.setAction ( model.getWatchdogAction ( ) . getSelectedItem ( ) ) ; vmWatchdog.setModel ( wdModel ) ; updateVmParams.setWatchdog ( vmWatchdog ) ; } }

Target:
private void setVmWatchdogToParams ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.action.VmTemplateManagementParameters updateVmParams ) { org.ovirt.engine.core.common.businessentities.VmWatchdogType wdModel = model.getWatchdogModel ( ) . getSelectedItem ( ) ; updateVmParams.setUpdateWatchdog ( true ) ; if ( wdModel != null ) { org.ovirt.engine.core.common.businessentities.VmWatchdog vmWatchdog = new org.ovirt.engine.core.common.businessentities.VmWatchdog ( ) ; vmWatchdog.setAction ( model.getWatchdogAction ( ) . getSelectedItem ( ) ) ; vmWatchdog.setModel ( wdModel ) ; updateVmParams.setWatchdog ( vmWatchdog ) ; } }
Source:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = createBondSlaves ( null ) . subList ( 0 , 1 ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; }

Target:
public void bondWithNoSlaves ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , null ) ; mockExistingIfaces ( bond ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( bond ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; }
Source:
private void validateSource ( ) { clearProblem ( ) ; if ( ( ( importSources.getSelectedItem ( ) ) == ( ImportSource.EXPORT_DOMAIN ) ) && ( ( exportDomain ) == null ) ) { setError ( constants.notAvailableWithNoActiveExportDomain ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { clearVms ( ) ; exportDomain.setEntity ( null ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = dataCenters.getSelectedItem ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenter.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , createGetStorageDomainsByStoragePoolIdCallback ( dataCenter ) ) ) ; }
Source:
protected boolean isDataOperationsByHSM ( ) { return org.ovirt.engine.core.common.FeatureSupported.dataOperationsByHSM ( org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ; }

Target:
protected boolean isDataOperationsByHSM ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic targetSd ) { return ( ( org.ovirt.engine.core.common.FeatureSupported.dataOperationsByHSM ( org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ) && ( ! ( targetSd.getStorageType ( ) . isLocal ( ) ) ) ) && ( targetSd.getStorageDomainType ( ) . isDataDomain ( ) ) ; }
Source:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , getPrincipalName ( sessionId ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.AUTH_RECORD_PARAMETER_NAME , false ) ) ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.PRINCIPAL_RECORD_PARAMETER_NAME , false ) ) ) , message , msgArgs ) ; getDbFacade ( ) . getEngineSessionDao ( ) . remove ( getEngineSessionSeqId ( sessionId ) ) ; sessionInfoMap.remove ( sessionId ) ; }

Target:
public final void setSoftLimitInterval ( java.lang.String sessionId , int softLimitInterval ) { setData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.SOFT_LIMIT_INTERVAL_PARAMETER_NAME , softLimitInterval ) ; }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success , java.lang.Object taskReturn , boolean replay ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , taskReturn , null , replay ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success , java.lang.Object taskReturn , boolean replay , java.lang.String errorMessage ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , taskReturn , null , replay , errorMessage ) ; }
Source:
public void testIsNetworkInSyncWhenBootProtocolEqual ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( true ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv6GatewayBothBlank ( ) { java.util.List < java.lang.String > blankValues = java.util.Arrays.asList ( null , "" ) ; initIpv6ConfigurationStaticBootProtocol ( Ipv6BootProtocol.STATIC_IP ) ; int blankIndex = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( 2 ) ; ipv6Address.setGateway ( blankValues.get ( blankIndex ) ) ; iface.setIpv6Gateway ( blankValues.get ( ( blankIndex ^ 1 ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
protected org.ovirt.engine.api.model.Disk getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DiskImage entity = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setvolumeFormat ( VolumeFormat.RAW ) ; entity.setDiskInterface ( DiskInterface.VirtIO ) ; entity.setImageStatus ( ImageStatus.OK ) ; entity.setVolumeType ( VolumeType.Sparse ) ; entity.setBoot ( false ) ; entity.setShareable ( false ) ; entity.setPropagateErrors ( PropagateErrors.On ) ; return org.ovirt.engine.api.restapi.resource.BackendStorageDomainDisksResourceTest.setUpStatisticalEntityExpectations ( entity ) ; }

Target:
protected org.ovirt.engine.api.model.Disk getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage entity = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setvolumeFormat ( VolumeFormat.RAW ) ; entity.setDiskInterface ( DiskInterface.VirtIO ) ; entity.setImageStatus ( ImageStatus.OK ) ; entity.setVolumeType ( VolumeType.Sparse ) ; entity.setBoot ( false ) ; entity.setShareable ( false ) ; entity.setPropagateErrors ( PropagateErrors.On ) ; return org.ovirt.engine.api.restapi.resource.BackendStorageDomainDisksResourceTest.setUpStatisticalEntityExpectations ( entity ) ; }
Source:
public void doPolling ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { org.ovirt.engine.core.bll.CommandBase < ? > rootCommand = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.retrieveCommand ( cmdId ) ; if ( ( childCommandsExist ( childCmdIds ) ) && ( evaluateHostUpgradeInternalCommandProgress ( childCmdIds , rootCommand ) ) ) { return ; } evaluateMaintenanceHostCommandProgress ( childCmdIds , rootCommand ) ; }

Target:
public void doPolling ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { org.ovirt.engine.core.bll.CommandBase < ? > rootCommand = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.retrieveCommand ( cmdId ) ; if ( ( childCommandsExist ( childCmdIds ) ) && ( evaluateHostUpgradeInternalCommandProgress ( childCmdIds , rootCommand ) ) ) { return ; } if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( getHostUpgradeInternalCmdId ( childCmdIds ) ) ) { evaluateMaintenanceHostCommandProgress ( childCmdIds , rootCommand ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames = ( ( java.util.HashMap < java.lang.Integer , java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames = ( ( java.util.HashMap < java.lang.Integer , java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames ) ) ; }
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.common.util.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.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 ( ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > setUpVDSGroups ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > entities = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } return entities ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > setUpClusters ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > entities = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } return entities ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsedByVms ( final org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVmDAO ( ) . getAllForNetwork ( network.getId ( ) ) ; if ( vms.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( "ENTITIES_USING_NETWORK" , vms ) ; replacements.add ( VdcBllMessages.VAR__TYPE__VMS.name ( ) ) ; return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_IN_USE , replacements ) ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsedByVms ( final org.ovirt.engine.core.common.businessentities.network.Network network ) { return networkNotUsed ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVmDAO ( ) . getAllForNetwork ( network.getId ( ) ) , VdcBllMessages.VAR__ENTITIES__VMS ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getNetworkDAO ( ) ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; datacenter = new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ; existing_net_name = "engine" ; new_net = new org.ovirt.engine.core.common.businessentities.Network ( ) ; new_net.setname ( "newnet1" ) ; new_net.setdescription ( "New network" ) ; new_net.setstorage_pool_id ( datacenter ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getNetworkDao ( ) ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; datacenter = new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ; existing_net_name = "engine" ; new_net = new org.ovirt.engine.core.common.businessentities.Network ( ) ; new_net.setname ( "newnet1" ) ; new_net.setdescription ( "New network" ) ; new_net.setstorage_pool_id ( datacenter ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute Logoff: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.asyncCallback.onSuccess ( callback.getModel ( ) , null ) ; }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute Logoff: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , null ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , false , false , false , false ) ; verifyModel ( resource.get ( ) , 1 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworkResourceTest.NETWORK_ID } , getEntity ( 0 ) ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
public void validateIsoPrefixForKernelAndNoPrefixForInitrd ( ) throws java.lang.Exception { java.lang.String initrd = "initrd" ; java.lang.String kernel = "kernel" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( initrd , ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ) + kernel ) ) ; org.junit.Assert.assertEquals ( vm.getinitrd_url ( ) , initrd ) ; org.junit.Assert.assertEquals ( vm.getkernel_url ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ACTIVE_ISO_PREFIX ) + "/" ) + kernel ) ) ; }

Target:
public void validateIsoPrefixForKernelAndNoPrefixForInitrd ( ) throws java.lang.Exception { java.lang.String initrd = "initrd" ; java.lang.String kernel = "kernel" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( initrd , ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ) + kernel ) ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , initrd ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ACTIVE_ISO_PREFIX ) + "/" ) + kernel ) ) ; }
Source:
public void testStoragePoolDoesntExist ( ) { final int domainSizeGB = 20 ; final int sizeRequired = 5 ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddVmTests ( domainSizeGB , sizeRequired ) ; org.mockito.Mockito.doReturn ( null ) . when ( cmd ) . getStoragePool ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void testStoragePoolDoesntExist ( ) { final int domainSizeGB = 20 ; final int sizeRequired = 5 ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddVmTests ( domainSizeGB , sizeRequired ) ; org.mockito.Mockito.doReturn ( null ) . when ( cmd ) . getStoragePool ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST.toString ( ) ) ) ; }
Source:
private static void setCdPath ( java.util.Map < java.lang.String , java.lang.Object > specParams , java.lang.String srcCdPath , java.lang.String isoPath ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( isoPath ) ) ) { specParams.put ( VdsProperties.Path , isoPath ) ; } else if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( srcCdPath ) ) ) { specParams.put ( VdsProperties.Path , srcCdPath ) ; } }

Target:
private static void setCdPath ( java.util.Map < java.lang.String , java.lang.Object > specParams , java.lang.String srcCdPath , java.lang.String isoPath ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( isoPath ) ) ) { specParams.put ( VdsProperties.Path , isoPath ) ; } else if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( srcCdPath ) ) ) { specParams.put ( VdsProperties.Path , srcCdPath ) ; } else { specParams.put ( VdsProperties.Path , "" ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsForDiskId ( ) { if ( ( listVms ) == null ) { listVms = org.ovirt.engine.core.bll.RemoveDiskCommand.getVmDAO ( ) . getVmsListForDisk ( disk.getId ( ) ) ; } return listVms ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsForDiskId ( ) { if ( ( listVms ) == null ) { listVms = org.ovirt.engine.core.bll.RemoveDiskCommand.getVmDAO ( ) . getVmsListForDisk ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getEntityId ( ) ) ) ) ; } return listVms ; }
Source:
protected int getBlockSparseInitSizeInGb ( ) { return org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.InitStorageSparseSizeInGB ) . intValue ( ) ; }

Target:
protected boolean isDiskSupportedForPlugUnPlug ( org.ovirt.engine.core.common.businessentities.Disk disk ) { java.util.Set < java.lang.String > diskHotpluggableInterfaces = osRepository.getDiskHotpluggableInterfaces ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getOs ( ) , org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ; if ( ( org.springframework.util.CollectionUtils.isEmpty ( diskHotpluggableInterfaces ) ) || ( ! ( diskHotpluggableInterfaces.contains ( disk.getDiskInterface ( ) . name ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; } return true ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc spmStart ( java.lang.String spUUID , int prevID , java.lang.String prevLVER , int recoveryMode , java.lang.String SCSIFencing , int maxHostId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.spmStart ( spUUID , prevID , prevLVER , recoveryMode , SCSIFencing , maxHostId ) ; org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc vmUpdateDevice ( java.lang.String vmId , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct device ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.vmUpdateDevice ( vmId , device.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void maybeSetSelectedItem ( org.ovirt.engine.ui.uicommonweb.models.ListModel listModel , java.lang.Object value ) { if ( ( ( listModel != null ) && ( listModel.getIsChangable ( ) ) ) && ( listModel.getIsAvailable ( ) ) ) { listModel.setSelectedItem ( value ) ; } }

Target:
private < T > void maybeSetSelectedItem ( org.ovirt.engine.ui.uicommonweb.models.ListModel < T > listModel , T value ) { if ( ( ( listModel != null ) && ( listModel.getIsChangable ( ) ) ) && ( listModel.getIsAvailable ( ) ) ) { listModel.setSelectedItem ( value ) ; } }
Source:
private void liveUpdateCpuProfile ( ) { if ( ( org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . getStatus ( ) . isQualifiedForQosChange ( ) ) && ( ! ( oldVm.getCpuProfileId ( ) . equals ( newVmStatic.getCpuProfileId ( ) ) ) ) ) { vmSlaPolicyUtils.refreshCpuQosOfRunningVm ( org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) ) ; } }

Target:
private void liveUpdateCpuProfile ( ) { if ( ( org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . getStatus ( ) . isQualifiedForQosChange ( ) ) && ( ! ( java.util.Objects.equals ( oldVm.getCpuProfileId ( ) , newVmStatic.getCpuProfileId ( ) ) ) ) ) { vmSlaPolicyUtils.refreshCpuQosOfRunningVm ( org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) ) ; } }
Source:
public void testGetDefaultQuotaToDCWithoutDefaultQuota ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quotaUnlimited = quotaHelper.getUnlimitedQuota ( mockStoragePool ( ) , true ) ; assertQuotaUnlimited ( quotaUnlimited ) ; assertQuotaUnlimitedName ( quotaUnlimited ) ; }

Target:
public void testGetDefaultQuotaForDCWithDefaultQuotaWithNoReuse ( ) throws java.lang.Exception { java.lang.String defaultQuotaName = quotaHelper.getDefaultQuotaName ( storagePool.getname ( ) ) ; org.mockito.Mockito.when ( quotaHelper.generateDefaultQuotaName ( storagePool ) ) . thenReturn ( defaultQuotaName ) ; org.mockito.Mockito.when ( quotaDAO.getDefaultQuotaByStoragePoolId ( storagePoolUUID ) ) . thenReturn ( mockGeneralStorageQuota ( ) ) ; org.ovirt.engine.core.common.businessentities.Quota quotaUnlimited = quotaHelper.getUnlimitedQuota ( mockStoragePool ( ) , true , false ) . getFirst ( ) ; assertQuotaUnlimited ( quotaUnlimited ) ; assertQuotaUnlimitedName ( quotaUnlimited ) ; }
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 getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
private void initOsRepository ( ) { OsInfoPreferencesLoader.INSTANCE.init ( java.nio.file.FileSystems.getDefault ( ) . getPath ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getEtcDir ( ) . getAbsolutePath ( ) , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.OsRepositoryConfDir ) ) ) ; OsRepositoryImpl.INSTANCE.init ( OsInfoPreferencesLoader.INSTANCE.getPreferences ( ) ) ; org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.ovirt.engine.core.utils.OsRepositoryImpl.INSTANCE ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; dbFacade.populateDwhOsInfo ( osRepository.getOsNames ( ) ) ; }

Target:
private void initOsRepository ( ) { OsInfoPreferencesLoader.INSTANCE.init ( java.nio.file.FileSystems.getDefault ( ) . getPath ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getEtcDir ( ) . getAbsolutePath ( ) , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.OsRepositoryConfDir ) ) ) ; OsRepositoryImpl.INSTANCE.init ( OsInfoPreferencesLoader.INSTANCE.getPreferences ( ) ) ; org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.ovirt.engine.core.utils.OsRepositoryImpl.INSTANCE ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; osInfoDao.populateDwhOsInfo ( osRepository.getOsNames ( ) ) ; }
Source:
public void testGetVmsCountByClusterId ( ) { org.junit.Assert.assertEquals ( "Incorrect number of VMs in cluster" , FixturesTool.NUMBER_OF_VMS_IN_CLUSTER_RHEL6_NFS_CLUSTER , dao.getVmsCountByClusterId ( FixturesTool.CLUSTER_RHEL6_NFS ) ) ; org.junit.Assert.assertEquals ( "Incorrect number of VMs in cluster" , FixturesTool.NUMBER_OF_VMS_IN_CLUSTER_RHEL6_ISCSI , dao.getVmsCountByClusterId ( FixturesTool.CLUSTER_RHEL6_ISCSI ) ) ; org.junit.Assert.assertEquals ( "Incorrect number of VMs in cluster" , 0 , dao.getVmsCountByClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ; }

Target:
public void testGetVmsCountByClusterId ( ) { org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.NUMBER_OF_VMS_IN_CLUSTER_RHEL6_NFS_CLUSTER , dao.getVmsCountByClusterId ( FixturesTool.CLUSTER_RHEL6_NFS ) , "Incorrect number of VMs in cluster" ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.NUMBER_OF_VMS_IN_CLUSTER_RHEL6_ISCSI , dao.getVmsCountByClusterId ( FixturesTool.CLUSTER_RHEL6_ISCSI ) , "Incorrect number of VMs in cluster" ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , dao.getVmsCountByClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , "Incorrect number of VMs in cluster" ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.StoragePool buildStoragePool ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.StoragePool sPool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; if ( xmlRpcStruct.containsKey ( "type" ) ) { sPool.setstorage_pool_type ( org.ovirt.engine.core.common.businessentities.StorageType.valueOf ( xmlRpcStruct.get ( "type" ) . toString ( ) ) ) ; } sPool.setName ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.AssignStringValue ( xmlRpcStruct , "name" ) ) ; java.lang.Integer masterVersion = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.AssignIntValue ( xmlRpcStruct , "master_ver" ) ; if ( masterVersion != null ) { sPool.setmaster_domain_version ( masterVersion ) ; } return sPool ; }

Target:
public static org.ovirt.engine.core.common.businessentities.StoragePool buildStoragePool ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.StoragePool sPool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; if ( xmlRpcStruct.containsKey ( "type" ) ) { sPool.setStorageType ( org.ovirt.engine.core.common.businessentities.StorageType.valueOf ( xmlRpcStruct.get ( "type" ) . toString ( ) ) ) ; } sPool.setName ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.AssignStringValue ( xmlRpcStruct , "name" ) ) ; java.lang.Integer masterVersion = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.AssignIntValue ( xmlRpcStruct , "master_ver" ) ; if ( masterVersion != null ) { sPool.setmaster_domain_version ( masterVersion ) ; } return sPool ; }
Source:
protected void EndSuccessfully ( ) { org.ovirt.engine.core.bll.ExportVmCommand.EndActionOnAllImageGroups ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.UnLockVm ( vm ) ; endDiskRelatedActions ( vm ) ; if ( org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getCopyCollapse ( ) ) { endCopyCollapseOperations ( vm ) ; } else { updateSnapshotOvf ( vm ) ; } org.ovirt.engine.core.bll.ExportVmCommand.setSucceeded ( true ) ; }

Target:
protected void endSuccessfully ( ) { org.ovirt.engine.core.bll.ExportVmCommand.endActionOnAllImageGroups ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.UnLockVm ( vm ) ; endDiskRelatedActions ( vm ) ; if ( org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getCopyCollapse ( ) ) { endCopyCollapseOperations ( vm ) ; } else { updateSnapshotOvf ( vm ) ; } org.ovirt.engine.core.bll.ExportVmCommand.setSucceeded ( true ) ; }
Source:
protected void mockInterfaceList ( ) { org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; java.util.ArrayList < java.lang.String > diskInterfaces = new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( new java.lang.String [ ] { "IDE" , "VirtIO" , "VirtIO_SCSI" } ) ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.anyInt ( ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( diskInterfaces ) ; }

Target:
protected void mockInterfaceList ( ) { org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; java.util.ArrayList < java.lang.String > diskInterfaces = new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( new java.lang.String [ ] { "IDE" , "VirtIO" , "VirtIO_SCSI" } ) ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.anyInt ( ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( diskInterfaces ) ; }
Source:
public void getRoleList ( 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.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity slaveVolume ) { org.ovirt.engine.core.dao.VdsGroupDAO vdsGroupDao = getVdsGroupDao ( ) ; org.ovirt.engine.core.compat.Version slaveCompatibilityVersion = vdsGroupDao.get ( slaveVolume.getClusterId ( ) ) . getcompatibility_version ( ) ; org.ovirt.engine.core.compat.Version masterCompatibilityVersion = vdsGroupDao.get ( masterVolume.getClusterId ( ) ) . getcompatibility_version ( ) ; return masterCompatibilityVersion.equals ( slaveCompatibilityVersion ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity slaveVolume ) { org.ovirt.engine.core.dao.VdsGroupDAO vdsGroupDao = getVdsGroupDao ( ) ; org.ovirt.engine.core.compat.Version slaveCompatibilityVersion = vdsGroupDao.get ( slaveVolume.getClusterId ( ) ) . getCompatibilityVersion ( ) ; org.ovirt.engine.core.compat.Version masterCompatibilityVersion = vdsGroupDao.get ( masterVolume.getClusterId ( ) ) . getCompatibilityVersion ( ) ; return masterCompatibilityVersion.equals ( slaveCompatibilityVersion ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { setWindow ( null ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { boolean isAllValidatePassed = true ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase : result.getReturnValue ( ) ) { if ( ! ( returnValueBase.isValid ( ) ) ) { isAllValidatePassed = false ; break ; } } if ( isAllValidatePassed ) { setWindow ( null ) ; } }
Source:
protected void executeQueryCommand ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > consoleDevices = getVmDeviceDAO ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.GetConsoleDevicesQuery.getParameters ( ) . getId ( ) , VmDeviceGeneralType.CONSOLE ) ; java.util.List < java.lang.String > result = new java.util.ArrayList ( consoleDevices.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice v : consoleDevices ) { result.add ( v.getDevice ( ) ) ; } org.ovirt.engine.core.bll.GetConsoleDevicesQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > consoleDevices = getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.GetConsoleDevicesQuery.getParameters ( ) . getId ( ) , VmDeviceGeneralType.CONSOLE ) ; java.util.List < java.lang.String > result = new java.util.ArrayList ( consoleDevices.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice v : consoleDevices ) { result.add ( v.getDevice ( ) ) ; } org.ovirt.engine.core.bll.GetConsoleDevicesQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > queryGroups ( org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final org.ovirt.engine.api.extensions.ExtMap filter ) { return org.ovirt.engine.core.aaa.AuthzUtils.populateGroups ( extension , Authz.InvokeCommands.QUERY_OPEN , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.InvokeKeys.QUERY_ENTITY , Authz.QueryEntity.GROUP ) . mput ( Authz.InvokeKeys.QUERY_FILTER , filter ) ) ; }

Target:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > queryGroups ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean resolveGroups , boolean recursiveGroupResolving ) { return org.ovirt.engine.core.aaa.AuthzUtils.populateGroups ( extension , namespace , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.InvokeKeys.QUERY_ENTITY , Authz.QueryEntity.GROUP ) . mput ( Authz.InvokeKeys.QUERY_FILTER , filter ) . mput ( Authz.InvokeKeys.QUERY_FLAGS , org.ovirt.engine.core.aaa.AuthzUtils.queryFlagValue ( resolveGroups , recursiveGroupResolving ) ) ) ; }
Source:
public java.lang.Integer runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . get ( taskId ) ; int retVal = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . remove ( taskId ) ; if ( ( asyncTask != null ) && ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( asyncTask.getCommandId ( ) ) ) ) ) { commandsCache.remove ( asyncTask.getCommandId ( ) ) ; } return retVal ; }

Target:
public java.lang.Void runInTransaction ( ) { commandsCache.updateCallBackNotified ( commandId ) ; return null ; }
Source:
public void canDoActionThinProvisioningSpaceCheckFailsSize ( ) { final int availableSize = 4 ; final int usedSize = 6 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
public void canDoActionThinProvisioningSpaceCheckFailsSize ( ) { final int availableSize = 4 ; final int usedSize = 6 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getMaster ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setSpeed ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NIC_SPEED ) ; entity.setBonded ( true ) ; entity.setBootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.BOOT_PROTOCOL ) ; return org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getMaster ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setSpeed ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NIC_SPEED ) ; entity.setBonded ( true ) ; entity.setIpv4BootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.BOOT_PROTOCOL ) ; return org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; }
Source:
public void setItems ( java.lang.Iterable < T > value ) { if ( ( items ) != value ) { itemsChanging ( value , items ) ; items = value ; itemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }

Target:
public void setItems ( java.util.Collection < T > value ) { if ( ( items ) != value ) { itemsChanging ( value , items ) ; items = value ; itemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }
Source:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpActionExpectations ( VdcActionType.RemoveExternalEvent , org.ovirt.engine.core.common.action.RemoveExternalEventParameters.class , new java.lang.String [ ] { "auditLogId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ 0 ] } , true , true ) ; verifyRemove ( collection.remove ( java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ 0 ] ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpActionExpectations ( VdcActionType.RemoveExternalEvent , org.ovirt.engine.core.common.action.RemoveExternalEventParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ 0 ] } , true , true , false ) ; setUpQueryExpectations ( "" ) ; verifyRemove ( collection.remove ( java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ 0 ] ) ) ) ; }