auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testAddIscsiLunDiskIncompleteParametersConnectionAddress ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setAddress ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddIscsiLunDiskIncompleteParametersConnectionAddress" , "address" ) ; } }

Target:
public void testAddIscsiLunDiskIncompleteParametersConnectionTarget ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setTarget ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddIscsiLunDiskIncompleteParametersConnectionTarget" , "target" ) ; } }
Source:
private org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan hostVlanFromNic ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan hv = new org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan ( ) ; hv.setInterface ( nic ) ; hv.setName ( nic.getName ( ) ) ; hv.setNetworkName ( nic.getNetworkName ( ) ) ; hv.setAddress ( nic.getIpv4Address ( ) ) ; hv.getPropertyChangedEvent ( ) . addListener ( this ) ; return hv ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan hostVlanFromNic ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan hv = new org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan ( ) ; hv.setInterface ( nic ) ; hv.setName ( nic.getName ( ) ) ; hv.setNetworkName ( nic.getNetworkName ( ) ) ; hv.setIpv4Address ( nic.getIpv4Address ( ) ) ; hv.setIpv6Address ( nic.getIpv6Address ( ) ) ; hv.getPropertyChangedEvent ( ) . addListener ( this ) ; return hv ; }
Source:
private void undo ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getPreview ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RestoreAllSnapshots , new org.ovirt.engine.core.common.action.RestoreAllSnapshotsParameters ( vm.getId ( ) , snapshot.getId ( ) ) , null , null ) ; } }

Target:
private void undo ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RestoreAllSnapshots , new org.ovirt.engine.core.common.action.RestoreAllSnapshotsParameters ( vm.getId ( ) , org.ovirt.engine.core.common.businessentities.SnapshotActionEnum.UNDO ) , null , null ) ; } }
Source:
protected void executeNetworkCommand ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics , java.lang.Object ... params ) { assert op1 instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkToDetach = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( op1 ) ) ; assert networkToDetach.isAttached ( ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.detachNetwork ( allNics , networkToDetach ) ; }

Target:
protected void executeNetworkCommand ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel , java.lang.Object ... params ) { }
Source:
public void canDoActionNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void canDoActionNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) . when ( command ) . getAllImageSnapshots ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void testGetPackagesForCheckUpdate ( ) throws java.lang.Exception { java.util.Collection < java.lang.String > expectedPackages = new java.util.HashSet < > ( java.util.Arrays.asList ( "a" , "b" , "c" , "d" ) ) ; java.util.Collection < java.lang.String > actualPackages = org.ovirt.engine.core.bll.host.HostUpgradeManager.getPackagesForCheckUpdate ( ) ; org.junit.Assert.assertEquals ( expectedPackages , actualPackages ) ; }

Target:
public void testGetPackagesForCheckUpdate ( ) throws java.lang.Exception { java.util.Collection < java.lang.String > expectedPackages = new java.util.HashSet < > ( java.util.Arrays.asList ( "a" , "b" , "c" , "d" ) ) ; java.util.Collection < java.lang.String > actualPackages = org.ovirt.engine.core.bll.host.HostUpgradeManager.getPackagesForCheckUpdate ( VDSType.VDS ) ; org.junit.Assert.assertEquals ( expectedPackages , actualPackages ) ; }
Source:
public void testDisplayTypes ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > supportedDisplays = OsRepositoryImpl.INSTANCE.getDisplayTypes ( ) . get ( 777 ) . get ( null ) ; boolean isSizeCorrect = ( supportedDisplays.size ( ) ) == 2 ; boolean containsSameElements = new java.util.HashSet < org.ovirt.engine.core.common.businessentities.DisplayType > ( supportedDisplays ) . equals ( new java.util.HashSet < org.ovirt.engine.core.common.businessentities.DisplayType > ( java.util.Arrays.asList ( DisplayType.qxl , DisplayType.vnc ) ) ) ; org.junit.Assert.assertTrue ( isSizeCorrect ) ; org.junit.Assert.assertTrue ( containsSameElements ) ; }

Target:
public void testDisplayTypes ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > supportedDisplays = OsRepositoryImpl.INSTANCE.getDisplayTypes ( ) . get ( 777 ) . get ( null ) ; boolean isSizeCorrect = ( supportedDisplays.size ( ) ) == 2 ; boolean containsSameElements = new java.util.HashSet < org.ovirt.engine.core.common.businessentities.DisplayType > ( supportedDisplays ) . equals ( new java.util.HashSet < org.ovirt.engine.core.common.businessentities.DisplayType > ( java.util.Arrays.asList ( DisplayType.qxl , DisplayType.vga ) ) ) ; org.junit.Assert.assertTrue ( isSizeCorrect ) ; org.junit.Assert.assertTrue ( containsSameElements ) ; }
Source:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.aaa.AuthenticationProfile > profiles = org.ovirt.engine.core.aaa.AuthenticationProfileRepository.getInstance ( ) . getProfiles ( ) ; java.util.List < java.lang.String > names = new java.util.ArrayList ( profiles.size ( ) ) ; for ( org.ovirt.engine.core.aaa.AuthenticationProfile profile : profiles ) { names.add ( profile.getName ( ) ) ; } org.ovirt.engine.core.bll.GetAAAProfileListQuery.getQueryReturnValue ( ) . setReturnValue ( names ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.aaa.AuthenticationProfile > profiles = org.ovirt.engine.core.aaa.AuthenticationProfileRepository.getInstance ( ) . getProfiles ( ) ; java.util.List < java.lang.String > names = new java.util.ArrayList ( profiles.size ( ) ) ; for ( org.ovirt.engine.core.aaa.AuthenticationProfile profile : profiles ) { names.add ( profile.getName ( ) ) ; } java.util.Collections.sort ( names ) ; org.ovirt.engine.core.bll.GetAAAProfileListQuery.getQueryReturnValue ( ) . setReturnValue ( names ) ; }
Source:
public static void getVmTemplatesWithPermittedAction ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesWithPermittedAction , getEntitiesWithPermittedActionParameters , aQuery ) ; }

Target:
public void getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { 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.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
public void UpdateVmDynamic ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic ) { if ( ( _vdsUpdater ) != null ) { org.ovirt.engine.core.common.businessentities.VM vm = _vdsUpdater.GetVmFromDictionary ( vmDynamic.getId ( ) ) ; if ( vm != null ) { vm.setDynamicData ( vmDynamic ) ; } } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . update ( vmDynamic ) ; }

Target:
public void UpdateVmDynamic ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic ) { if ( ( _vdsUpdater ) != null ) { org.ovirt.engine.core.common.businessentities.VM vm = _vdsUpdater.GetVmFromDictionary ( vmDynamic.getId ( ) ) ; if ( vm != null ) { vm.setDynamicData ( vmDynamic ) ; } } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vmDynamic ) ; }
Source:
public org.ovirt.optimizer.config.ConfigProvider load ( ) { java.io.FileReader reader = null ; try { reader = new java.io.FileReader ( configFile ) ; config.load ( reader ) ; } catch ( java.io.IOException ex ) { org.ovirt.optimizer.config.ConfigProvider.log.error ( "Connection to oVirt REST server failed" , ex ) ; } finally { try { if ( reader != null ) { reader.close ( ) ; } } catch ( java.io.IOException ex ) { org.ovirt.optimizer.config.ConfigProvider.log.error ( "The config file could not be closed" , ex ) ; } } return this ; }

Target:
public org.ovirt.optimizer.config.ConfigProvider load ( ) { java.io.FileReader reader = null ; try { reader = new java.io.FileReader ( configFile ) ; config.load ( reader ) ; } catch ( java.io.IOException ex ) { org.ovirt.optimizer.config.ConfigProvider.log.warn ( "Config file could not be opened. Using the defaults values with server: {}." , configFile , config.getProperty ( org.ovirt.optimizer.config.ConfigProvider.SDK_SERVER ) ) ; } finally { try { if ( reader != null ) { reader.close ( ) ; } } catch ( java.io.IOException ex ) { org.ovirt.optimizer.config.ConfigProvider.log.error ( "The config file could not be closed" , ex ) ; } } return this ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionListReturnForXmlRpc getStorageConnectionsList ( java.lang.String spUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getStorageConnectionsList ( spUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionListReturnForXmlRpc ( 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 wipeVolume ( java.lang.String sdUUID , java.lang.String imgUUID , java.lang.String volUUID ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.wipeVolume ( sdUUID , imgUUID , volUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; }
Source:
public java.lang.Object runInTransaction ( ) { map = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( getStorageDomain ( ) . getId ( ) , getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Locked ) ; getStoragePoolIsoMapDAO ( ) . save ( map ) ; getCompensationContext ( ) . snapshotNewEntity ( map ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { map = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( getStorageDomain ( ) . getId ( ) , getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Locked ) ; getStoragePoolIsoMapDao ( ) . save ( map ) ; getCompensationContext ( ) . snapshotNewEntity ( map ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { storageDomain.setSupportsDiscard ( true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 0L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { storageDomain.setSupportsDiscard ( true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.junit.jupiter.api.Assertions.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 0L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
private void endVmRelatedOps ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getVmFromDB ( ) ; if ( vm != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( vm.getId ( ) ) ; UpdateVmImSpm ( ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } }

Target:
private java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > getStorageQuotaListParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : getVm ( ) . getDiskMap ( ) . values ( ) ) { if ( disk instanceof org.ovirt.engine.core.common.businessentities.DiskImage ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; list.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( diskImage.getQuotaId ( ) , imageToDestinationDomainMap.get ( diskImage.getId ( ) ) , diskImage.getSizeInGigabytes ( ) ) ) ; } } return list ; }
Source:
protected org.ovirt.engine.core.bll.scheduling.utils.FindVmAndDestinations getFindVmAndDestinations ( org.ovirt.engine.core.common.businessentities.Cluster cluster , java.util.Map < java.lang.String , java.lang.String > parameters ) { final int highCpuUtilization = tryParseWithDefault ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionBalancePolicyUnit.HIGH_UTILIZATION ) , getHighUtilizationDefaultValue ( ) ) ; final long overUtilizedMemory = ( parameters.containsKey ( PolicyUnitParameter.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED.getDbName ( ) ) ) ? java.lang.Long.parseLong ( parameters.get ( PolicyUnitParameter.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED.getDbName ( ) ) ) : 0L ; return new org.ovirt.engine.core.bll.scheduling.utils.FindVmAndDestinations ( cluster , highCpuUtilization , overUtilizedMemory ) ; }

Target:
protected org.ovirt.engine.core.bll.scheduling.utils.FindVmAndDestinations getFindVmAndDestinations ( org.ovirt.engine.core.common.businessentities.Cluster cluster , java.util.Map < java.lang.String , java.lang.String > parameters ) { final int highCpuUtilization = tryParseWithDefault ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.EvenDistributionBalancePolicyUnit.HIGH_UTILIZATION ) , getHighUtilizationDefaultValue ( ) ) ; final long overUtilizedMemory = ( parameters.containsKey ( PolicyUnitParameter.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED.getDbName ( ) ) ) ? java.lang.Long.parseLong ( parameters.get ( PolicyUnitParameter.LOW_MEMORY_LIMIT_FOR_OVER_UTILIZED.getDbName ( ) ) ) : 0L ; return new org.ovirt.engine.core.bll.scheduling.utils.FindVmAndDestinations ( cluster , highCpuUtilization , overUtilizedMemory , slaValidator ) ; }
Source:
public void testAddIscsiLunDiskIncompleteParametersConnectionPort ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setPort ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddIscsiLunDiskIncompleteParametersConnectionPort" , "port" ) ; } }

Target:
public void testSubResourceLocatorBadGuid ( ) { verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.getDiskResource ( "foo" ) ) ) ; }
Source:
void initTable ( ) { getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.VM > nameColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.VM > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VM object ) { return object.getName ( ) ; } } ; nameColumn.makeSortable ( ) ; getTable ( ) . addColumn ( nameColumn , org.ovirt.engine.ui.webadmin.section.main.view.tab.profile.SubTabVnicProfileVmView.constants.nameVm ( ) , "300px" ) ; }

Target:
public void update ( int index , org.ovirt.engine.core.common.businessentities.VM vm , java.lang.String value ) { java.util.Map < java.lang.String , java.lang.String > parameters = new java.util.HashMap < > ( ) ; parameters.put ( FragmentParams.NAME.getName ( ) , vm.getName ( ) ) ; getPlaceTransitionHandler ( ) . handlePlaceTransition ( WebAdminApplicationPlaces.virtualMachineGeneralSubTabPlace , parameters ) ; }
Source:
public void separateCustomPropertiesToUserAndPredefined ( org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { java.lang.String customProperties = vmBase.getCustomProperties ( ) ; org.ovirt.engine.core.common.utils.customprop.VmPropertiesUtils.VMCustomProperties properties = parseProperties ( version , customProperties ) ; vmBase.setPredefinedProperties ( properties.getPredefinedProperties ( ) ) ; vmBase.setUserDefinedProperties ( properties.getUseDefinedProperties ( ) ) ; }

Target:
public void separateCustomPropertiesToUserAndPredefined ( org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { java.lang.String customProperties = vmBase.getCustomProperties ( ) ; org.ovirt.engine.core.common.utils.customprop.VmPropertiesUtils.VMCustomProperties properties = parseProperties ( version , customProperties ) ; vmBase.setPredefinedProperties ( properties.getPredefinedProperties ( ) ) ; vmBase.setUserDefinedProperties ( properties.getUserDefinedProperties ( ) ) ; }
Source:
private void calculateNetworkImplementationDetailsAndAssertSync ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , boolean expectSync , java.lang.String networkName , boolean vmNet , int mtu , int vlanId ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > networks = createNetworksMap ( networkName , vmNet , mtu , vlanId ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails networkImplementationDetails = org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( networks , iface ) ; org.junit.Assert.assertNotNull ( "Network implementation details should be filled." , networkImplementationDetails ) ; org.junit.Assert.assertEquals ( ( ( "Network implementation details should be " + ( expectSync ? "in" : "out of" ) ) + " sync." ) , expectSync , networkImplementationDetails.isInSync ( ) ) ; }

Target:
private void calculateNetworkImplementationDetailsAndAssertSync ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , boolean expectSync , java.lang.String networkName , boolean vmNet , int mtu , int vlanId , org.ovirt.engine.core.common.businessentities.network.NetworkQoS qos ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( networkName , vmNet , mtu , vlanId ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails networkImplementationDetails = org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( network , qos , iface ) ; org.junit.Assert.assertNotNull ( "Network implementation details should be filled." , networkImplementationDetails ) ; org.junit.Assert.assertEquals ( ( ( "Network implementation details should be " + ( expectSync ? "in" : "out of" ) ) + " sync." ) , expectSync , networkImplementationDetails.isInSync ( ) ) ; }
Source:
private void validateRngRequiredSource ( ) { org.ovirt.engine.core.compat.Version clusterVersion = getVersion ( ) . getSelectedItem ( ) ; boolean rngSupportedForCluster = isRngSupportedForClusterVersion ( clusterVersion ) ; getRngRandomSourceRequired ( ) . setIsValid ( ( rngSupportedForCluster || ( ! ( getRngRandomSourceRequired ( ) . getEntity ( ) ) ) ) ) ; getRngHwrngSourceRequired ( ) . setIsValid ( ( rngSupportedForCluster || ( ! ( getRngHwrngSourceRequired ( ) . getEntity ( ) ) ) ) ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.MigrationBandwidthLimitType > getMigrationBandwidthLimitType ( ) { return migrationBandwidthLimitType ; }
Source:
public void updateStatusAndReasons ( org.ovirt.engine.core.common.businessentities.VdsDynamic host ) { update ( host ) ; }

Target:
public void updateStatusAndReasons ( org.ovirt.engine.core.common.businessentities.VdsDynamic host ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getStatusSqlParameterSource ( host.getId ( ) , host.getStatus ( ) ) ; parameterSource.addValue ( "non_operational_reason" , host.getNonOperationalReason ( ) ) . addValue ( "maintenance_reason" , host.getMaintenanceReason ( ) ) ; getCallsHandler ( ) . executeModification ( "UpdateVdsDynamicStatusAndReasons" , parameterSource ) ; }
Source:
public void qosBondSpeedMissing ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosBondSpeedSetup ( null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { final org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos 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 changePassword ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.ChangeUserPassword , new org.ovirt.engine.core.common.action.ChangeUserPasswordParameters ( getUserName ( ) . getEntity ( ) , getPassword ( ) . getEntity ( ) , getNewPassword ( ) . getEntity ( ) , getDomain ( ) . getSelectedItem ( ) ) ) ; }

Target:
private void changePassword ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.ChangeUserPassword , new org.ovirt.engine.core.common.action.ChangeUserPasswordParameters ( getUserName ( ) . getEntity ( ) , getPassword ( ) . getEntity ( ) , getNewPassword ( ) . getEntity ( ) , getProfile ( ) . getSelectedItem ( ) ) ) ; }
Source:
public void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }
Source:
public void testGetByIdOrNameWhenItemIsNotIdentified2 ( ) { org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem testItem = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "name" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > testItems = java.util.Collections.singletonList ( testItem ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( testItems ) ; org.junit.Assert.assertThat ( map.get ( null , null ) , org.hamcrest.CoreMatchers.nullValue ( ) ) ; }

Target:
public void testGetByIdOrNameWhenItemIsNotIdentified2 ( ) { org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem testItem = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "name" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > testItems = java.util.Collections.singletonList ( testItem ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( testItems ) ; org.hamcrest.MatcherAssert.assertThat ( map.get ( null , null ) , org.hamcrest.CoreMatchers.nullValue ( ) ) ; }
Source:
private void registerModelPropertyChangeListener ( ) { model.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { boolean isSelected = model.getIsSelected ( ) ; org.ovirt.engine.ui.common.widget.ModelBoundCheckBox.super . setValue ( isSelected , true ) ; } } ) ; }

Target:
private void registerModelPropertyChangeListener ( ) { model.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean isSelected = model.getIsSelected ( ) ; org.ovirt.engine.ui.common.widget.ModelBoundCheckBox.super . setValue ( isSelected , true ) ; } } ) ; }
Source:
public static boolean isStatusUp ( org.ovirt.engine.core.common.businessentities.VMStatus st ) { return ( ( ( ( ( ( st == ( VMStatus.Up ) ) || ( st == ( VMStatus.PoweredDown ) ) ) || ( st == ( VMStatus.PoweringDown ) ) ) || ( st == ( VMStatus.PoweringUp ) ) ) || ( st == ( VMStatus.MigratingFrom ) ) ) || ( st == ( VMStatus.WaitForLaunch ) ) ) || ( st == ( VMStatus.RebootInProgress ) ) ; }

Target:
public java.lang.String toString ( ) { return ( "VM [" + ( getName ( ) ) ) + "]" ; }
Source:
protected boolean setUpPasswordlessSSH ( org.ovirt.engine.core.compat.Guid masterUpServerId , java.util.Set < org.ovirt.engine.core.compat.Guid > remoteServerSet , java.lang.String userName ) { java.util.List < java.lang.String > pubKeys = readPubKey ( masterUpServerId ) ; boolean canProceed = ( pubKeys != null ) && ( ( pubKeys.size ( ) ) > 0 ) ; if ( canProceed ) { canProceed = evaluateReturnValues ( AuditLogType.GLUSTER_GEOREP_PUBLIC_KEY_WRITE_FAILED , updatePubKeysToRemoteHosts ( pubKeys , remoteServerSet , userName ) ) ; } return canProceed ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { return getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.CREATE_GLUSTER_VOLUME_GEOREP_SESSION : org.ovirt.engine.core.common.AuditLogType.GLUSTER_GEOREP_SESSION_CREATE_FAILED ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc getExternalVmList ( java.lang.String url , java.lang.String username , java.lang.String password ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVMList ( url , username , password ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( 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 convertVmFromExternalSystem ( java.lang.String url , java.lang.String user , java.lang.String password , java.util.Map < java.lang.String , java.lang.Object > vm , java.lang.String jobUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.convertExternalVm ( url , user , password , vm , jobUUID ) ; 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 org.ovirt.engine.core.bll.network.macpool.MacPool getMacPoolWithoutLocking ( org.ovirt.engine.core.compat.Guid macPoolId , java.util.List < org.ovirt.engine.core.bll.network.macpool.MacPoolDecorator > decorators ) { final org.ovirt.engine.core.bll.network.macpool.MacPool poolById = macPools.get ( macPoolId ) ; if ( poolById == null ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.INEXISTENT_POOL_EXCEPTION_MESSAGE ) ; } return decoratedMacPoolFactory.createDecoratedPool ( poolById , decorators ) ; }

Target:
private org.ovirt.engine.core.bll.network.macpool.MacPool getMacPoolWithoutLocking ( org.ovirt.engine.core.compat.Guid macPoolId , java.util.List < org.ovirt.engine.core.bll.network.macpool.MacPoolDecorator > decorators ) { final org.ovirt.engine.core.bll.network.macpool.MacPool poolById = macPools.get ( macPoolId ) ; if ( poolById == null ) { throw new java.lang.IllegalStateException ( createExceptionMessageMacPoolHavingIdDoesNotExist ( macPoolId ) ) ; } return decoratedMacPoolFactory.createDecoratedPool ( poolById , decorators ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc setStorageDomainDescription ( java.lang.String sdUUID , java.lang.String description ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StorageDomain.setDescription" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "description" , description ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn setStorageDomainDescription ( java.lang.String sdUUID , java.lang.String description ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StorageDomain.setDescription" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "description" , description ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public void testFetchSpecificQuotaUsageForSpecificCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByClusterGuid ( FixturesTool.CLUSTER_RHEL6_ISCSI , FixturesTool.QUOTA_SPECIFIC ) ; org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster = quotaClusterList.get ( 0 ) ; org.junit.Assert.assertNotNull ( quotaCluster ) ; org.junit.Assert.assertEquals ( 1 , quotaClusterList.size ( ) ) ; org.junit.Assert.assertEquals ( java.lang.Integer.valueOf ( 10 ) , quotaCluster.getVirtualCpu ( ) ) ; }

Target:
public void testFetchSpecificQuotaUsageForSpecificCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByClusterGuid ( FixturesTool.CLUSTER_RHEL6_ISCSI , FixturesTool.QUOTA_SPECIFIC ) ; org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster = quotaClusterList.get ( 0 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( quotaCluster ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , quotaClusterList.size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( java.lang.Integer.valueOf ( 10 ) , quotaCluster.getVirtualCpu ( ) ) ; }
Source:
public void validateFails ( ) { org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( ) ; params.setActionType ( "InvalidActionType" ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( params , null ) ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; params.setClusterId ( null ) ; params.setServerId ( null ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsOnNull ( ) { cmd.getParameters ( ) . setServiceType ( ServiceType.NFS ) ; cmd.getParameters ( ) . setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_START ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
private void canDoActionUpdateWipeAfterDelete ( org.ovirt.engine.core.common.businessentities.VMStatus status ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = createDiskImage ( ) ; disk.setReadOnly ( false ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.getDiskInfo ( ) . setReadOnly ( false ) ; parameters.getDiskInfo ( ) . setWipeAfterDelete ( true ) ; initializeCommand ( parameters , java.util.Collections.singletonList ( createVm ( status ) ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
private void validateUpdateWipeAfterDelete ( org.ovirt.engine.core.common.businessentities.VMStatus status ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = createDiskImage ( ) ; disk.setReadOnly ( false ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.getDiskInfo ( ) . setReadOnly ( false ) ; parameters.getDiskInfo ( ) . setWipeAfterDelete ( true ) ; initializeCommand ( parameters , java.util.Collections.singletonList ( createVm ( status ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig getHostNicVfsConfigToAdd ( org.ovirt.engine.core.common.businessentities.HostDevice device ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = hostNicVfsConfigHelper.getNicByPciDevice ( device ) ; if ( nic == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig hostNicVfsConfig = new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( ) ; hostNicVfsConfig.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; hostNicVfsConfig.setNicId ( nic.getId ( ) ) ; hostNicVfsConfig.setAllNetworksAllowed ( true ) ; return hostNicVfsConfig ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig getHostNicVfsConfigToRemove ( org.ovirt.engine.core.common.businessentities.HostDevice device ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = hostNicVfsConfigHelper.getNicByPciDevice ( device , oldMap.values ( ) ) ; if ( nic == null ) { return null ; } return hostNicVfsConfigDao.getByNicId ( nic.getId ( ) ) ; }
Source:
private void createCluster ( ) { cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setName ( CLUSTER_NAME ) ; cluster.setDescription ( CLUSTER_DESCRIPTION ) ; cluster.setStoragePoolId ( DATA_CENTER_ID ) ; cluster.setCpuName ( CPU_NAME ) ; cluster.setMaxVdsMemoryOverCommit ( MAX_VDS_MEMORY_OVER_COMMIT ) ; cluster.setCountThreadsAsCores ( COUNT_THREADS_AS_CORES ) ; cluster.setTransparentHugepages ( SET_TRANSPARENT_HUGE_PAGES ) ; cluster.setCompatibilityVersion ( SET_COMPATIBILITY_VERSION ) ; cluster.setMigrateOnError ( MIGRATE_ON_ERROR ) ; cluster.setArchitecture ( ARCHITECTURE_TYPE ) ; }

Target:
private void createCluster ( ) { cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setName ( CLUSTER_NAME ) ; cluster.setDescription ( CLUSTER_DESCRIPTION ) ; cluster.setStoragePoolId ( DATA_CENTER_ID ) ; cluster.setCpuName ( CPU_NAME ) ; cluster.setMaxVdsMemoryOverCommit ( MAX_VDS_MEMORY_OVER_COMMIT ) ; cluster.setCountThreadsAsCores ( COUNT_THREADS_AS_CORES ) ; cluster.setTransparentHugepages ( SET_TRANSPARENT_HUGE_PAGES ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.bll.AddClusterCommandTest.SET_COMPATIBILITY_VERSION ) ; cluster.setMigrateOnError ( MIGRATE_ON_ERROR ) ; cluster.setArchitecture ( ARCHITECTURE_TYPE ) ; }
Source:
public void testIscsiLunCannotBeAddedIfSgioIsFilteredAndScsiReservationEnabled ( ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = createISCSILunDisk ( ScsiGenericIO.FILTERED , true , DiskInterface.IDE ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; mockVm ( ) ; mockInterfaceList ( ) ; org.junit.Assert.assertFalse ( "Lun disk added successfully WHILE sgio is filtered and scsi reservation is enabled" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; verifyCanDoActionMessagesContainMessage ( EngineMessage.ACTION_TYPE_FAILED_SGIO_IS_FILTERED ) ; }

Target:
public void testIscsiLunCannotBeAddedIfSgioIsFilteredAndScsiReservationEnabled ( ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = createISCSILunDisk ( ScsiGenericIO.FILTERED , true , DiskInterface.IDE ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; mockVm ( ) ; mockInterfaceList ( ) ; org.junit.Assert.assertFalse ( "Lun disk added successfully WHILE sgio is filtered and scsi reservation is enabled" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; verifyValidationMessagesContainMessage ( EngineMessage.ACTION_TYPE_FAILED_SGIO_IS_FILTERED ) ; }
Source:
public void execute ( int iterationId ) { try { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( getStorageDomain ( ) . getstorage_type ( ) ) . connectStorageToDomainByVdsId ( getStorageDomain ( ) , getVdss ( ) . get ( iterationId ) . getId ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.storage.ConnectSingleAsyncOperation.log.errorFormat ( "Failed to connect host {0} to storage pool {1}. Exception: {3}" , getVdss ( ) . get ( iterationId ) . getVdsName ( ) , getStoragePool ( ) . getname ( ) , e ) ; } }

Target:
public void execute ( int iterationId ) { try { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( getStorageDomain ( ) . getStorageType ( ) ) . connectStorageToDomainByVdsId ( getStorageDomain ( ) , getVdss ( ) . get ( iterationId ) . getId ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.storage.ConnectSingleAsyncOperation.log.errorFormat ( "Failed to connect host {0} to storage pool {1}. Exception: {3}" , getVdss ( ) . get ( iterationId ) . getName ( ) , getStoragePool ( ) . getname ( ) , e ) ; } }