auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void updateHostPinning ( org.ovirt.engine.core.common.businessentities.MigrationSupport migrationSupport ) { getModel ( ) . getMigrationMode ( ) . setSelectedItem ( migrationSupport ) ; }

Target:
protected void updateHostPinning ( org.ovirt.engine.core.common.businessentities.MigrationSupport migrationSupport ) { java.util.List < org.ovirt.engine.core.common.businessentities.MigrationSupport > supportedModes = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.MigrationSupport > ) ( getModel ( ) . getMigrationMode ( ) . getItems ( ) ) ) ; if ( supportedModes.contains ( migrationSupport ) ) { getModel ( ) . getMigrationMode ( ) . setSelectedItem ( migrationSupport ) ; } }
Source:
private void setIsoPrefixVDSMethod ( java.lang.String isoPrefix ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue isoPrefixReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; isoPrefixReturnValue.setReturnValue ( isoPrefix ) ; org.mockito.Mockito.when ( backend.getResourceManager ( ) . RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.IsoPrefix ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.IrsBaseVDSCommandParameters.class ) ) ) . thenReturn ( isoPrefixReturnValue ) ; }

Target:
public void createCommand ( ) { org.ovirt.engine.core.common.action.RunVmParams param = new org.ovirt.engine.core.common.action.RunVmParams ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > ( param ) ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . removeQuotaCommandLeftOver ( ) ; mockVmRunHandler ( ) ; mockSuccessfulSnapshotValidator ( ) ; mockVmPropertiesUtils ( ) ; mockBackend ( ) ; }
Source:
public void validateNoFreeSpaceOnDomains ( ) { setupMocks ( ) ; org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > cmd = createCommand ( ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.FreeSpaceCriticalLowInGB ) ) . thenReturn ( 100 ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW.toString ( ) ) ) ; }

Target:
public void validateNoFreeSpaceOnDomains ( ) { mcr.mockConfigValue ( ConfigValues.FreeSpaceCriticalLowInGB , 100 ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW.toString ( ) ) ) ; }
Source:
public void isClusterEmpty ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
private void runQueryByIdParameter ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.AsIsAsyncConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( queryType , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public synchronized void UpdateTaskWithActionParameters ( org.ovirt.engine.core.compat.Guid taskID , org.ovirt.engine.core.common.action.VdcActionParametersBase actionParameters ) { if ( _tasks.containsKey ( taskID ) ) { org.ovirt.engine.core.common.businessentities.async_tasks currentDbAsyncTask = _tasks.get ( taskID ) . getParameters ( ) . getDbAsyncTask ( ) ; currentDbAsyncTask.setaction_parameters ( actionParameters ) ; _tasks.get ( taskID ) . UpdateAsyncTask ( ) ; } }

Target:
public synchronized void UpdateTaskWithActionParameters ( org.ovirt.engine.core.compat.Guid taskID , org.ovirt.engine.core.common.action.VdcActionParametersBase actionParameters ) { if ( _tasks.containsKey ( taskID ) ) { org.ovirt.engine.core.common.businessentities.async_tasks currentDbAsyncTask = _tasks.get ( taskID ) . getParameters ( ) . getDbAsyncTask ( ) ; currentDbAsyncTask.setaction_parameters ( actionParameters ) ; org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.updateAsyncTaskInDB ( _tasks.get ( taskID ) ) ; } }
Source:
public void getAAAProfilesEntriesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getAAANamespaces ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void lunsMatch ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun.setLUN_id ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; lun.setphysical_volume_id ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromVgInfo = java.util.Arrays.asList ( lun , lun ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromDb = java.util.Arrays.asList ( lun , lun ) ; boolean isMismatch = command.isLunsInfoMismatch ( lunsFromVgInfo , lunsFromDb ) ; org.junit.Assert.assertFalse ( isMismatch ) ; }

Target:
public void lunsMatch ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun.setLUNId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; lun.setPhysicalVolumeId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromVgInfo = java.util.Arrays.asList ( lun , lun ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromDb = java.util.Arrays.asList ( lun , lun ) ; boolean isMismatch = command.isLunsInfoMismatch ( lunsFromVgInfo , lunsFromDb ) ; org.junit.Assert.assertFalse ( isMismatch ) ; }
Source:
private void PostInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.Guid.Empty ) ) ) ) ; }

Target:
private void postInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.Guid.Empty ) ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.AdUser populateUserData ( org.ovirt.engine.core.common.businessentities.AdUser user , java.lang.String domain ) { if ( user == null ) { return null ; } user.setDomainControler ( domain ) ; java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.businessentities.ad_groups > groupsDict = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.businessentities.ad_groups > ( ) ; org.ovirt.engine.core.bll.adbroker.GroupsDNQueryGenerator generator = new org.ovirt.engine.core.bll.adbroker.GroupsDNQueryGenerator ( ) ; proceedGroupsSearchResult ( user.getMemberof ( ) , groupsDict , generator ) ; user.setGroups ( groupsDict ) ; return user ; }

Target:
protected org.ovirt.engine.core.common.businessentities.LdapUser populateUserData ( org.ovirt.engine.core.common.businessentities.LdapUser user , java.lang.String domain ) { if ( user == null ) { return null ; } user.setDomainControler ( domain ) ; java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.businessentities.ad_groups > groupsDict = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.businessentities.ad_groups > ( ) ; org.ovirt.engine.core.bll.adbroker.GroupsDNQueryGenerator generator = new org.ovirt.engine.core.bll.adbroker.GroupsDNQueryGenerator ( ) ; proceedGroupsSearchResult ( user.getMemberof ( ) , groupsDict , generator ) ; user.setGroups ( groupsDict ) ; return user ; }
Source:
public void setCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { this . command = command ; command.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 ) { updateButton ( ) ; } } ) ; updateButton ( ) ; }

Target:
public void setCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { this . command = command ; command.getPropertyChangedEvent ( ) . addListener ( listener ) ; updateButton ( ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.aaa.RemoveUserCommand.getParameters ( ) . getId ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : permissionDao.getAllDirectPermissionsForAdElement ( id ) ) { org.ovirt.engine.core.common.action.PermissionsOperationsParameters tempVar = new org.ovirt.engine.core.common.action.PermissionsOperationsParameters ( permission ) ; tempVar.setShouldBeLogged ( false ) ; runInternalActionWithTasksContext ( VdcActionType.RemovePermission , tempVar ) ; } dbUserDao.remove ( id ) ; org.ovirt.engine.core.bll.aaa.RemoveUserCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.aaa.RemoveUserCommand.getParameters ( ) . getId ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : permissionDao.getAllDirectPermissionsForAdElement ( id ) ) { org.ovirt.engine.core.common.action.PermissionsOperationsParameters tempVar = new org.ovirt.engine.core.common.action.PermissionsOperationsParameters ( permission ) ; tempVar.setShouldBeLogged ( false ) ; runInternalActionWithTasksContext ( ActionType.RemovePermission , tempVar ) ; } dbUserDao.remove ( id ) ; org.ovirt.engine.core.bll.aaa.RemoveUserCommand.setSucceeded ( true ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel1.getWindow ( ) . StopProgress ( ) ; vmListModel1.cancel ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result1.getState ( ) ) ) ; vmListModel1.getWindow ( ) . stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { vmListModel1.cancel ( ) ; } }
Source:
private void localize ( ) { networkEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.networkVnicProfile ( ) ) ; nameEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.nameVnicProfile ( ) ) ; descriptionEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.descriptionVnicProfile ( ) ) ; passthroughEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.passthorughVnicProfile ( ) ) ; portMirroringEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.portMirroringVnicProfile ( ) ) ; publicUseEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.publicUseVnicProfile ( ) ) ; networkQoSEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.profileQoSInstanceTypeLabel ( ) ) ; }

Target:
private void localize ( ) { networkEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.networkVnicProfile ( ) ) ; nameEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.nameVnicProfile ( ) ) ; descriptionEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.descriptionVnicProfile ( ) ) ; passthroughEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.passthorughVnicProfile ( ) ) ; portMirroringEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.portMirroringVnicProfile ( ) ) ; publicUseEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.publicUseVnicProfile ( ) ) ; networkQoSEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.profileQoSInstanceTypeLabel ( ) ) ; networkFilterEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.profile.VnicProfilePopupView.constants.profileNetworkFilterLabel ( ) ) ; }
Source:
public static void GetTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

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 , "" , "" , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
protected void updateHostPinning ( org.ovirt.engine.core.common.businessentities.MigrationSupport migrationSupport ) { java.util.List < org.ovirt.engine.core.common.businessentities.MigrationSupport > supportedModes = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.MigrationSupport > ) ( getModel ( ) . getMigrationMode ( ) . getItems ( ) ) ) ; if ( supportedModes.contains ( migrationSupport ) ) { getModel ( ) . getMigrationMode ( ) . setSelectedItem ( migrationSupport ) ; } }

Target:
private boolean isRngDeviceSupported ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.core.compat.Version clusterVersion = clusterVersionOrNull ( model ) ; return clusterVersion == null ? false : ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.VirtIoRngDeviceSupported , clusterVersion.getValue ( ) ) ) ) ; }
Source:
private java.util.Set < java.lang.String > hostNameSet ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { return hosts.stream ( ) . map ( VDS :: getHostName ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; }

Target:
private java.util.Set < java.lang.String > hostNameSet ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { java.util.Set < java.lang.String > existingHostNames = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { existingHostNames.add ( host.getHostName ( ) ) ; } return existingHostNames ; }
Source:
protected void postConstruct ( ) { T parameters = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) ; if ( ( parameters.isImportAsNewEntity ( ) ) && ( parameters.getVmId ( ) . equals ( parameters.getVm ( ) . getId ( ) ) ) ) { parameters.getVm ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } setStoragePoolId ( parameters.getStoragePoolId ( ) ) ; imageToDestinationDomainMap = parameters.getImageToDestinationDomainMap ( ) ; }

Target:
protected void init ( ) { T parameters = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) ; if ( ( parameters.isImportAsNewEntity ( ) ) && ( parameters.getVmId ( ) . equals ( parameters.getVm ( ) . getId ( ) ) ) ) { parameters.getVm ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } setStoragePoolId ( parameters.getStoragePoolId ( ) ) ; imageToDestinationDomainMap = parameters.getImageToDestinationDomainMap ( ) ; }
Source:
public void testOnlyDiskAliasChangedMetaDataShouldBeUpdated ( ) { final org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; parameters.getDiskInfo ( ) . setDiskAlias ( "New Disk Alias" ) ; initializeCommand ( parameters ) ; mockVdsCommandSetVolumeDescription ( ) ; command.executeVmCommand ( ) ; org.mockito.Mockito.verify ( command , org.mockito.Mockito.times ( 1 ) ) . setVolumeDescription ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; }

Target:
public void testOnlyDiskAliasChangedMetaDataShouldBeUpdated ( ) { final org.ovirt.engine.core.common.action.VmDiskOperationParameterBase parameters = createParameters ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; parameters.getDiskInfo ( ) . setDiskAlias ( "New Disk Alias" ) ; initializeCommand ( parameters ) ; mockVdsCommandSetVolumeDescription ( ) ; command.executeVmCommand ( ) ; org.mockito.Mockito.verify ( command , org.mockito.Mockito.times ( 1 ) ) . setVolumeDescription ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.utils.customprop.ValidationError > validateVmProperties ( org.ovirt.engine.core.compat.Version version , java.lang.String properties ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( properties ) ) { return java.util.Collections.emptyList ( ) ; } if ( syntaxErrorInProperties ( properties ) ) { return invalidSyntaxValidationError ; } java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; return populateVMProperties ( version , properties , map ) ; }

Target:
public java.util.List < org.ovirt.engine.core.utils.customprop.ValidationError > validateVmProperties ( org.ovirt.engine.core.compat.Version version , java.lang.String properties ) { if ( syntaxErrorInProperties ( properties ) ) { return invalidSyntaxValidationError ; } return validateProperties ( allVmProperties.get ( version ) , convertProperties ( properties ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( vds.getDynamicData ( ) , vds.getstatus ( ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( getVdsId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.Unassigned ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( vds.getDynamicData ( ) , vds.getStatus ( ) ) ; runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( getVdsId ( ) , org.ovirt.engine.core.common.businessentities.VDSStatus.Unassigned ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult nicActuallyExistsOrReferencesNewBond ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { java.lang.String targetNicName = attachment.getNicName ( ) ; boolean attachmentReferencesExistingNic = ( existingInterfacesMap.get ( attachment.getNicId ( ) , targetNicName ) ) != null ; if ( attachmentReferencesExistingNic ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentReferencesNewlyCreatedBond = ( targetNicName != null ) && ( ( bondsMap.get ( targetNicName ) ) != null ) ; if ( attachmentReferencesNewlyCreatedBond ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult nicActuallyExistsOrReferencesNewBond ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { java.lang.String targetNicName = attachment.getNicName ( ) ; boolean attachmentReferencesExistingNic = ( existingInterfacesMap.get ( attachment.getNicId ( ) , targetNicName ) ) != null ; if ( attachmentReferencesExistingNic ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentReferencesNewlyCreatedBond = ( targetNicName != null ) && ( ( bondsMap.get ( targetNicName ) ) != null ) ; if ( attachmentReferencesNewlyCreatedBond ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }
Source:
public void testInactiveDomainInList ( ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase param = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ) ; org.ovirt.engine.core.bll.storage.pool.RemoveStoragePoolCommand < org.ovirt.engine.core.common.action.StoragePoolParametersBase > cmd = org.ovirt.engine.core.bll.storage.pool.RemoveStoragePoolCommandTest.createCommand ( param ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain tempStorageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; tempStorageDomains.setStatus ( StorageDomainStatus.Inactive ) ; domainsList.add ( tempStorageDomains ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > listReturned = cmd.getActiveOrLockedDomainList ( domainsList ) ; org.junit.Assert.assertTrue ( listReturned.isEmpty ( ) ) ; }

Target:
public void testInactiveDomainInList ( ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase param = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ) ; org.ovirt.engine.core.bll.storage.pool.RemoveStoragePoolCommand < org.ovirt.engine.core.common.action.StoragePoolParametersBase > cmd = org.ovirt.engine.core.bll.storage.pool.RemoveStoragePoolCommandTest.createCommand ( param ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain tempStorageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; tempStorageDomains.setStatus ( StorageDomainStatus.Inactive ) ; domainsList.add ( tempStorageDomains ) ; org.junit.Assert.assertFalse ( cmd.validateDomainsInMaintenance ( domainsList ) ) ; }
Source:
public void testUpdateBrickStatus ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertEquals ( GlusterStatus.UP , existingBrick.getStatus ( ) ) ; dao.updateBrickStatus ( FixturesTool.GLUSTER_BRICK_UUID1 , GlusterStatus.DOWN ) ; existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertEquals ( GlusterStatus.DOWN , existingBrick.getStatus ( ) ) ; }

Target:
public void testUpdateBrickStatus ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( existingBrick ) ; org.junit.jupiter.api.Assertions.assertEquals ( GlusterStatus.UP , existingBrick.getStatus ( ) ) ; dao.updateBrickStatus ( FixturesTool.GLUSTER_BRICK_UUID1 , GlusterStatus.DOWN ) ; existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( existingBrick ) ; org.junit.jupiter.api.Assertions.assertEquals ( GlusterStatus.DOWN , existingBrick.getStatus ( ) ) ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { org.ovirt.engine.core.utils.Pair < org.ovirt.engine.core.common.businessentities.storage_domain_static , org.ovirt.engine.core.common.businessentities.SANState > domainFromIrs = ( ( org.ovirt.engine.core.utils.Pair < org.ovirt.engine.core.common.businessentities.storage_domain_static , org.ovirt.engine.core.common.businessentities.SANState > ) ( org.ovirt.engine.core.vdsbroker.irsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMGetStorageDomainInfo , new org.ovirt.engine.core.vdsbroker.irsbroker.HSMGetStorageDomainInfoVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.GetStorageDomainInfoVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.GetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ) . getReturnValue ( ) ) ) ; if ( domainFromIrs != null ) { setReturnValue ( domainFromIrs.getFirst ( ) ) ; } }

Target:
protected void ExecuteIrsBrokerCommand ( ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.storage_domain_static , org.ovirt.engine.core.common.businessentities.SANState > domainFromIrs = ( ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.storage_domain_static , org.ovirt.engine.core.common.businessentities.SANState > ) ( org.ovirt.engine.core.vdsbroker.irsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMGetStorageDomainInfo , new org.ovirt.engine.core.vdsbroker.irsbroker.HSMGetStorageDomainInfoVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.GetStorageDomainInfoVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.GetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ) . getReturnValue ( ) ) ) ; if ( domainFromIrs != null ) { setReturnValue ( domainFromIrs.getFirst ( ) ) ; } }
Source:
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 ) ; }

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.getInstance ( ) . runQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
private void onExportDomainChosen ( ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = dataCenters.getSelectedItem ( ) ; startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenter.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , createGetStorageDomainsByStoragePoolIdCallback ( dataCenter ) ) ) ; }

Target:
public void loadVmsFromExportDomain ( ) { startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExportDomain , new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getDataCenters ( ) . getSelectedItem ( ) . getId ( ) , exportDomain.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { updateVms ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) ; } } ) ) ; }
Source:
public void testNetworkNotChangedWhenDifferentNetworkIds ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; oldAttachment.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; oldAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotChanged ( oldAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CANNOT_CHANGE_ATTACHED_NETWORK , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_NETWORK_ATTACHMENT_ID , oldAttachment.getId ( ) ) ) ) ; }

Target:
public void testNetworkNotChangedWhenDifferentNetworkIds ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; oldAttachment.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; oldAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotChanged ( oldAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CANNOT_CHANGE_ATTACHED_NETWORK , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_NETWORK_ATTACHMENT_ID , oldAttachment.getId ( ) ) ) ) ; }
Source:
public void testGetNotFound2 ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( asList ( getEntity ( 2 ) ) ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound2 ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( asList ( getEntity ( 2 ) ) ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
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 < > ( ) ; 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 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.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( ( domain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return domain ; } } } return null ; }

Target:
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.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( ( domain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return domain ; } } } return null ; }
Source:
public void testFindMappingEntryNotFound ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; vnic.setNetworkName ( ( "not" + ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.NETWORK_NAME ) ) ) ; vnic.setVnicProfileName ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.VNIC_PROFILE2_NAME ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ctx = new org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ( ) ; ctx.setUserMappings ( externalVnicProfileMappings ) ; ctx.setOvfVnics ( java.util.Collections.singletonList ( vnic ) ) ; underTest.handle ( ctx ) ; org.junit.Assert.assertNull ( ctx.getMatched ( ) . get ( vnic ) ) ; }

Target:
public void testFindMappingEntryNotFound ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vnic = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; vnic.setNetworkName ( ( "not" + ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.NETWORK_NAME ) ) ) ; vnic.setVnicProfileName ( org.ovirt.engine.core.bll.exportimport.MatchUserMappingToOvfVnicTest.VNIC_PROFILE2_NAME ) ; org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ctx = new org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext ( ) ; ctx.setUserMappings ( externalVnicProfileMappings ) ; ctx.setOvfVnics ( java.util.Collections.singletonList ( vnic ) ) ; underTest.handle ( ctx ) ; org.junit.jupiter.api.Assertions.assertNull ( ctx.getMatched ( ) . get ( vnic ) ) ; }
Source:
private static java.util.Map < java.lang.String , java.lang.Object > getUsbControllerSpecParams ( java.lang.String model , int controllerNumber , int index ) { java.util.Map < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < > ( ) ; specParams.put ( VdsProperties.Model , ( model + controllerNumber ) ) ; specParams.put ( VdsProperties.Index , java.lang.Integer.toString ( index ) ) ; return specParams ; }

Target:
private static java.util.Map < java.lang.String , java.lang.Object > getSpiceUsbControllerSpecParams ( java.lang.String model , int controllerNumber , int index ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.createUsbControllerSpecParams ( ( model + controllerNumber ) , index ) ; }
Source:
protected org.ovirt.engine.api.model.GlusterBrick addParents ( org.ovirt.engine.api.model.GlusterBrick model ) { org.ovirt.engine.api.model.GlusterVolume volume = new org.ovirt.engine.api.model.GlusterVolume ( ) ; volume.setId ( getVolumeId ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( getClusterId ( ) ) ; volume.setCluster ( cluster ) ; model.setGlusterVolume ( volume ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.GlusterBrick addParents ( org.ovirt.engine.api.model.GlusterBrick model ) { parent.addParents ( model ) ; return model ; }
Source:
public static void getGlusterHooks ( 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 != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public void getGlusterSwiftServerServices ( 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 != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommandTest.CLUSTER_ID , org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommandTest.HOOK_ID ) ) ) ; setupMocks ( ) ; mockConfig ( ) ; mockBackend ( false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE_FAILED ) ; }

Target:
public void canDoActionSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }
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 < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getMaxNumOfCPUsPerSocket ( 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.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , java.lang.String description , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { return createTaskImpl ( taskId , asyncTaskCreationInfo , parentCommand , description , entityType , entityIds ) ; } catch ( java.lang.RuntimeException ex ) { log.errorFormat ( "Error during CreateTask for command: {0}. Exception {1}" , getClass ( ) . getName ( ) , ex ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , java.lang.String description , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entitiesMap ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { return createTaskImpl ( taskId , asyncTaskCreationInfo , parentCommand , description , entitiesMap ) ; } catch ( java.lang.RuntimeException ex ) { log.errorFormat ( "Error during CreateTask for command: {0}. Exception {1}" , getClass ( ) . getName ( ) , ex ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } return org.ovirt.engine.core.compat.Guid.Empty ; }
Source:
public static void GetDefaultTimeZone ( 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 ) { if ( source != null ) { return ( ( java.util.Map.Entry < java.lang.String , java.lang.String > ) ( source ) ) . getKey ( ) ; } return "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDefualtTimeZone , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getDefaultTimeZone ( 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 ) { if ( source != null ) { return ( ( java.util.Map.Entry < java.lang.String , java.lang.String > ) ( source ) ) . getKey ( ) ; } return "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDefualtTimeZone , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }