auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( returnValue2 ) ) ; this . allNics = allNics ; initNicModels ( ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > bonds = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; allBonds = bonds ; queryLabels ( ) ; }
Source:
public void diskImagesNotIllegalBothIllegal ( ) { disk1.setImageStatus ( ImageStatus.ILLEGAL ) ; disk2.setImageStatus ( ImageStatus.ILLEGAL ) ; org.junit.Assert.assertThat ( validator.diskImagesNotIllegal ( ) , org.junit.matchers.JUnitMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_ILLEGAL ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.junit.matchers.JUnitMatchers.hasItem ( org.ovirt.engine.core.bll.validator.DiskImagesValidatorTest.createAliasReplacements ( disk1 , disk2 ) ) ) ) ) ; }

Target:
public void diskImagesNotIllegalBothIllegal ( ) { disk1.setImageStatus ( ImageStatus.ILLEGAL ) ; disk2.setImageStatus ( ImageStatus.ILLEGAL ) ; org.junit.Assert.assertThat ( validator.diskImagesNotIllegal ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_ILLEGAL ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.DiskImagesValidatorTest.createAliasReplacements ( disk1 , disk2 ) ) ) ) ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( obj == null ) || ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ) ) ) { return false ; } if ( ! ( super . equals ( obj ) ) ) { return false ; } return org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getId ( ) , ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ) ( obj ) ) . getId ( ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( obj == null ) || ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ) ) ) { return false ; } if ( ! ( super . equals ( obj ) ) ) { return false ; } return java.util.Objects.equals ( getId ( ) , ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ) ( obj ) ) . getId ( ) ) ; }
Source:
public static boolean isLunDisk ( org.ovirt.engine.api.model.Disk disk ) { return ( disk.isSetLunStorage ( ) ) && ( ! ( disk.getLunStorage ( ) . getLogicalUnits ( ) . isEmpty ( ) ) ) ; }

Target:
public static boolean isLunDisk ( org.ovirt.engine.api.model.Disk disk ) { return ( ( disk.isSetLunStorage ( ) ) && ( disk.getLunStorage ( ) . isSetLogicalUnits ( ) ) ) && ( disk.getLunStorage ( ) . getLogicalUnits ( ) . isSetLogicalUnits ( ) ) ; }
Source:
public void stopHostSkippedDueToFencingPolicy ( ) { setupCommand ( setupCommandParams ( FenceActionType.STOP ) ) ; setupBrokerResult ( createBrokerResultMap ( 0 , "" , "on" , null ) , createBrokerResultMap ( 0 , "" , "unknown" , "skipped" ) ) ; command.execute ( ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = ( ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ) ( command.getVDSReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertEquals ( Status.SKIPPED_DUE_TO_POLICY , result.getStatus ( ) ) ; org.junit.Assert.assertEquals ( PowerStatus.UNKNOWN , result.getPowerStatus ( ) ) ; }

Target:
public void stopHostSkippedDueToFencingPolicy ( ) { setupCommand ( setupCommandParams ( FenceActionType.STOP ) ) ; setupBrokerResult ( createBrokerResultMap ( 0 , "" , "on" , null ) , createBrokerResultMap ( 0 , "" , "unknown" , "skipped" ) ) ; command.execute ( ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = ( ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ) ( command.getVDSReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( Status.SKIPPED_DUE_TO_POLICY , result.getStatus ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( PowerStatus.UNKNOWN , result.getPowerStatus ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.api.model.ReportedDevice > getDevices ( org.ovirt.engine.core.compat.Guid vmId , java.lang.String mac ) { java.util.List < org.ovirt.engine.api.model.ReportedDevice > devices = new java.util.ArrayList < org.ovirt.engine.api.model.ReportedDevice > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface iface : getDevicesCollection ( vmId ) ) { if ( org.apache.commons.lang.StringUtils.equals ( iface.getMacAddress ( ) , mac ) ) { devices.add ( org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , org.ovirt.engine.api.restapi.types.ReportedDeviceMapper.map ( iface , new org.ovirt.engine.api.model.ReportedDevice ( ) ) ) ) ; } } return devices ; }

Target:
public org.ovirt.engine.api.resource.VmNicResource getNicResource ( java.lang.String id ) { return inject ( new org.ovirt.engine.api.restapi.resource.BackendVmNicResource ( id , vmId ) ) ; }
Source:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter attachNetworkToClusterParameter = getParameters ( ) ; final org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.AttachNetworkToClusterInternal , attachNetworkToClusterParameter ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { attachLabeledNetwork ( ) ; } else { propagateFailure ( returnValue ) ; } }

Target:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter attachNetworkToClusterParameter = getParameters ( ) ; final org.ovirt.engine.core.common.action.ActionReturnValue returnValue = runInternalAction ( ActionType.AttachNetworkToClusterInternal , attachNetworkToClusterParameter ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { attachLabeledNetwork ( ) ; } else { propagateFailure ( returnValue ) ; } }
Source:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getCurrentUser ( ) . getUserId ( ) ) ) ) ) { return false ; } return true ; }

Target:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getCurrentUser ( ) . getUserId ( ) ) ) ) ) { return false ; } return true ; }
Source:
private org.ovirt.engine.core.common.businessentities.VdsNetworkInterface createBond ( java.lang.String name , java.lang.String networkName ) { return createVdsInterface ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , name , true , null , null , networkName ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VdsNetworkInterface createNicSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.Network network ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , nicName , false , null , network.getvlan_id ( ) , network.getName ( ) , network.isVmNetwork ( ) ) ; return nic ; }
Source:
public void validateInvalidDestinationDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; dstStorageDomain.setStorageDomainType ( StorageDomainType.ISO ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL.toString ( ) ) ) ; }

Target:
public void validateInvalidDestinationDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; dstStorageDomain.setStorageDomainType ( StorageDomainType.ISO ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL ) ; }
Source:
public void SetVmUnknown ( org.ovirt.engine.core.common.businessentities.VM vm ) { RemoveAsyncRunningVm ( vm.getId ( ) ) ; InternalSetVmStatus ( vm , VMStatus.Unknown ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVmId ( vm.getId ( ) ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , AuditLogType.VM_SET_TO_UNKNOWN_STATUS ) ; storeVm ( vm ) ; }

Target:
public void SetVmUnknown ( org.ovirt.engine.core.common.businessentities.VM vm ) { RemoveAsyncRunningVm ( vm.getId ( ) ) ; InternalSetVmStatus ( vm , VMStatus.Unknown ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVmId ( vm.getId ( ) ) ; auditLogDirector.log ( logable , AuditLogType.VM_SET_TO_UNKNOWN_STATUS ) ; storeVm ( vm ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.Network getGlusterNetworkId ( org.ovirt.engine.core.common.businessentities.VdsStatic server , java.lang.String networkAddress ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allNetworksInCluster = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForCluster ( server.getVdsGroupId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : allNetworksInCluster ) { if ( ( network.getCluster ( ) . isGluster ( ) ) && ( isSameNetworkAddress ( server.getId ( ) , network.getName ( ) , networkAddress ) ) ) { return network ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network getGlusterNetworkId ( org.ovirt.engine.core.common.businessentities.VdsStatic server , java.lang.String networkAddress ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allNetworksInCluster = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForCluster ( server.getClusterId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : allNetworksInCluster ) { if ( ( network.getCluster ( ) . isGluster ( ) ) && ( isSameNetworkAddress ( server.getId ( ) , network.getName ( ) , networkAddress ) ) ) { return network ; } } return null ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; if ( disk.isShareable ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( constants.shareable ( ) ) ; } return null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; if ( disk.isBoot ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( constants.bootableDisk ( ) ) ; } return null ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc createVG ( java.lang.String sdUUID , java.lang.String [ ] deviceList ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.createVG ( sdUUID , deviceList ) ; 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.irsbroker.StatusReturnForXmlRpc teardownImage ( java.lang.String sdID , java.lang.String spID , java.lang.String imageID , java.lang.String volumeID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.teardownImage ( sdID , spID , imageID , volumeID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testNullDisksUsages ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics vmStatistics = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.getVmStatistics ( ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDisksUsage ( null ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMStatisticsData ( vmStatistics , xml ) ; org.junit.Assert.assertNull ( vmStatistics.getDisksUsage ( ) ) ; }

Target:
public void testNullDisksUsages ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics vmStatistics = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.getVmStatistics ( ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDisksUsage ( null ) ; vdsBrokerObjectsBuilder.updateVMStatisticsData ( vmStatistics , xml ) ; org.junit.Assert.assertNull ( vmStatistics.getDisksUsage ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "SearchString" . equals ( args.propertyName ) ) { if ( ! ( model.isSearchValidForServerSideSorting ( ) ) ) { model.clearSortOptions ( ) ; clearColumnSort ( ) ; } } }

Target:
public void onScroll ( com.google.gwt.event.dom.client.ScrollEvent event ) { updateScrollPosition ( ) ; }
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 allocateVolume ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imgGUID , java.lang.String volUUID , java.lang.String size ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.allocateVolume ( sdUUID , spUUID , imgGUID , volUUID , size ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; }
Source:
public void testAttachFailFormatType ( ) { storageDomain.setStorageFormat ( StorageFormatType.V3 ) ; storagePool.setCompatibilityVersion ( Version.v3_0 ) ; org.ovirt.engine.core.bll.ValidationResult invalidFormatAttachingResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.junit.Assert.assertFalse ( "Attaching domain with unsupported version succeeded while it should have failed" , invalidFormatAttachingResult.isValid ( ) ) ; assertFailingMessage ( "Attaching domain with unsupported version failed with the wrong message" , invalidFormatAttachingResult , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_FORMAT_ILLEGAL ) ; }

Target:
public void testAttachFailFormatType ( ) { storageDomain.setStorageFormat ( StorageFormatType.V3 ) ; storagePool.setCompatibilityVersion ( Version.v3_0 ) ; org.ovirt.engine.core.bll.ValidationResult invalidFormatAttachingResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.junit.Assert.assertThat ( invalidFormatAttachingResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_FORMAT_ILLEGAL ) ) ; }
Source:
private static void updateConsoleDevice ( org.ovirt.engine.core.common.businessentities.VmBase newVmBase , java.lang.Boolean consoleEnabled ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateConsoleDevice ( newVmBase.getId ( ) , consoleEnabled ) ; }

Target:
public static void updateSoundDevice ( org.ovirt.engine.core.common.businessentities.VmBase oldVmBase , org.ovirt.engine.core.common.businessentities.VmBase newVmBase , org.ovirt.engine.core.compat.Version compatibilityVersion , java.lang.Boolean isSoundDeviceEnabled ) { boolean osChanged = ( oldVmBase.getOsId ( ) ) != ( newVmBase.getOsId ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateSoundDevice ( newVmBase.getId ( ) , newVmBase.getOsId ( ) , compatibilityVersion , isSoundDeviceEnabled , osChanged ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; }
Source:
public void qosBondSpeedZero ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosBondSpeedSetup ( 0 , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
public void unmanagedVlanAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; java.lang.String networkName = "net" ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic , 100 , networkName ) ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORKS_DONT_EXIST_IN_CLUSTER , networkName ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( getProvider ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_PROVIDER_DOESNT_EXIST ) ; } org.ovirt.engine.core.bll.provider.ProviderProxy providerProxy = getProviderProxy ( ) ; if ( providerProxy == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_PROVIDER_NOT_SUPPORTED , java.lang.String.format ( "$providerType %1$s" , getProvider ( ) . getType ( ) ) ) ; } org.ovirt.engine.core.bll.provider.ProviderValidator validator = getProviderProxy ( ) . getProviderValidator ( ) ; return ( validate ( validator.nameAvailable ( ) ) ) && ( validate ( validator.validateAddProvider ( ) ) ) ; }

Target:
protected boolean validate ( ) { if ( ( getProvider ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_PROVIDER_DOESNT_EXIST ) ; } org.ovirt.engine.core.bll.provider.ProviderProxy providerProxy = getProviderProxy ( ) ; if ( providerProxy == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_PROVIDER_NOT_SUPPORTED , java.lang.String.format ( "$providerType %1$s" , getProvider ( ) . getType ( ) ) ) ; } org.ovirt.engine.core.bll.provider.ProviderValidator validator = getProviderProxy ( ) . getProviderValidator ( ) ; return ( validate ( validator.nameAvailable ( ) ) ) && ( validate ( validator.validateAddProvider ( ) ) ) ; }
Source:
private org.ovirt.engine.core.dao.ClusterDao mockCluster ( ) { org.ovirt.engine.core.dao.ClusterDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.ClusterDao.class ) ; org.ovirt.engine.core.common.businessentities.Cluster value = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; value.setEmulatedMachine ( "pc-1.0" ) ; value.getRequiredRngSources ( ) . add ( VmRngDevice.Source.RANDOM ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; return mock ; }

Target:
private org.ovirt.engine.core.dao.ClusterDao mockCluster ( ) { org.ovirt.engine.core.dao.ClusterDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.ClusterDao.class ) ; org.ovirt.engine.core.common.businessentities.Cluster value = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; value.setEmulatedMachine ( "pc-1.0" ) ; value.getRequiredRngSources ( ) . add ( VmRngDevice.Source.RANDOM ) ; value.setCompatibilityVersion ( Version.v3_5 ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; return mock ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getTestCommand ( ) ) ) { Test ( ) ; } }

Target:
private void UpdatePmCommandAvailability ( ) { boolean isPm = ( ( java.lang.Boolean ) ( getIsPm ( ) . getEntity ( ) ) ) ; java.lang.Object proxySelectedItem = getPmProxyPreferencesList ( ) . getSelectedItem ( ) ; getTestCommand ( ) . setIsExecutionAllowed ( isPm ) ; getProxyUpCommand ( ) . setIsExecutionAllowed ( ( isPm && ( proxySelectedItem != null ) ) ) ; getProxyDownCommand ( ) . setIsExecutionAllowed ( ( isPm && ( proxySelectedItem != null ) ) ) ; }
Source:
public static void InitDictionaries ( ) { org.ovirt.engine.core.bll.CpuFlagsManagerHandler.log.info ( "Start initializing dictionaries" ) ; org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.clear ( ) ; for ( org.ovirt.engine.core.compat.Version ver : org.ovirt.engine.core.common.config.Config.< java.util.HashSet < org.ovirt.engine.core.compat.Version > > getValue ( ConfigValues.SupportedClusterLevels ) ) { org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.put ( ver , new org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CpuFlagsManager ( ver ) ) ; } org.ovirt.engine.core.bll.CpuFlagsManagerHandler.log.info ( "Finished initializing dictionaries" ) ; }

Target:
public static void initDictionaries ( ) { org.ovirt.engine.core.bll.CpuFlagsManagerHandler.log.info ( "Start initializing dictionaries" ) ; org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.clear ( ) ; for ( org.ovirt.engine.core.compat.Version ver : org.ovirt.engine.core.common.config.Config.< java.util.HashSet < org.ovirt.engine.core.compat.Version > > getValue ( ConfigValues.SupportedClusterLevels ) ) { org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.put ( ver , new org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CpuFlagsManager ( ver ) ) ; } org.ovirt.engine.core.bll.CpuFlagsManagerHandler.log.info ( "Finished initializing dictionaries" ) ; }
Source:
public static java.net.URI buildSsoRevokeUrl ( java.lang.String url , java.lang.String ssoToken ) { try { org.apache.http.client.utils.URIBuilder uriBuilder = new org.apache.http.client.utils.URIBuilder ( java.lang.String.format ( "%1$s/services/sso-logout" , url.substring ( 0 , url.lastIndexOf ( "/" ) ) ) ) ; uriBuilder.addParameter ( "scope" , org.ovirt.engine.sdk4.internal.SsoUtils.SCOPE ) ; uriBuilder.addParameter ( "token" , ssoToken ) ; return uriBuilder.build ( ) ; } catch ( java.net.URISyntaxException ex ) { throw new java.lang.Error ( "Failed to build SSO revoke URL" , ex ) ; } }

Target:
public static java.net.URI buildSsoRevokeUrl ( java.lang.String url , java.lang.String ssoToken ) { try { java.net.URI uri = new java.net.URI ( url ) ; org.apache.http.client.utils.URIBuilder uriBuilder = new org.apache.http.client.utils.URIBuilder ( java.lang.String.format ( "%1$s://%2$s/ovirt-engine/services/sso-logout" , uri.getScheme ( ) , uri.getAuthority ( ) ) ) ; uriBuilder.addParameter ( "scope" , org.ovirt.engine.sdk4.internal.SsoUtils.SCOPE ) ; uriBuilder.addParameter ( "token" , ssoToken ) ; return uriBuilder.build ( ) ; } catch ( java.net.URISyntaxException ex ) { throw new java.lang.Error ( "Failed to build SSO revoke URL" , ex ) ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.compat.Guid oldQos = getDiskProfileDao ( ) . get ( getProfileId ( ) ) . getQosId ( ) ; org.ovirt.engine.core.compat.Guid newQos = getProfile ( ) . getQosId ( ) ; super . executeCommand ( ) ; if ( java.util.Objects.equals ( oldQos , newQos ) ) { return ; } if ( getSucceeded ( ) ) { vmSlaPolicyUtils.refreshRunningVmsWithDiskProfile ( getProfileId ( ) ) ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.compat.Guid oldQos = diskProfileDao.get ( getProfileId ( ) ) . getQosId ( ) ; org.ovirt.engine.core.compat.Guid newQos = getProfile ( ) . getQosId ( ) ; super . executeCommand ( ) ; if ( java.util.Objects.equals ( oldQos , newQos ) ) { return ; } if ( getSucceeded ( ) ) { vmSlaPolicyUtils.refreshRunningVmsWithDiskProfile ( getProfileId ( ) ) ; } }
Source:
public org.ovirt.engine.api.v3.types.V3Cluster update ( org.ovirt.engine.api.v3.types.V3Cluster v3Cluster ) { org.ovirt.engine.api.model.Cluster v4Cluster = org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( v3Cluster ) ; org.ovirt.engine.api.v3.helpers.V3ClusterHelper.assignCompatiblePolicy ( v3Cluster , v4Cluster ) ; try { return org.ovirt.engine.api.v3.adapters.V3OutAdapters.adaptOut ( delegate.update ( v4Cluster ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } }

Target:
public org.ovirt.engine.api.v3.types.V3Cluster update ( org.ovirt.engine.api.v3.types.V3Cluster v3Cluster ) { org.ovirt.engine.api.model.Cluster v4Cluster = org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( v3Cluster ) ; org.ovirt.engine.api.v3.helpers.V3ClusterHelper.assignCompatiblePolicy ( v3Cluster , v4Cluster ) ; try { return org.ovirt.engine.api.v3.adapters.V3OutAdapters.adaptOut ( getDelegate ( ) . update ( v4Cluster ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } }
Source:
public static void getMinimalVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VMMinMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getClusterById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testCleanNotExpiredUsersSessionsWithUsers ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; }

Target:
public void testCleanNotExpiredUsersSessionsWithUsers ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; }
Source:
public static void GetRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM getVM ( org.ovirt.engine.api.model.VmPool model ) { if ( isFiltered ( ) ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmDataByPoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( model.getId ( ) ) ) , model.getId ( ) ) ; } return getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmDataByPoolName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( model.getName ( ) ) , ( "Vms: pool=" + ( model.getName ( ) ) ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM getVM ( org.ovirt.engine.api.model.VmPool model ) { if ( isFiltered ( ) ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , QueryType.GetVmDataByPoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( model.getId ( ) ) ) , model.getId ( ) ) ; } return getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , QueryType.GetVmDataByPoolName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( model.getName ( ) ) , ( "Vms: pool=" + ( model.getName ( ) ) ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vds.setVdsName ( "gfs1" ) ; vds.setClusterId ( clusterId ) ; vds.setStatus ( status ) ; return vds ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vds.setVdsName ( "gfs1" ) ; vds.setClusterId ( org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommandTest.clusterId ) ; vds.setStatus ( status ) ; return vds ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM createVmForTesting ( java.lang.String initrd , java.lang.String kernel ) { org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > spyCommand = createCommand ( ) ; mockVm ( spyCommand ) ; org.ovirt.engine.core.common.action.RunVmParams runVmParams = command.getParameters ( ) ; runVmParams.setinitrd_url ( initrd ) ; runVmParams.setkernel_url ( kernel ) ; spyCommand.CreateVm ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ; return vm ; }

Target:
public void createCommand ( ) { org.ovirt.engine.core.common.action.RunVmParams param = new org.ovirt.engine.core.common.action.RunVmParams ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > ( param ) ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . removeQuotaCommandLeftOver ( ) ; mockVmRunHandler ( ) ; mockSuccessfulSnapshotValidator ( ) ; mockVmPropertiesUtils ( ) ; mockBackend ( ) ; }
Source:
private java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > getStorageToDiskMap ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > storageToDisksMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getSourceImages ( ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( disk.getStorageIds ( ) . get ( 0 ) , disk , storageToDisksMap ) ; } return storageToDisksMap ; }

Target:
protected java.util.Collection < org.ovirt.engine.core.compat.Guid > getStorageDomainsIds ( ) { return org.ovirt.engine.core.bll.ImagesHandler.getAllStorageIdsForImageIds ( getSourceImages ( ) ) ; }
Source:
private org.ovirt.engine.api.model.Networks mapCollection ( java.util.List < org.ovirt.engine.api.model.Network > entities ) { org.ovirt.engine.api.model.Networks collection = new org.ovirt.engine.api.model.Networks ( ) ; for ( org.ovirt.engine.api.model.Network entity : entities ) { collection.getNetworks ( ) . add ( addLinks ( map ( entity ) ) ) ; } return collection ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { org.ovirt.engine.api.model.Network entity = org.ovirt.engine.api.restapi.types.NetworkMapper.map ( network , null ) ; org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond = getIscsiBond ( ) ; iscsiBond.getNetworkIds ( ) . add ( entity.getId ( ) ) ; return performAction ( VdcActionType.EditIscsiBond , new org.ovirt.engine.core.common.action.EditIscsiBondParameters ( iscsiBond ) ) ; }
Source:
private static java.util.Properties getLanguageProperties ( ) { java.util.Properties prop = new java.util.Properties ( ) ; try { prop.load ( org.ovirt.engine.core.utils.servlet.LocaleFilter.class . getResourceAsStream ( org.ovirt.engine.core.utils.servlet.LocaleFilter.LANGUAGES_FILE ) ) ; } catch ( java.io.IOException e ) { org.ovirt.engine.core.utils.servlet.LocaleFilter.log.error ( "Unable to load supported langauges file" , e ) ; } return prop ; }

Target:
private static java.util.Properties getLanguageProperties ( ) { java.util.Properties prop = new java.util.Properties ( ) ; try { prop = org.ovirt.engine.core.utils.ResourceUtils.loadProperties ( org.ovirt.engine.core.utils.servlet.LocaleFilter.class , org.ovirt.engine.core.utils.servlet.LocaleFilter.LANGUAGES_FILE ) ; } catch ( java.io.IOException e ) { org.ovirt.engine.core.utils.servlet.LocaleFilter.log.error ( "Unable to load supported langauges file" , e ) ; } return prop ; }
Source:
private void checkTrustedService ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "VmName" , getVmName ( ) ) ; if ( ( getVm ( ) . isTrustedService ( ) ) && ( ! ( getVdsGroup ( ) . supportsTrustedService ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_IMPORT_VM_FROM_TRUSTED_TO_UNTRUSTED ) ; } else if ( ( ! ( getVm ( ) . isTrustedService ( ) ) ) && ( getVdsGroup ( ) . supportsTrustedService ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_IMPORT_VM_FROM_UNTRUSTED_TO_TRUSTED ) ; } }

Target:
private org.ovirt.engine.core.common.businessentities.network.VnicProfile findVnicProfileForUser ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > networkProfiles = org.ovirt.engine.core.bll.ImportVmCommand.getVnicProfileDao ( ) . getAllForNetwork ( network.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile : networkProfiles ) { if ( profile.isPortMirroring ( ) ) { if ( isVnicProfilePermitted ( userId , profile , ActionGroup.PORT_MIRRORING ) ) { return profile ; } } else { if ( isVnicProfilePermitted ( userId , profile , ActionGroup.CONFIGURE_VM_NETWORK ) ) { return profile ; } } } return null ; }
Source:
public void testQueryWithoutHostId ( ) { org.ovirt.engine.core.common.queries.VdsIdParametersBase params = new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( ) ; org.ovirt.engine.core.bll.GetoVirtISOsQuery < org.ovirt.engine.core.common.queries.VdsIdParametersBase > query = new org.ovirt.engine.core.bll.GetoVirtISOsQuery < org.ovirt.engine.core.common.queries.VdsIdParametersBase > ( params ) ; query.setInternalExecution ( true ) ; query.ExecuteCommand ( ) ; checkSucceeded ( query , true ) ; checkReturnValue ( query ) ; }

Target:
public void testQueryWithoutHostId ( ) { getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . ExecuteCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.ovirt.engine.core.bll.GetoVirtISOsTest.checkReturnValue ( getQuery ( ) ) ; }
Source:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getTemplateListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( target ) ) ; if ( returnValue != null ) { model.setCustomPropertiesKeysList ( ( ( java.util.HashMap < org.ovirt.engine.core.compat.Version , java.util.ArrayList < java.lang.String > > ) ( returnValue ) ) ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; if ( cluster != null ) { powerAction ( actionName , title , message , cluster.isOptionalReasonRequired ( ) ) ; } }
Source:
private void clusterHasVMs ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DEFAULT_CLUSTER_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = new java.util.ArrayList < > ( ) ; vmList.add ( vm ) ; org.mockito.Mockito.when ( vmDao.getAllForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vmList ) ; }

Target:
private void clusterHasVMs ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DEFAULT_CLUSTER_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = new java.util.ArrayList < > ( ) ; vmList.add ( vm ) ; org.mockito.Mockito.when ( vmDao.getAllForCluster ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( vmList ) ; }
Source:
private static void testParseLunFromXmlRpcForDevtypeField ( org.ovirt.engine.core.common.businessentities.storage.StorageType expectedStorageType , java.lang.String mockDevtype ) { java.util.Map < java.lang.String , java.lang.Object > xlun = new java.util.HashMap < > ( ) ; xlun.put ( GetDeviceListVDSCommand.DEVTYPE_FIELD , mockDevtype ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLunFromXmlRpc ( xlun ) ; org.junit.Assert.assertEquals ( expectedStorageType , lun.getLunType ( ) ) ; }

Target:
private static void testParseLunFromXmlRpcForDevtypeField ( org.ovirt.engine.core.common.businessentities.storage.StorageType expectedStorageType , java.lang.String mockDevtype ) { java.util.Map < java.lang.String , java.lang.Object > xlun = new java.util.HashMap < > ( ) ; xlun.put ( GetDeviceListVDSCommand.DEVTYPE_FIELD , mockDevtype ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLunFromXmlRpc ( xlun , Version.v4_1 ) ; org.junit.Assert.assertEquals ( expectedStorageType , lun.getLunType ( ) ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult a ) { stopProgress ( a.getState ( ) ) ; cancel ( ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult a ) { stopProgress ( a.getState ( ) ) ; cancel ( ) ; } } , this ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.DiskImage img = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; img.setSizeInGigabytes ( size ) ; img.setActualSize ( size ) ; img.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; img.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ) ) ; return img ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.DiskImage img = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; img.setSizeInGigabytes ( size ) ; img.setActualSize ( size ) ; img.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; img.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return img ; }
Source:
public void getUsbPolicyNullUsb ( ) { org.ovirt.engine.api.model.Usb usb = null ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getcompatibility_version ( ) ) , UsbPolicy.DISABLED ) ; }

Target:
public void getUsbPolicyUsbTypeNull30 ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setCompatibilityVersion ( Version.v3_0 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getCompatibilityVersion ( ) ) , UsbPolicy.ENABLED_LEGACY ) ; }