auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void init ( org.ovirt.engine.ui.uicommonweb.models.ListModel model ) { items.clear ( ) ; contentPanel.clear ( ) ; java.lang.Iterable < T > values = model.getItems ( ) ; if ( values != null ) { for ( T value : values ) { addEntry ( value ) ; } } addGhostEntry ( ) ; }

Target:
protected void init ( M model ) { items.clear ( ) ; contentPanel.clear ( ) ; modelItems = ( ( java.util.Collection < T > ) ( model.getItems ( ) ) ) ; if ( ( modelItems ) == null ) { modelItems = new java.util.LinkedList < T > ( ) ; model.setItems ( modelItems ) ; return ; } for ( T value : modelItems ) { addEntry ( value ) ; } T additionalValue = addGhostEntry ( ) . getFirst ( ) ; modelItems.add ( additionalValue ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase checkAndPerformRollbackUsingCommand ( org.ovirt.engine.core.common.action.VdcActionType commandType , org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { return attemptRollback ( commandType , params ) ; }

Target:
protected org.ovirt.engine.core.bll.context.DefaultCompensationContext createDefaultCompensationContext ( org.ovirt.engine.core.compat.Guid commandId ) { org.ovirt.engine.core.bll.context.DefaultCompensationContext defaultContext = new org.ovirt.engine.core.bll.context.DefaultCompensationContext ( ) ; defaultContext.setCommandId ( commandId ) ; defaultContext.setCommandType ( getClass ( ) . getName ( ) ) ; defaultContext.setBusinessEntitySnapshotDao ( getBusinessEntitySnapshotDao ( ) ) ; defaultContext.setSnapshotSerializer ( org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) ) ; return defaultContext ; }
Source:
private void copyFromCommandEntity ( org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask , org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { if ( cmdEntity != null ) { asyncTask.setActionParameters ( cmdEntity.getActionParameters ( ) ) ; asyncTask.setRootCommandId ( cmdEntity.getRootCommandId ( ) ) ; asyncTask.setCommandStatus ( cmdEntity.getCommandStatus ( ) ) ; asyncTask.setCommandType ( cmdEntity.getCommandType ( ) ) ; asyncTask.setCreatedAt ( cmdEntity.getCreatedAt ( ) ) ; } }

Target:
public org.ovirt.engine.core.bll.CommandBase < ? > retrieveCommand ( org.ovirt.engine.core.compat.Guid commandId ) { return buildCommand ( commandsCache.get ( commandId ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.AsyncTasks getAsyncTaskFromDb ( org.ovirt.engine.core.compat.Guid asyncTaskId ) { org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . get ( asyncTaskId ) ; if ( asyncTask != null ) { copyFromCommandEntity ( asyncTask , commandsCache.get ( asyncTask.getCommandId ( ) ) ) ; } return asyncTask ; }

Target:
public org.ovirt.engine.core.bll.tasks.SPMAsyncTask concreteCreateTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.bll.CommandBase command , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return coCoAsyncTaskHelper.concreteCreateTask ( taskId , command , asyncTaskCreationInfo , parentCommand ) ; }
Source:
org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( java.lang.String removedNetworkName ) { final java.util.List < java.lang.String > removedNetworkNames = java.util.Collections.singletonList ( removedNetworkName ) ; final java.util.List < java.lang.String > vmsNames = findActiveVmsUsingNetwork.findNamesOfActiveVmsUsingNetworks ( host.getId ( ) , removedNetworkNames ) ; org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator detachNetworkUsedByVmValidator = new org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator ( vmsNames , removedNetworkNames ) ; return detachNetworkUsedByVmValidator.validate ( ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateQos ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure ) { org.ovirt.engine.core.bll.ValidationResult vr = org.ovirt.engine.core.bll.ValidationResult.VALID ; vr = ( skipValidation ( vr ) ) ? vr : validateQosOverriddenInterfaces ( ) ; vr = ( skipValidation ( vr ) ) ? vr : validateQosNotPartiallyConfigured ( attachmentsToConfigure ) ; return vr ; }
Source:
public void testExecuteQueryVmWithNoDisks ( ) throws java.lang.Exception { mockDAOForQuery ( ) ; vm = mockVmAndReturnFromDAO ( ) ; java.lang.String diskAliasName = org.ovirt.engine.core.bll.ImagesHandler.getDefaultDiskAlias ( vm.getName ( ) , "1" ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( diskAliasName , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) . toString ( ) ) ; }

Target:
public void testExecuteQueryVmWithNoDisks ( ) throws java.lang.Exception { mockDaoForQuery ( ) ; vm = mockVmAndReturnFromDao ( ) ; java.lang.String diskAliasName = org.ovirt.engine.core.bll.ImagesHandler.getDefaultDiskAlias ( vm.getName ( ) , "1" ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( diskAliasName , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) . toString ( ) ) ; }
Source:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolId ( ) ) != null ) { org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolDao ( ) . removeVmFromVmPool ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolId ( ) ) != null ) { org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolDao ( ) . removeVmFromVmPool ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmId ( ) ) ; if ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getParameters ( ) . isUpdatePrestartedVms ( ) ) { org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolDao ( ) . boundVmPoolPrestartedVms ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolId ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.setSucceeded ( true ) ; } }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; control.replay ( ) ; verifyModel ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpManagementNetworkExpectation ( ) ; control.replay ( ) ; final org.ovirt.engine.api.model.Cluster cluster = resource.get ( ) ; verifyModel ( cluster , 0 ) ; verifyManagementNetwork ( cluster ) ; }
Source:
private org.ovirt.engine.core.bll.gluster.ReplaceGlusterVolumeBrickCommand createTestCommand1 ( org.ovirt.engine.core.compat.Guid volumeId ) { return new org.ovirt.engine.core.bll.gluster.ReplaceGlusterVolumeBrickCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeReplaceBrickActionParameters ( volumeId , getBricks ( volumeId , "distrib" , 1 ) . get ( 0 ) , getBricks ( volumeId , "new" , 1 ) . get ( 0 ) ) , null ) ; }

Target:
private void setVolumeId ( org.ovirt.engine.core.compat.Guid volumeId ) { cmd.setGlusterVolumeId ( volumeId ) ; cmd.getParameters ( ) . setExistingBrick ( getBricks ( volumeId , "distrib" , 1 ) . get ( 0 ) ) ; cmd.getParameters ( ) . setNewBrick ( getBricks ( volumeId , "new" , 1 ) . get ( 0 ) ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVm ( ) . getName ( ) ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVm ( ) . getName ( ) , LockMessagesMatchUtil.VM_NAME ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVm ( ) . getName ( ) ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVm ( ) . getName ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_NAME , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } return null ; }
Source:
private void endDefaultOperations ( ) { endUnlockOps ( ) ; if ( isTemplateVersion ( ) ) { java.lang.String jobId = org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAOneTimeJob ( this , "updateVmVersion" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , 0 , java.util.concurrent.TimeUnit.SECONDS ) ; org.ovirt.engine.core.bll.AddVmTemplateCommand.updateVmsJobIdMap.put ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getBaseTemplateId ( ) , jobId ) ; } }

Target:
private void endDefaultOperations ( ) { endUnlockOps ( ) ; if ( isTemplateVersion ( ) ) { java.lang.String jobId = getSchedulUtil ( ) . scheduleAOneTimeJob ( this , "updateVmVersion" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , 0 , java.util.concurrent.TimeUnit.SECONDS ) ; org.ovirt.engine.core.bll.AddVmTemplateCommand.updateVmsJobIdMap.put ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getBaseTemplateId ( ) , jobId ) ; } }
Source:
public java.lang.String getDiskAlias ( ) { return org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskAlias ( ) ; }

Target:
protected java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.String > getExclusiveLocks ( ) { if ( ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . isBoot ( ) ) && ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getVmId ( ) ) != null ) ) && ( ! ( Guid.Empty.equals ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getVmId ( ) ) ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getVmId ( ) , LockingGroup.VM_DISK_BOOT.name ( ) ) ; } return null ; }
Source:
public java.lang.StringBuilder getTagIdAndChildrenIds ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "'" ) . append ( gettag_id ( ) ) . append ( "'" ) ; for ( org.ovirt.engine.core.common.businessentities.tags tag : _children ) { builder.append ( "," ) . append ( tag.getTagIdAndChildrenIds ( ) ) ; } return builder ; }

Target:
public java.lang.StringBuilder getTagIdAndChildrenIds ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "'" ) . append ( gettag_id ( ) ) . append ( "'" ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : _children ) { builder.append ( "," ) . append ( tag.getTagIdAndChildrenIds ( ) ) ; } return builder ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.NetworkFilter fetchVnicProfileNetworkFilter ( org.ovirt.engine.core.common.businessentities.network.VmNic vmNic ) { if ( ( vmNic.getVnicProfileId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = getDbFacade ( ) . getVnicProfileDao ( ) . get ( vmNic.getVnicProfileId ( ) ) ; if ( vnicProfile != null ) { final org.ovirt.engine.core.compat.Guid networkFilterId = vnicProfile.getNetworkFilterId ( ) ; return networkFilterId == null ? null : getDbFacade ( ) . getNetworkFilterDao ( ) . getNetworkFilterById ( networkFilterId ) ; } } return null ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkFilter fetchVnicProfileNetworkFilter ( org.ovirt.engine.core.common.businessentities.network.VmNic vmNic ) { if ( ( vmNic.getVnicProfileId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = vnicProfileDao.get ( vmNic.getVnicProfileId ( ) ) ; if ( vnicProfile != null ) { final org.ovirt.engine.core.compat.Guid networkFilterId = vnicProfile.getNetworkFilterId ( ) ; return networkFilterId == null ? null : networkFilterDao.getNetworkFilterById ( networkFilterId ) ; } } return null ; }
Source:
public void updateChangeConnectionType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections iscsiConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( iscsiConnection ) ; org.mockito.Mockito.when ( storageConnDao.get ( iscsiConnection.getId ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_CHANGE_STORAGE_TYPE ) ; }

Target:
public void updateChangeConnectionType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections iscsiConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( iscsiConnection ) ; org.mockito.Mockito.when ( storageConnDao.get ( iscsiConnection.getId ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_CHANGE_STORAGE_TYPE ) ; }
Source:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.scheduling.ClusterPolicy > list = returnValue.getReturnValue ( ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.ClusterPolicyComparator ( ) ) ; setItems ( list ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.scheduling.ClusterPolicy > list = returnValue.getReturnValue ( ) ; java.util.Collections.sort ( list , java.util.Comparator.comparing ( ClusterPolicy :: isLocked ) . reversed ( ) . thenComparing ( ClusterPolicy :: getName , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ) ; setItems ( list ) ; }
Source:
private void onSavePostNameValidation ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; if ( ! ( model.validate ( ) ) ) { return ; } if ( ( model.getSelectedItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) { saveNfsStorage ( ) ; } else if ( ( model.getSelectedItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ) { saveLocalStorage ( ) ; } else if ( ( model.getSelectedItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ) { savePosixStorage ( ) ; } else { saveSanStorage ( ) ; } }

Target:
private void onSavePostNameValidation ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; if ( ! ( model.validate ( ) ) ) { return ; } if ( ( model.getCurrentStorageItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ) { saveNfsStorage ( ) ; } else if ( ( model.getCurrentStorageItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ) { saveLocalStorage ( ) ; } else if ( ( model.getCurrentStorageItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ) { savePosixStorage ( ) ; } else { saveSanStorage ( ) ; } }
Source:
protected void onInitAllDisks ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : disks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { allDisks.add ( org.ovirt.engine.ui.uicommonweb.Linq.diskToModel ( disk ) ) ; } } }

Target:
protected void onInitAllDisks ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.IMAGE ) ) { allDisks.add ( org.ovirt.engine.ui.uicommonweb.Linq.diskToModel ( disk ) ) ; } } }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute sync getIsUserLoggedIn: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.onFailure ( null ) ; }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { org.ovirt.engine.ui.frontend.Frontend.setLoggedInUser ( null ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , null ) ; } }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; }

Target:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails > aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; 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 void initState ( ) { reportsEnabled = false ; xmlInitialized = false ; reportsWebappDeployed = false ; scheduledStatusCheckInProgress = false ; initEventRaised = false ; reportBaseUrl = "" ; isCommunityEdition = false ; resourceMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicompat.ReportParser.Resource > ( ) ; dashboardMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicompat.ReportParser.Dashboard > ( ) ; reportsInitEvent = new org.ovirt.engine.ui.uicompat.Event ( "ReportsInitialize" , org.ovirt.engine.ui.uicommonweb.ReportInit.class ) ; retryCount = 0 ; }

Target:
private void initState ( ) { reportsEnabled = false ; xmlInitialized = false ; reportsWebappDeployed = false ; scheduledStatusCheckInProgress = false ; initEventRaised = false ; reportBaseUrl = "" ; reportRightClickUrl = "" ; isCommunityEdition = false ; resourceMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicompat.ReportParser.Resource > ( ) ; dashboardMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicompat.ReportParser.Dashboard > ( ) ; reportsInitEvent = new org.ovirt.engine.ui.uicompat.Event ( "ReportsInitialize" , org.ovirt.engine.ui.uicommonweb.ReportInit.class ) ; retryCount = 0 ; }
Source:
public void init ( ) { super . init ( ) ; setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . runVirtualMachinesTitle ( ) ) ; getIsAutoAssign ( ) . setEntity ( true ) ; getCustomPropertySheet ( ) . setKeyValueString ( customPropertiesKeysList ) ; getCustomPropertySheet ( ) . setEntity ( vm.getCustomProperties ( ) ) ; loadHosts ( ) ; }

Target:
protected void onRunOnce ( ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RunVmOnce , createRunVmOnceParams ( ) , null , this ) ; commandTarget.ExecuteCommand ( runOnceCommand ) ; }
Source:
private void ProposeDiscover ( ) { if ( ( ! ( getProposeDiscoverTargets ( ) ) ) && ( ( ( getItems ( ) ) == null ) || ( ( org.ovirt.engine.ui.uicommonweb.Linq.Count ( getItems ( ) ) ) == 0 ) ) ) { setProposeDiscoverTargets ( true ) ; } }

Target:
private void ProposeDiscover ( ) { boolean proposeDiscover = ( ! ( getProposeDiscoverTargets ( ) ) ) && ( ( ( getItems ( ) ) == null ) || ( ( org.ovirt.engine.ui.uicommonweb.Linq.Count ( getItems ( ) ) ) == 0 ) ) ; setProposeDiscoverTargets ( proposeDiscover ) ; }
Source:
public void testRemoveNetworkAndReassignRolesNoReassign ( ) { testRemoveNetworkAndReassignRoles ( ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . update ( org.mockito.ArgumentMatchers.same ( managementNetworkCluster ) ) ; org.junit.Assert.assertFalse ( managementNetworkCluster.isDisplay ( ) ) ; org.junit.Assert.assertFalse ( managementNetworkCluster.isMigration ( ) ) ; }

Target:
public void testRemoveNetworkAndReassignRolesNoReassign ( ) { testRemoveNetworkAndReassignRoles ( ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . update ( org.mockito.ArgumentMatchers.same ( managementNetworkCluster ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( managementNetworkCluster.isDisplay ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( managementNetworkCluster.isMigration ( ) ) ; }
Source:
public void testDedicatedHostNotExist ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }

Target:
public void testDedicatedHostNotInSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }
Source:
private void readNetworkItem ( org.ovirt.engine.core.compat.backendcompat.XmlNode node ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = getNetwotkInterface ( node ) ; updateSingleNic ( node , iface ) ; _vm.getInterfaces ( ) . add ( iface ) ; readVmDevice ( node , _vm.getStaticData ( ) , iface.getId ( ) , java.lang.Boolean.TRUE ) ; }

Target:
protected void updateSingleNic ( org.ovirt.engine.core.compat.backendcompat.XmlNode node , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { super . updateSingleNic ( node , iface ) ; iface.setName ( node.SelectSingleNode ( OvfProperties.VMD_NAME , _xmlNS ) . innerText ) ; iface.setMacAddress ( ( ( node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) ) != null ? node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) . innerText : "" ) ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl value = org.ovirt.engine.core.bll.scheduling.SchedulingManager.getInstance ( ) . getPolicyUnitsMap ( ) . get ( getParameters ( ) . getId ( ) ) ; if ( value != null ) { getQueryReturnValue ( ) . setReturnValue ( value.getPolicyUnit ( ) ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl value = schedulingManager.getPolicyUnitsMap ( ) . get ( getParameters ( ) . getId ( ) ) ; if ( value != null ) { getQueryReturnValue ( ) . setReturnValue ( value.getPolicyUnit ( ) ) ; } }
Source:
protected boolean isConnectionEditable ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { boolean isEditable = ( ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ) && ( ( storageDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Maintenance ) ) ; return isEditable ; }

Target:
protected boolean isDomainInEditState ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { boolean isEditable = ( ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ) && ( ( storageDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Maintenance ) ) ; return isEditable ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > vlanInterfacesForInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > result = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingInterface : existingInterfaces ) { if ( nic.getName ( ) . equals ( existingInterface.getBaseInterface ( ) ) ) { result.add ( existingInterface ) ; } } return result ; }

Target:
private boolean isNewAttachment ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { return networkAttachmentId == null ; }
Source:
private void localize ( ) { lvNameEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.logicalVolume ( ) ) ; mountPointEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.mountPoint ( ) ) ; sizeEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.lvSize ( ) ) ; raidParamsLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.raidParameters ( ) ) ; raidTypeEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.raidType ( ) ) ; noOfPhysicalDisksEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.noOfPhysicalDisksInRaidVolume ( ) ) ; stripeSizeLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.stripeSize ( ) ) ; deviceHeader.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.CreateBrickPopupView.constants.storageDevices ( ) ) ; }

Target:
public void setMessage ( java.lang.String message ) { super . setMessage ( message ) ; this . message.setText ( message ) ; this . message.setVisible ( ( ! ( org.ovirt.engine.ui.uicompat.external.StringUtils.isEmpty ( message ) ) ) ) ; }
Source:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; syncSearch ( ) ; }

Target:
private boolean handleQueryError ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue , org.ovirt.engine.ui.uicommonweb.models.users.AdElementListModel model ) { model.setMessage ( null ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { model.setMessage ( org.ovirt.engine.ui.frontend.Frontend.getAppErrorsTranslator ( ) . TranslateErrorTextSingle ( returnValue.getExceptionString ( ) ) ) ; getSearchInProgress ( ) . setEntity ( false ) ; return true ; } return false ; }
Source:
public void qosOverridden ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_4 ) ; validateAndAssertQosOverridden ( helper , iface ) ; }

Target:
public void networkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( "network" ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , "network" ) ; mockExistingIfaces ( nic ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNoChanges ( helper ) ; }
Source:
public void shouldHaveNotingToMigrate ( ) { org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDSGroup.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.never ( ) ) . migrateVM ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void shouldNotMigrateVmOnClusterTwoWhenEnforced ( ) { org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.Matchers.eq ( cluster2 ) ) ) . thenReturn ( null ) ; arem.refresh ( ) ; org.mockito.Mockito.verify ( arem ) . migrateVM ( vm1 ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 1 ) ) . migrateVM ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }
Source:
public void prepareConnectHostToStoragePoolServers ( org.ovirt.engine.core.common.action.ConnectHostToStoragePoolServersParameters parameters , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > res = org.ovirt.engine.core.bll.storage.ISCSIStorageHelper.updateIfaces ( connections , parameters.getVds ( ) . getId ( ) ) ; connections.clear ( ) ; connections.addAll ( res ) ; }

Target:
public void prepareConnectHostToStoragePoolServers ( org.ovirt.engine.core.common.action.ConnectHostToStoragePoolServersParameters parameters , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections ) { prepareStorageServer ( parameters , connections ) ; }
Source:
public void getUsbPolicyUsbTypeNull31 ( ) { 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.setcompatibility_version ( Version.v3_1 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getcompatibility_version ( ) ) , UsbPolicy.ENABLED_NATIVE ) ; }

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 ) ; }
Source:
public void shouldDetectDifferentOs ( ) { org.assertj.core.api.Assertions.assertThat ( new org.ovirt.engine.core.utils.OS ( "os1" , new org.ovirt.engine.core.compat.Version ( "6.3" ) ) . isSameOsFamily ( new org.ovirt.engine.core.utils.OS ( "os2" , new org.ovirt.engine.core.compat.Version ( "6.3" ) ) ) ) . isFalse ( ) ; }

Target:
public void shouldDetectDifferentOs ( ) { org.assertj.core.api.Assertions.assertThat ( new org.ovirt.engine.core.utils.OS ( "os1" , new org.ovirt.engine.core.compat.Version ( "6.3" ) , "" ) . isSameOsFamily ( new org.ovirt.engine.core.utils.OS ( "os2" , new org.ovirt.engine.core.compat.Version ( "6.3" ) , "" ) ) ) . isFalse ( ) ; }
Source:
private void initListerners ( final org.ovirt.engine.ui.uicommonweb.models.storage.DisksAllocationModel model ) { model.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 ( "Disks" . equals ( args.propertyName ) ) { addDiskList ( model ) ; } else if ( "QuotaEnforcmentType" . equals ( args.propertyName ) ) { updateColumnsAvailability ( model ) ; updateListHeader ( model ) ; } } } ) ; }

Target:
private void initListeners ( final org.ovirt.engine.ui.uicommonweb.models.storage.DisksAllocationModel model ) { model.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 ( "Disks" . equals ( args.propertyName ) ) { addDiskList ( model ) ; } else if ( "QuotaEnforcmentType" . equals ( args.propertyName ) ) { updateColumnsAvailability ( model ) ; updateListHeader ( model ) ; } } } ) ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > getClusterByServiceList ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > list , boolean supportsVirtService , boolean supportsGlusterService ) { final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : list ) { if ( ( supportsVirtService && ( cluster.supportsVirtService ( ) ) ) || ( supportsGlusterService && ( cluster.supportsGlusterService ( ) ) ) ) { filteredList.add ( cluster ) ; } } java.util.Collections.sort ( filteredList , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return filteredList ; }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > getClusterByServiceList ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > list , boolean supportsVirtService , boolean supportsGlusterService ) { final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > filteredList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : list ) { if ( ( supportsVirtService && ( cluster.supportsVirtService ( ) ) ) || ( supportsGlusterService && ( cluster.supportsGlusterService ( ) ) ) ) { filteredList.add ( cluster ) ; } } java.util.Collections.sort ( filteredList , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return filteredList ; }
Source:
public void initDisks ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > disks = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : vm.getDiskList ( ) ) { disks.add ( org.ovirt.engine.ui.uicommonweb.Linq.diskToModel ( diskImage ) ) ; } getModel ( ) . setDisks ( disks ) ; getModel ( ) . getDisksAllocationModel ( ) . setIsVolumeFormatAvailable ( true ) ; getModel ( ) . getDisksAllocationModel ( ) . setIsVolumeFormatChangable ( true ) ; updateIsDisksAvailable ( ) ; }

Target:
public void initDisks ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > disks = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : vm.getDiskList ( ) ) { disks.add ( org.ovirt.engine.ui.uicommonweb.Linq.diskToModel ( diskImage ) ) ; } getModel ( ) . setDisks ( disks ) ; getModel ( ) . getDisksAllocationModel ( ) . setIsVolumeTypeAvailable ( true ) ; getModel ( ) . getDisksAllocationModel ( ) . setIsVolumeTypeChangable ( true ) ; updateIsDisksAvailable ( ) ; }
Source:
private static boolean isVnicProfilePermitted ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.common.businessentities.network.VnicProfile profile , boolean portMirroringRequired ) { return ( portMirroringRequired == ( profile.isPortMirroring ( ) ) ) && ( ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.getPermissionDAO ( ) . getEntityPermissions ( userId , ActionGroup.CONFIGURE_VM_NETWORK , profile.getId ( ) , VdcObjectType.VnicProfile ) ) != null ) ; }

Target:
private static boolean isVnicProfilePermitted ( org.ovirt.engine.core.common.users.VdcUser user , org.ovirt.engine.core.common.businessentities.network.VnicProfile profile , boolean portMirroringRequired ) { return ( portMirroringRequired == ( profile.isPortMirroring ( ) ) ) && ( ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.getPermissionDAO ( ) . getEntityPermissions ( user.getUserId ( ) , ActionGroup.CONFIGURE_VM_NETWORK , profile.getId ( ) , VdcObjectType.VnicProfile ) ) != null ) ; }
Source:
protected boolean checkPermissions ( final java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permSubjects ) { for ( org.ovirt.engine.core.bll.utils.PermissionSubject permSubject : permSubjects ) { if ( ! ( checkSinglePermission ( permSubject , getReturnValue ( ) . getCanDoActionMessages ( ) ) ) ) { return false ; } } return true ; }

Target:
protected boolean isQuotaDependant ( ) { if ( ( getActionType ( ) . getQuotaDependency ( ) ) == ( VdcActionType.QuotaDependency.NONE ) ) { return false ; } if ( ! ( org.ovirt.engine.core.bll.CommandBase.isInternalExecution ( ) ) ) { return true ; } return getActionType ( ) . isQuotaDependentAsInternalCommand ( ) ; }
Source:
public static void getNetworkList ( 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 ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { 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.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
public void getClusterList ( 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getMaxNumOfThreadsPerCpu ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfThreadsPerCpu ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void validateDiskIsOvfStore ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; command.getImage ( ) . setContentType ( DiskContentType.OVF_STORE ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED ) ; }

Target:
public void validateDestinationDomainValid ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; initializeCommand ( disk , VmEntityType.VM ) ; disk.getStorageIds ( ) . add ( destStorageId ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; command.getParameters ( ) . setStorageDomainId ( destStorageId ) ; command.setStorageDomainId ( destStorageId ) ; command.getStorageDomain ( ) . setId ( destStorageId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DESTINATION_STORAGE_DOMAIN_ALREADY_CONTAINS_THE_DISK ) ; }
Source:
public void testInterfaceInHostWhenInDifferentHost ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NIC_NOT_EXISTS_ON_HOST ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , hostId.toString ( ) ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceInHost ( hostId ) , matcher ) ; }

Target:
public void testInterfaceInHostWhenInDifferentHost ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NIC_NOT_EXISTS_ON_HOST ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , hostId.toString ( ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceInHost ( hostId ) , matcher ) ; }
Source:
public void testTypedList ( ) throws java.lang.Exception { java.io.File file = writeConf ( "a=b,c" ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; junit.framework.Assert.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedList view = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedList.class ) ; junit.framework.Assert.assertNotNull ( view ) ; java.util.List < java.lang.String > list = view.getA ( ) ; junit.framework.Assert.assertNotNull ( list ) ; junit.framework.Assert.assertEquals ( "b" , list.get ( 0 ) ) ; junit.framework.Assert.assertEquals ( "c" , list.get ( 1 ) ) ; }

Target:
public void testTypedList ( ) throws java.lang.Exception { java.io.File file = writeConf ( "a=b,c" ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.Assert.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedList view = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedList.class ) ; org.junit.Assert.assertNotNull ( view ) ; java.util.List < java.lang.String > list = view.getA ( ) ; org.junit.Assert.assertNotNull ( list ) ; org.junit.Assert.assertEquals ( "b" , list.get ( 0 ) ) ; org.junit.Assert.assertEquals ( "c" , list.get ( 1 ) ) ; }
Source:
public void testNotRemovingDefaultPool ( ) throws java.lang.Exception { macPool.setDefaultPool ( true ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.MacPoolValidator ( macPool ) . notRemovingDefaultPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_DEFAULT_MAC_POOL ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult callHasUniqueName ( org.ovirt.engine.core.compat.Guid macPool1Id , org.ovirt.engine.core.compat.Guid macPool2Id , java.lang.String macPool1Name , java.lang.String macPool2Name ) { final org.ovirt.engine.core.common.businessentities.MacPool existingMacPool = new org.ovirt.engine.core.common.businessentities.MacPool ( ) ; existingMacPool.setId ( macPool1Id ) ; existingMacPool.setName ( macPool1Name ) ; org.mockito.Mockito.when ( macPoolDaoMock.getAll ( ) ) . thenReturn ( java.util.Arrays.asList ( existingMacPool ) ) ; macPool.setId ( macPool2Id ) ; macPool.setName ( macPool2Name ) ; return macPoolValidator.hasUniqueName ( ) ; }