auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void analyzeExpression ( org.ovirt.api.metamodel.analyzer.MethodExpression expression , java.util.List < org.ovirt.api.metamodel.concepts.Parameter > parameters , boolean mandatory ) { java.util.Stack < org.ovirt.api.metamodel.concepts.Name > stack = new java.util.Stack < > ( ) ; stackExpressionElements ( stack , expression ) ; org.ovirt.api.metamodel.concepts.Parameter parameter = getParameter ( stack.pop ( ) , parameters ) ; updateParameter ( stack , mandatory , parameter ) ; }

Target:
private org.ovirt.api.metamodel.concepts.MemberInvolvementTree analyzeExpression ( org.ovirt.api.metamodel.analyzer.MethodExpression expression , java.util.List < org.ovirt.api.metamodel.concepts.Parameter > parameters , boolean mandatory ) { java.util.Stack < org.ovirt.api.metamodel.concepts.Name > stack = new java.util.Stack < > ( ) ; stackExpressionElements ( stack , expression ) ; org.ovirt.api.metamodel.concepts.Parameter parameter = getParameter ( stack.pop ( ) , parameters ) ; return updateParameter ( stack , mandatory , parameter ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute sync getIsUserLoggedIn: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.OnFailure ( null ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute sync getIsUserLoggedIn: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.OnFailure ( null ) ; }
Source:
private org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.compat.Guid > , org.ovirt.engine.core.compat.Guid > externalRunBalance ( org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl policyUnit , org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { java.util.List < org.ovirt.engine.core.compat.Guid > hostIDs = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hosts ) { hostIDs.add ( vds.getId ( ) ) ; } return org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerFactory.getInstance ( ) . runBalance ( policyUnit.getName ( ) , hostIDs , cluster.getClusterPolicyProperties ( ) ) ; }

Target:
private org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.compat.Guid > , org.ovirt.engine.core.compat.Guid > externalRunBalance ( org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl policyUnit , org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { java.util.List < org.ovirt.engine.core.compat.Guid > hostIDs = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hosts ) { hostIDs.add ( vds.getId ( ) ) ; } return org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerFactory.getInstance ( ) . runBalance ( policyUnit.getPolicyUnit ( ) . getName ( ) , hostIDs , cluster.getClusterPolicyProperties ( ) ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( command == ( runOnceCommand ) ) { if ( Validate ( ) ) { onRunOnce ( ) ; } } else if ( command == ( cancelCommand ) ) { commandTarget.executeCommand ( command ) ; } }

Target:
public void updateInitialRunFields ( ) { getIsSysprepPossible ( ) . setEntity ( getIsWindowsOS ( ) ) ; getIsSysprepEnabled ( ) . setEntity ( ( ( getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.Sysprep ) ) ) ; getIsCloudInitPossible ( ) . setEntity ( getIsLinuxOS ( ) ) ; getIsCloudInitEnabled ( ) . setEntity ( ( ( getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.CloudInit ) ) ) ; }
Source:
public void testAllowUseHostCpuWithX86Arch ( ) { prepareVmToPassValidate ( ) ; command.initEffectiveCompatibilityVersion ( ) ; vm.setClusterArch ( ArchitectureType.x86_64 ) ; vmStatic.setUseHostCpuFlags ( true ) ; vmStatic.setMigrationSupport ( MigrationSupport.PINNED_TO_HOST ) ; boolean validInput = command.validate ( ) ; org.junit.Assert.assertTrue ( validInput ) ; }

Target:
public void testAllowUseHostCpuWithX86Arch ( ) { prepareVmToPassValidate ( ) ; command.initEffectiveCompatibilityVersion ( ) ; vm.setClusterArch ( ArchitectureType.x86_64 ) ; vmStatic.setUseHostCpuFlags ( true ) ; vmStatic.setMigrationSupport ( MigrationSupport.PINNED_TO_HOST ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public void validateFailedVirtIODisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 0 ) ) . thenReturn ( "RHEL6" ) ; createNotVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.HOT_PLUG_IDE_DISK_IS_NOT_SUPPORTED.toString ( ) ) ) ; }

Target:
public void validateFailedVirtIODisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 0 ) ) . thenReturn ( "RHEL6" ) ; createNotVirtIODisk ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.HOT_PLUG_IDE_DISK_IS_NOT_SUPPORTED ) ; }
Source:
protected void setDefaultMigrationPolicy ( ) { if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) ) != null ) { boolean isMigrationSupported = org.ovirt.engine.core.common.FeatureSupported.isMigrationSupported ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getArchitecture ( ) , org.ovirt.engine.core.bll.AddVmCommand.getEffectiveCompatibilityVersion ( ) ) ; org.ovirt.engine.core.common.businessentities.MigrationSupport migrationSupport = ( isMigrationSupported ) ? org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE : org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ; org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . setMigrationSupport ( migrationSupport ) ; } }

Target:
protected void setDefaultMigrationPolicy ( ) { if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) ) != null ) { boolean isMigrationSupported = org.ovirt.engine.core.common.FeatureSupported.isMigrationSupported ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getArchitecture ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; org.ovirt.engine.core.common.businessentities.MigrationSupport migrationSupport = ( isMigrationSupported ) ? org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE : org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ; org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . setMigrationSupport ( migrationSupport ) ; } }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue extendUnderlyingVolumeSize ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { org.ovirt.engine.core.common.vdscommands.ExtendImageSizeVDSCommandParameters params = new org.ovirt.engine.core.common.vdscommands.ExtendImageSizeVDSCommandParameters ( diskImage.getStoragePoolId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getId ( ) , diskImage.getImageId ( ) , org.ovirt.engine.core.bll.ExtendImageSizeCommand.getParameters ( ) . getNewSize ( ) ) ; return runVdsCommand ( VDSCommandType.ExtendImageSize , params ) ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue extendUnderlyingVolumeSize ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { org.ovirt.engine.core.common.vdscommands.ExtendImageSizeVDSCommandParameters params = new org.ovirt.engine.core.common.vdscommands.ExtendImageSizeVDSCommandParameters ( diskImage.getStoragePoolId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getId ( ) , diskImage.getImageId ( ) , org.ovirt.engine.core.bll.ExtendImageSizeCommand.getParameters ( ) . getNewSize ( ) ) ; return runVdsCommand ( VDSCommandType.ExtendImageSize , params ) ; }
Source:
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.Quota > ( ) ; } return ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ) ( source ) ) ; }

Target:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public static void GetProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { ( ( org.ovirt.engine.ui.common.widget.AddRemoveRowWidget < M , T , V > . AddRemoveRowPanel ) ( item.getSecond ( ) . getParent ( ) ) ) . swapButton ( createButton ( item ) ) ; addGhostEntry ( ) ; }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < T > event ) { T value = event.getValue ( ) ; boolean becomingGhost = isGhost ( value ) ; if ( becomingGhost != ( wasGhost ) ) { ( ( org.ovirt.engine.ui.common.widget.AddRemoveRowWidget < M , T , V > . AddRemoveRowPanel ) ( widget.getParent ( ) ) ) . setButtonEnabled ( ( ! becomingGhost ) ) ; toggleGhost ( value , widget , becomingGhost ) ; wasGhost = becomingGhost ; } }
Source:
public void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private boolean checkIsDomainLocked ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap domainMap ) { if ( ( ( domainMap.getStatus ( ) ) != null ) && ( domainMap.getStatus ( ) . isStorageDomainInProcess ( ) ) ) { addInvalidSDStatusMessage ( StorageDomainStatus.Locked ) ; return true ; } return false ; }

Target:
protected org.ovirt.engine.core.compat.Guid getNewMasterStorageDomainId ( ) { if ( ( newMasterStorageDomainId ) == null ) { newMasterStorageDomain = electNewMaster ( true , org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.getParameters ( ) . isCanChooseInactiveDomainAsMaster ( ) , org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.getParameters ( ) . isCanChooseCurrentMasterAsNewMaster ( ) ) ; newMasterStorageDomainId = ( ( newMasterStorageDomain ) != null ) ? newMasterStorageDomain.getId ( ) : org.ovirt.engine.core.compat.Guid.Empty ; } return newMasterStorageDomainId ; }
Source:
public static void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
protected void entityPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . entityPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "IsSelectedNullable" ) ) { org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel selectionTreeNodeModel = ( ( org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel ) ( sender ) ) ; org.ovirt.engine.ui.uicommonweb.models.tags.TagModel tagModel = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagModel ) ( selectionTreeNodeModel.getEntity ( ) ) ) ; tagModel.setSelection ( selectionTreeNodeModel.getIsSelectedNullable ( ) ) ; onTagSelectionChanged ( tagModel , e ) ; } }

Target:
protected void entityPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . entityPropertyChanged ( sender , e ) ; if ( e.propertyName.equals ( "IsSelectedNullable" ) ) { org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel selectionTreeNodeModel = ( ( org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel ) ( sender ) ) ; org.ovirt.engine.ui.uicommonweb.models.tags.TagModel tagModel = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagModel ) ( selectionTreeNodeModel.getEntity ( ) ) ) ; tagModel.setSelection ( selectionTreeNodeModel.getIsSelectedNullable ( ) ) ; onTagSelectionChanged ( tagModel , e ) ; } }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( "{ skipFencingIfSDActive=" ) ; sb.append ( skipFencingIfSDActive ) ; sb.append ( ", skipFencingIfConnectivityBroken=" ) ; sb.append ( skipFencingIfConnectivityBroken ) ; sb.append ( ", hostsWithBrokenConnectivityThreshold=" ) ; sb.append ( hostsWithBrokenConnectivityThreshold ) ; sb.append ( " }" ) ; return sb.toString ( ) ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( "{ fencingEnabled=" ) ; sb.append ( fencingEnabled ) ; sb.append ( ", skipFencingIfSDActive=" ) ; sb.append ( skipFencingIfSDActive ) ; sb.append ( ", skipFencingIfConnectivityBroken=" ) ; sb.append ( skipFencingIfConnectivityBroken ) ; sb.append ( ", hostsWithBrokenConnectivityThreshold=" ) ; sb.append ( hostsWithBrokenConnectivityThreshold ) ; sb.append ( " }" ) ; return sb.toString ( ) ; }
Source:
public void update ( int index , org.ovirt.engine.core.common.businessentities.QuotaStorage object , java.lang.Boolean value ) { if ( value ) { selectedStorageGuid.add ( object.getStorageId ( ) ) ; } else { selectedStorageGuid.remove ( object.getStorageId ( ) ) ; object.setStorageSizeGB ( null ) ; } if ( ( ( java.lang.Boolean ) ( model.getGlobalStorageQuota ( ) . getEntity ( ) ) ) ) { quotaStorageTable.edit ( model.getQuotaStorages ( ) ) ; } else { quotaStorageTable.edit ( model.getAllDataCenterStorages ( ) ) ; } }

Target:
public java.lang.Boolean getValue ( org.ovirt.engine.core.common.businessentities.QuotaStorage object ) { if ( ( selectedStorageGuid.contains ( object.getStorageId ( ) ) ) || ( ( object.getStorageSizeGB ( ) ) != null ) ) { if ( ! ( selectedStorageGuid.contains ( object.getStorageId ( ) ) ) ) { selectedStorageGuid.add ( object.getStorageId ( ) ) ; } return true ; } return false ; }
Source:
public void testEnd ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.EndExternalJob , org.ovirt.engine.core.common.action.EndExternalJobParameters.class , new java.lang.String [ ] { "JobId" , "Status" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.job.JobExecutionStatus.FINISHED , false } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setStatus ( JobStatus.FINISHED.value ( ) ) ; verifyActionResponse ( resource.end ( action ) ) ; }

Target:
public void testEnd ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.EndExternalJob , org.ovirt.engine.core.common.action.EndExternalJobParameters.class , new java.lang.String [ ] { "JobId" , "Status" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , true , false } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setSucceeded ( true ) ; verifyActionResponse ( resource.end ( action ) ) ; }
Source:
public void testIncreaseStoragePoolMasterVersion ( ) { int result = dao.increaseStoragePoolMasterVersion ( existingPool.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dbPool = dao.get ( existingPool.getId ( ) ) ; org.junit.Assert.assertEquals ( result , ( ( existingPool.getmaster_domain_version ( ) ) + 1 ) ) ; org.junit.Assert.assertEquals ( result , dbPool.getmaster_domain_version ( ) ) ; }

Target:
public void testIncreaseStoragePoolMasterVersion ( ) { int result = dao.increaseStoragePoolMasterVersion ( existingPool.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dbPool = dao.get ( existingPool.getId ( ) ) ; org.junit.Assert.assertEquals ( result , ( ( existingPool.getMasterDomainVersion ( ) ) + 1 ) ) ; org.junit.Assert.assertEquals ( result , dbPool.getMasterDomainVersion ( ) ) ; }
Source:
public void validateFailedGuestOsIsNotSupported ( ) { mockInterfaceList ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( 15 ) ; createVirtIODisk ( ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getOsName ( 15 ) ) . thenReturn ( "RHEL3x64" ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getDiskHotpluggableInterfaces ( org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.emptySet ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; }

Target:
public void validateFailedGuestOsIsNotSupported ( ) { mockInterfaceList ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( 15 ) ; createVirtIODisk ( ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getOsName ( 15 ) ) . thenReturn ( "RHEL3x64" ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getDiskHotpluggableInterfaces ( org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.emptySet ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ; }
Source:
private void initializeItems ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > items = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getIsoStorageModels ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel tempVar2 = new org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ( ) ; tempVar2.setRole ( StorageDomainType.ImportExport ) ; items.add ( tempVar2 ) ; items.addAll ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getFileDataStorageModels ( ) ) ; items.addAll ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getImportBlockDataStorageModels ( ) ) ; getModel ( ) . setItems ( items ) ; }

Target:
private void initializeItems ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > items = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getIsoStorageModels ( ) ; items.addAll ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getExportStorageModels ( ) ) ; items.addAll ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getFileDataStorageModels ( ) ) ; items.addAll ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getImportBlockDataStorageModels ( ) ) ; getModel ( ) . setItems ( items ) ; }
Source:
public void testValidateQosNotPartiallyConfigured ( ) { org.junit.Assert.fail ( ) ; }

Target:
public void testValidateQosNotPartiallyConfiguredWhenNotUpdatingAttachments ( ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setHost ( host ) . setParams ( new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) . build ( ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments = java.util.Collections.emptyList ( ) ; org.junit.Assert.assertThat ( validator.validateQosNotPartiallyConfigured ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testDedicatedHostNotExistOrNotSameCluster ( ) { prepareVmToPassValidate ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isDedicatedVdsExistOnSameCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmBase.class ) , org.mockito.Matchers.any ( java.util.ArrayList.class ) ) ; vmStatic.setDedicatedVmForVdsList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "validate should have failed with invalid dedicated host." , command.validate ( ) ) ; }

Target:
public void testDedicatedHostNotExistOrNotSameCluster ( ) { prepareVmToPassValidate ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isDedicatedVdsExistOnSameCluster ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmBase.class ) , org.mockito.ArgumentMatchers.any ( java.util.ArrayList.class ) ) ; vmStatic.setDedicatedVmForVdsList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "validate should have failed with invalid dedicated host." , command.validate ( ) ) ; }
Source:
public void testConnectionWithInvalidMountOptionsFails ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.NFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ) . when ( getCommand ( ) ) . validateMountOptions ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( getCommand ( ) , EngineMessage.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ; }

Target:
public void testPosixEmptyVFSType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , null , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VALIDATION_STORAGE_CONNECTION_EMPTY_VFSTYPE ) ; }
Source:
public void getClusterUnsupportedVmsCpus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vdsGroupId , java.lang.String newCpuName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.HashMap ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterUnsupportedVmsCpus , new org.ovirt.engine.core.common.queries.GetClusterUnsupportedVmsCpusParameters ( vdsGroupId , newCpuName ) , aQuery ) ; }

Target:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }
Source:
private void setUpMocksForUpdate ( boolean hookFound , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook , org.ovirt.engine.core.common.businessentities.VDSStatus status ) { setupMocks ( hookFound , hook ) ; org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getServer ( org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommandTest.SERVER_ID , "gfs1" , org.ovirt.engine.core.bll.gluster.CLUSTER_ID , status ) ) ; }

Target:
private void setUpMocksForUpdate ( boolean hookFound , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook , org.ovirt.engine.core.common.businessentities.VDSStatus status ) { setupMocks ( hookFound , hook ) ; org.mockito.Mockito.when ( vdsDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getServer ( org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommandTest.SERVER_ID , "gfs1" , org.ovirt.engine.core.bll.gluster.CLUSTER_ID , status ) ) ; }
Source:
protected void initDetailModels ( ) { super . initDetailModels ( ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.providers.ProviderGeneralModel ( ) ) ; providerNetworkListModel = new org.ovirt.engine.ui.uicommonweb.models.providers.ProviderNetworkListModel ( ) ; list.add ( providerNetworkListModel ) ; setDetailModels ( list ) ; }

Target:
private void setModelList ( final org.ovirt.engine.ui.uicommonweb.models.providers.ProviderGeneralModel providerGeneralModel , final org.ovirt.engine.ui.uicommonweb.models.providers.ProviderNetworkListModel providerNetworkListModel ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( providerGeneralModel ) ; list.add ( providerNetworkListModel ) ; setDetailModels ( list ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Permission model , int index ) { super . verifyModel ( model , index ) ; assertTrue ( model.isSetGroup ( ) ) ; assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getGroup ( ) . getId ( ) ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Permission model , int index ) { super . verifyModel ( model , index ) ; org.junit.Assert.assertTrue ( model.isSetGroup ( ) ) ; org.junit.Assert.assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getGroup ( ) . getId ( ) ) ; }
Source:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean doRefresh ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.SearchParameters params = new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , ( doRefresh ? params : params.withoutRefresh ( ) ) , aQuery ) ; }
Source:
public void networksUsedByAVmMultipleNetworks ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network net = mockNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.Network net2 = mockNetwork ( ) ; networksUsedTest ( false , true , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_PROVIDER_NETWORKS_USED_MULTIPLE_TIMES ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.hamcrest.CoreMatchers.containsString ( net.getName ( ) ) ) ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.hamcrest.CoreMatchers.containsString ( net2.getName ( ) ) ) ) ) ) ; }

Target:
public void networksUsedByAVmMultipleNetworks ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network net = mockNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.Network net2 = mockNetwork ( ) ; networksUsedTest ( false , true , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_PROVIDER_NETWORKS_USED_MULTIPLE_TIMES ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.hamcrest.CoreMatchers.containsString ( net.getName ( ) ) ) ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.hamcrest.CoreMatchers.containsString ( net2.getName ( ) ) ) ) ) ) ; }
Source:
public static org.ovirt.engine.core.compat.RpmVersion getOvirtHostOsVersion ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { return new org.ovirt.engine.core.compat.RpmVersion ( vds.getHostOs ( ) , "RHEV Hypervisor -" , true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.VdsHandler.log.errorFormat ( "Failed to parse version of Host {0},{1} and Host OS '{2}' with error {3}" , vds.getId ( ) , vds.getName ( ) , vds.getHostOs ( ) , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } return null ; }

Target:
public static org.ovirt.engine.core.compat.RpmVersion getOvirtHostOsVersion ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { return new org.ovirt.engine.core.compat.RpmVersion ( vds.getHostOs ( ) , "RHEV Hypervisor -" , true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.VdsHandler.log.error ( "Failed to parse version of Host '{}','{}' and Host OS '{}': {}" , vds.getId ( ) , vds.getName ( ) , vds.getHostOs ( ) , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; org.ovirt.engine.core.bll.VdsHandler.log.debug ( "Exception" , e ) ; } return null ; }
Source:
public static void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isVirtIoScsiValid ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.bll.ValidationResult result = verifyVirtIoScsi ( vm ) ; if ( ! ( result.isValid ( ) ) ) { return result ; } if ( vm != null ) { if ( ! ( isVirtioScsiControllerAttached ( vm.getId ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.CANNOT_PERFORM_ACTION_VIRTIO_SCSI_IS_DISABLED ) ; } else { return isDiskInterfaceSupported ( vm ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isVirtIoScsiValid ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.bll.ValidationResult result = verifyVirtIoScsi ( vm ) ; if ( ! ( result.isValid ( ) ) ) { return result ; } if ( ( vm != null ) && ( ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.VirtIO_SCSI ) == ( diskVmElement.getDiskInterface ( ) ) ) ) { if ( ! ( isVirtioScsiControllerAttached ( vm.getId ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.CANNOT_PERFORM_ACTION_VIRTIO_SCSI_IS_DISABLED ) ; } else { return isDiskInterfaceSupported ( vm ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void postDisplayTypeItemChanged ( org.ovirt.engine.core.common.businessentities.DisplayType oldDisplayProtocolOption ) { java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > displayProtocolOptions = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DisplayType > ( ) ; if ( ( getModel ( ) . getDisplayProtocol ( ) . getItems ( ) ) != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.DisplayType > item : getModel ( ) . getDisplayProtocol ( ) . getItems ( ) ) { displayProtocolOptions.add ( item.getEntity ( ) ) ; } } if ( ( oldDisplayProtocolOption != null ) && ( displayProtocolOptions.contains ( oldDisplayProtocolOption ) ) ) { selectDisplayProtocol ( oldDisplayProtocolOption ) ; } }

Target:
protected void commonInitialize ( ) { priorityUtil = new org.ovirt.engine.ui.uicommonweb.models.vms.PriorityUtil ( getModel ( ) ) ; virtioScsiUtil = new org.ovirt.engine.ui.uicommonweb.models.vms.VirtioScsiUtil ( getModel ( ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createDefaultVdsGroup ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setCpuName ( "Intel Conroe" ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DC_ID1 ) ; group.setArchitecture ( ArchitectureType.x86_64 ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createDefaultVdsGroup ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setCpuName ( "Intel Conroe" ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DC_ID1 ) ; group.setArchitecture ( ArchitectureType.x86_64 ) ; group.setClusterPolicyId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return group ; }
Source:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ) ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.resource.get ( ) ) ) ; }
Source:
private void updateNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ex , java.lang.String message ) { org.ovirt.engine.core.common.errors.VDSError error = ex.getVdsError ( ) ; if ( error == null ) { error = new org.ovirt.engine.core.common.errors.VDSError ( org.ovirt.engine.core.common.errors.VdcBllErrors.VDS_NETWORK_ERROR , message ) ; ex.setVdsError ( error ) ; } error.setVdsId ( getVds ( ) . getId ( ) ) ; }

Target:
private void updateNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ex , java.lang.String message ) { org.ovirt.engine.core.common.errors.VDSError error = ex.getVdsError ( ) ; if ( error == null ) { error = new org.ovirt.engine.core.common.errors.VDSError ( org.ovirt.engine.core.common.errors.EngineError.VDS_NETWORK_ERROR , message ) ; ex.setVdsError ( error ) ; } error.setVdsId ( getVds ( ) . getId ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.TaskInfoReturnForXmlRpc getTaskInfo ( java.lang.String taskUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getTaskInfo ( taskUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.TaskInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.TaskInfoReturnForXmlRpc ( 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.gluster.GlusterHookContentInfoReturnForXmlRpc glusterHookRead ( java.lang.String glusterCommand , java.lang.String stage , java.lang.String hookName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterHookRead ( glusterCommand , stage , hookName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterHookContentInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterHookContentInfoReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void canDoActionInvalidSourceDomain ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = initStorageDomain ( srcStorageId ) ; storageDomain.setStatus ( StorageDomainStatus.Locked ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL.toString ( ) ) ) ; }

Target:
public void canDoActionInvalidSourceDomain ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = initStorageDomain ( srcStorageId ) ; storageDomain.setStatus ( StorageDomainStatus.Locked ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL.toString ( ) ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.IpV6Address createIpv6Address ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol ipv6BootProtocol ) { org.ovirt.engine.core.common.businessentities.network.IpV6Address primaryIpv6Address = new org.ovirt.engine.core.common.businessentities.network.IpV6Address ( ) ; primaryIpv6Address.setBootProtocol ( ipv6BootProtocol ) ; primaryIpv6Address.setAddress ( randomIpv6Address ( ) ) ; primaryIpv6Address.setGateway ( randomIpv6Address ( ) ) ; primaryIpv6Address.setPrefix ( 64 ) ; return primaryIpv6Address ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.IpV6Address createIpv6Address ( org.ovirt.engine.core.common.businessentities.network.Ipv6BootProtocol ipv6BootProtocol ) { org.ovirt.engine.core.common.businessentities.network.IpV6Address primaryIpv6Address = new org.ovirt.engine.core.common.businessentities.network.IpV6Address ( ) ; primaryIpv6Address.setBootProtocol ( ipv6BootProtocol ) ; primaryIpv6Address.setAddress ( randomIpv6Address ( ) ) ; primaryIpv6Address.setGateway ( randomIpv6Address ( ) ) ; primaryIpv6Address.setPrefix ( 64 ) ; return primaryIpv6Address ; }
Source:
void AddVmStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics stats = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; stats.setId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmStatisticsDAO ( ) . save ( stats ) ; org.ovirt.engine.core.bll.AddVmCommand.getCompensationContext ( ) . snapshotNewEntity ( stats ) ; }

Target:
void addVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; tempVar.setstatus ( VMStatus.Down ) ; tempVar.setvm_host ( "" ) ; tempVar.setvm_ip ( "" ) ; tempVar.setdisplay_type ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getdefault_display_type ( ) ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = tempVar ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . save ( vmDynamic ) ; org.ovirt.engine.core.bll.AddVmCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDynamic ) ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel object ) { super . edit ( object ) ; object.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 ) { if ( ( object.getProgress ( ) ) == null ) { disableAllTabs ( ) ; enableEditPoolFields ( object ) ; } } } ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel object ) { super . edit ( object ) ; object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override 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 ( ( object.getProgress ( ) ) == null ) { disableAllTabs ( ) ; enableEditPoolFields ( object ) ; } } } ) ; }