auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getVdsNullAll ( ) { final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = null ; final org.ovirt.engine.core.compat.Guid vdsId = null ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertNull ( v ) ; }

Target:
public void getVdsNullAll ( ) { final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = null ; final org.ovirt.engine.core.compat.Guid vdsId = null ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.jupiter.api.Assertions.assertNull ( v ) ; }
Source:
public void getStorageDomainList ( 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.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public java.lang.String getServerFingerprint ( java.lang.String serverName ) { java.lang.String fingerPrint = null ; org.ovirt.engine.core.utils.ssh.EngineSSHDialog dialog = getEngineSSHDialog ( ) ; try { dialog.setHost ( serverName ) ; dialog.connect ( ) ; fingerPrint = dialog.getHostFingerprint ( ) ; } catch ( java.lang.Throwable e ) { log.errorFormat ( "Could not fetch fingerprint of host {0} with message: {1}" , serverName , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } finally { dialog.disconnect ( ) ; } return fingerPrint ; }

Target:
public java.lang.String getServerFingerprint ( java.lang.String serverName ) { java.lang.String fingerPrint = null ; org.ovirt.engine.core.bll.utils.EngineSSHClient dialog = getEngineSSHClient ( ) ; try { dialog.setHost ( serverName ) ; dialog.connect ( ) ; fingerPrint = dialog.getHostFingerprint ( ) ; } catch ( java.lang.Throwable e ) { log.errorFormat ( "Could not fetch fingerprint of host {0} with message: {1}" , serverName , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } finally { dialog.disconnect ( ) ; } return fingerPrint ; }
Source:
private void auditVmOnDownEvent ( org.ovirt.engine.core.common.businessentities.VmExitStatus exitStatus , java.lang.String exitMessage , org.ovirt.engine.core.compat.Guid vmStatisticsId ) { org.ovirt.engine.core.common.AuditLogType type = ( exitStatus == ( org.ovirt.engine.core.common.businessentities.VmExitStatus.Normal ) ) ? org.ovirt.engine.core.common.AuditLogType.VM_DOWN : org.ovirt.engine.core.common.AuditLogType.VM_DOWN_ERROR ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( _vds.getId ( ) , vmStatisticsId ) ; if ( exitMessage != null ) { logable.AddCustomValue ( "ExitMessage" , ( "Exit message: " + exitMessage ) ) ; } auditLog ( logable , type ) ; }

Target:
private void auditVmOnDownEvent ( org.ovirt.engine.core.common.businessentities.VmExitStatus exitStatus , java.lang.String exitMessage , org.ovirt.engine.core.compat.Guid vmStatisticsId ) { org.ovirt.engine.core.common.AuditLogType type = ( exitStatus == ( org.ovirt.engine.core.common.businessentities.VmExitStatus.Normal ) ) ? org.ovirt.engine.core.common.AuditLogType.VM_DOWN : org.ovirt.engine.core.common.AuditLogType.VM_DOWN_ERROR ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( _vds.getId ( ) , vmStatisticsId ) ; if ( exitMessage != null ) { logable.addCustomValue ( "ExitMessage" , ( "Exit message: " + exitMessage ) ) ; } auditLog ( logable , type ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > retval = org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getDbFacade ( ) . getVmTemplateDao ( ) . getAll ( org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getParameters ( ) . isFiltered ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : retval ) { AnonymousMethod1 ( template ) ; } org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getQueryReturnValue ( ) . setReturnValue ( retval ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > retval = org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getDbFacade ( ) . getVmTemplateDao ( ) . getAll ( org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getParameters ( ) . isFiltered ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : retval ) { org.ovirt.engine.core.bll.VmTemplateHandler.UpdateDisksFromDb ( template ) ; } org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getQueryReturnValue ( ) . setReturnValue ( retval ) ; }
Source:
private void run ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < > ( ) ; for ( java.lang.Object item : org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.RunVmParams ( a.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RunVm , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
private void pause ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < > ( ) ; for ( java.lang.Object item : org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VmOperationParameterBase ( a.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.HibernateVm , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
public void testListCrashClientLocale ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; locales.add ( org.ovirt.engine.api.restapi.resource.gluster.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpHooksQueryExpectations ( t ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; locales.add ( org.ovirt.engine.api.restapi.resource.gluster.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpHooksQueryExpectations ( t ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) ; if ( source != null ) { for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( source ) ) ) { if ( ( template.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.OK ) ) { list.add ( template ) ; } } java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VmTemplateByNameComparer ( ) ) ; } return list ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) ; if ( source != null ) { for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( source ) ) ) { if ( ( template.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.OK ) ) { list.add ( template ) ; } } java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; } return list ; }
Source:
protected void doGet ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.lang.Integer applicationMode = getApplicationMode ( getEngineSessionId ( request ) ) ; request.setAttribute ( org.ovirt.engine.ui.frontend.server.gwt.WebAdminHostPageServlet.ATTR_APPLICATION_MODE , getApplicationModeObject ( applicationMode ) ) ; java.util.List < org.ovirt.engine.ui.frontend.server.gwt.plugin.PluginData > pluginData = getPluginData ( ) ; request.setAttribute ( org.ovirt.engine.ui.frontend.server.gwt.WebAdminHostPageServlet.ATTR_PLUGIN_DEFS , getPluginDefinitionsArray ( pluginData ) ) ; java.lang.Integer engineSessionTimeout = getEngineSessionTimeout ( getEngineSessionId ( request ) ) ; request.setAttribute ( org.ovirt.engine.ui.frontend.server.gwt.WebAdminHostPageServlet.ATTR_ENGINE_SESSION_TIMEOUT , getEngineSessionTimeoutObject ( engineSessionTimeout ) ) ; super . doGet ( request , response ) ; }

Target:
protected void doGet ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.lang.Integer applicationMode = getApplicationMode ( getEngineSessionId ( request ) ) ; request.setAttribute ( org.ovirt.engine.ui.frontend.server.gwt.WebAdminHostPageServlet.ATTR_APPLICATION_MODE , getApplicationModeObject ( applicationMode ) ) ; java.util.List < org.ovirt.engine.ui.frontend.server.gwt.plugin.PluginData > pluginData = getPluginData ( ) ; request.setAttribute ( org.ovirt.engine.ui.frontend.server.gwt.WebAdminHostPageServlet.ATTR_PLUGIN_DEFS , getPluginDefinitionsArray ( pluginData ) ) ; request.setAttribute ( org.ovirt.engine.ui.frontend.server.gwt.WebAdminHostPageServlet.ATTR_ENGINE_SESSION_TIMEOUT , getEngineSessionTimeoutObject ( getUserSessionTimeout ( ) , getUserSessionHardTimeout ( ) ) ) ; super . doGet ( request , response ) ; }
Source:
protected void copyVmDevices ( ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( org.ovirt.engine.core.bll.AddVmCommand.getVmTemplateId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , srcDiskIdToTargetDiskIdMapping , _vmInterfaces , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isSoundDeviceEnabled ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isConsoleEnabled ( ) ) ; }

Target:
protected void copyVmDevices ( ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( vmDevicesSourceId , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , getSrcDeviceIdToTargetDeviceIdMapping ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isSoundDeviceEnabled ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isConsoleEnabled ( ) , isVirtioScsiEnabled ( ) , isBalloonEnabled ( ) , false ) ; }
Source:
private void restartVdsVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVmDAO ( ) . getAllRunningForVds ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVdsId ( ) ) ; if ( ! ( vms.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.RestartVdsVmsOperation restartVmsOper = new org.ovirt.engine.core.bll.RestartVdsVmsOperation ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVds ( ) ) ; restartVmsOper.restartVms ( vms ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVds ( ) . getId ( ) ) ) ; } }

Target:
private void restartVdsVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVmDAO ( ) . getAllRunningForVds ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVdsId ( ) ) ; if ( ! ( vms.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.RestartVdsVmsOperation restartVmsOper = new org.ovirt.engine.core.bll.RestartVdsVmsOperation ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getContext ( ) , org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVds ( ) ) ; restartVmsOper.restartVms ( vms ) ; runVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.VdsKdumpDetectionCommand.getVds ( ) . getId ( ) ) ) ; } }
Source:
public void testGetOvirtNodePackagesForCheckUpdate ( ) throws java.lang.Exception { java.util.Collection < java.lang.String > expectedPackages = new java.util.HashSet < > ( java.util.Collections.singletonList ( "e" ) ) ; java.util.Collection < java.lang.String > actualPackages = org.ovirt.engine.core.bll.host.HostUpgradeManager.getPackagesForCheckUpdate ( VDSType.oVirtNode ) ; org.junit.Assert.assertEquals ( expectedPackages , actualPackages ) ; }

Target:
public void testGetOvirtNodePackagesForCheckUpdate ( ) throws java.lang.Exception { java.util.Collection < java.lang.String > expectedPackages = new java.util.HashSet < > ( java.util.Collections.singletonList ( "e" ) ) ; java.util.Collection < java.lang.String > actualPackages = org.ovirt.engine.core.bll.host.HostUpgradeManager.getPackagesForCheckUpdate ( VDSType.oVirtNode , Version.v4_0 ) ; org.junit.Assert.assertEquals ( expectedPackages , actualPackages ) ; }
Source:
private void initMinimalVmMemSize ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMinimalVmMemSize ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; vmModel.set_MinMemSize ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; } } , getHash ( ) ) ) ; }

Target:
public void setSpiceCopyPasteEnabled ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.NotChangableForVmInPoolEntityModel < java.lang.Boolean > spiceCopyPasteEnabled ) { this . spiceCopyPasteEnabled = spiceCopyPasteEnabled ; }
Source:
protected void removeVmNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > interfaces = getVmNetworkInterfaceDAO ( ) . getAllForVm ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : interfaces ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . freeMac ( iface.getMacAddress ( ) ) ; } } }

Target:
protected void removeVmNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > interfaces = getVmNetworkInterfaceDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : interfaces ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . freeMac ( iface.getMacAddress ( ) ) ; } } }
Source:
public void invalidWhenConditionDoesntOccurWithSingleReplacement ( ) { org.junit.Assert.assertThat ( org.ovirt.engine.core.bll.ValidationResult.failWith ( org.ovirt.engine.core.bll.ValidationResultTest.ERROR , org.ovirt.engine.core.bll.ValidationResultTest.REPLACEMENT ) . when ( true ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( org.ovirt.engine.core.bll.ValidationResultTest.ERROR ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.ValidationResultTest.REPLACEMENT ) ) ) ) ; }

Target:
public void invalidWhenConditionDoesntOccurWithSingleReplacement ( ) { org.hamcrest.MatcherAssert.assertThat ( org.ovirt.engine.core.bll.ValidationResult.failWith ( org.ovirt.engine.core.bll.ValidationResultTest.ERROR , org.ovirt.engine.core.bll.ValidationResultTest.REPLACEMENT ) . when ( true ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( org.ovirt.engine.core.bll.ValidationResultTest.ERROR ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.ValidationResultTest.REPLACEMENT ) ) ) ) ; }
Source:
protected java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > setUpExportTemplates ( ) { java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ret = new java.util.LinkedHashMap < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { ret.put ( getEntity ( i ) , new java.util.ArrayList < > ( ) ) ; } return ret ; }

Target:
protected java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > setUpExportTemplates ( ) { return java.util.stream.IntStream.range ( 0 , NAMES.length ) . boxed ( ) . collect ( java.util.stream.Collectors.toMap ( this :: getEntity , java.util.ArrayList :: new , ( u , v ) -> null , java.util.LinkedHashMap :: new ) ) ; }
Source:
public void testRemoveAllInCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > originalHookList = dao.getByClusterId ( FixturesTool.GLUSTER_CLUSTER_ID ) ; org.junit.Assert.assertFalse ( originalHookList.isEmpty ( ) ) ; dao.removeAllInCluster ( FixturesTool.GLUSTER_CLUSTER_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > hooks = dao.getByClusterId ( FixturesTool.GLUSTER_CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( hooks ) ; org.junit.Assert.assertTrue ( hooks.isEmpty ( ) ) ; }

Target:
public void testRemoveAllInCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > originalHookList = dao.getByClusterId ( FixturesTool.GLUSTER_CLUSTER_ID ) ; org.junit.jupiter.api.Assertions.assertFalse ( originalHookList.isEmpty ( ) ) ; dao.removeAllInCluster ( FixturesTool.GLUSTER_CLUSTER_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > hooks = dao.getByClusterId ( FixturesTool.GLUSTER_CLUSTER_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( hooks ) ; org.junit.jupiter.api.Assertions.assertTrue ( hooks.isEmpty ( ) ) ; }
Source:
public static boolean CanRemoveVmPool ( org.ovirt.engine.core.compat.Guid vmPoolId , java.util.ArrayList < java.lang.String > reasons ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmPoolsMapByVmPoolId ( vmPoolId ) . size ( ) ) != 0 ) { returnValue = false ; reasons.add ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_VM_POOL_WITH_VMS.toString ( ) ) ; } return returnValue ; }

Target:
public static boolean canRemoveVmPool ( org.ovirt.engine.core.compat.Guid vmPoolId , java.util.ArrayList < java.lang.String > reasons ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmPoolsMapByVmPoolId ( vmPoolId ) . size ( ) ) != 0 ) { returnValue = false ; reasons.add ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_VM_POOL_WITH_VMS.toString ( ) ) ; } return returnValue ; }
Source:
private void assertAddingMixedTypes ( org.ovirt.engine.core.compat.Version version , boolean addingMixedTypesShouldSucceed ) { storagePool.setCompatibilityVersion ( version ) ; org.ovirt.engine.core.bll.ValidationResult attachDomainResult = validator.validateDomainCanBeAttachedToPool ( ) ; if ( addingMixedTypesShouldSucceed ) { org.junit.Assert.assertTrue ( ( "Attaching an ISCSI domain to a pool with NFS domain with with mixed type allowed failed, version: " + version ) , attachDomainResult.isValid ( ) ) ; } else { org.junit.Assert.assertFalse ( ( "Attaching an ISCSI domain to a pool with NFS domain with no mixed type allowed succeeded, version: " + version ) , attachDomainResult.isValid ( ) ) ; assertFailingMessage ( "Attaching an ISCSI domain to a pool with NFS domain with no mixed type failed with the wrong message" , attachDomainResult , EngineMessage.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED ) ; } }

Target:
private void assertAddingMixedTypes ( org.ovirt.engine.core.compat.Version version , boolean addingMixedTypesShouldSucceed ) { storagePool.setCompatibilityVersion ( version ) ; org.ovirt.engine.core.bll.ValidationResult attachDomainResult = validator.validateDomainCanBeAttachedToPool ( ) ; if ( addingMixedTypesShouldSucceed ) { org.junit.Assert.assertThat ( ( "Attaching an ISCSI domain to a pool with NFS domain with with mixed type allowed failed, version: " + version ) , attachDomainResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; } else { org.junit.Assert.assertThat ( attachDomainResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED ) ) ; } }
Source:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public static void countAllTemplates ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static void GetAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public static void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }
Source:
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 ) ; }

Target:
public static void getStorageDomainList ( 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.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveRole , org.ovirt.engine.core.common.action.RolesParameterBase.class , new java.lang.String [ ] { "RoleId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveRole , org.ovirt.engine.core.common.action.RolesParameterBase.class , new java.lang.String [ ] { "RoleId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: remove ) , detail ) ; }
Source:
public void getMaxNumOfVmSockets ( 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.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void configure ( ) { bind ( org.ovirt.engine.ui.webadmin.plugin.PluginManager.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.PluginEventHandler.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.api.PluginUiFunctions.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( DynamicUrlContentTabPresenter.ViewDef.class ) . to ( org.ovirt.engine.ui.webadmin.section.main.view.DynamicUrlContentTabView.class ) ; bind ( org.ovirt.engine.ui.webadmin.section.main.presenter.DynamicUrlContentTabProxyFactory.class ) . in ( com.google.inject.Singleton.class ) ; }

Target:
protected void configure ( ) { bind ( org.ovirt.engine.ui.webadmin.plugin.PluginManager.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.PluginEventHandler.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.api.PluginUiFunctions.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( DynamicUrlContentTabPresenter.ViewDef.class ) . to ( org.ovirt.engine.ui.webadmin.section.main.view.DynamicUrlContentTabView.class ) ; bind ( org.ovirt.engine.ui.webadmin.section.main.presenter.DynamicUrlContentTabProxyFactory.class ) . in ( com.google.inject.Singleton.class ) ; bindPresenterWidget ( org.ovirt.engine.ui.webadmin.section.main.presenter.popup.DynamicUrlContentPopupPresenterWidget.class , DynamicUrlContentPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.webadmin.section.main.view.popup.DynamicUrlContentPopupView.class ) ; }
Source:
public void testChangeClusterForbidden ( ) { prepareVmToPassCanDoAction ( ) ; vmStatic.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with can't change cluster." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( EngineMessage.VM_CANNOT_UPDATE_CLUSTER ) ; }

Target:
public void testChangeClusterForbidden ( ) { prepareVmToPassValidate ( ) ; org.ovirt.engine.core.common.businessentities.Cluster newGroup = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setCompatibilityVersion ( Version.v3_0 ) ; vmStatic.setClusterId ( newGroup.getId ( ) ) ; org.mockito.Mockito.doReturn ( clusterDao ) . when ( command ) . getClusterDao ( ) ; org.junit.Assert.assertFalse ( "validate should have failed with can't change cluster." , command.validate ( ) ) ; assertValidateMessage ( EngineMessage.VM_CANNOT_UPDATE_CLUSTER ) ; }
Source:
public void validateDiskIsLocked ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }

Target:
public void validateDiskIsLocked ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED ) ; }
Source:
private void verifyAddUser ( javax.ws.rs.core.Response response ) { assertEquals ( 201 , response.getStatus ( ) ) ; assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.User ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.User ) ( response.getEntity ( ) ) ) , 0 ) ; }

Target:
private void verifyAddUser ( javax.ws.rs.core.Response response ) { org.junit.Assert.assertEquals ( 201 , response.getStatus ( ) ) ; org.junit.Assert.assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.User ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.User ) ( response.getEntity ( ) ) ) , 0 ) ; }
Source:
public void validateFailsWithClusterDoesNotSupportGluster ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( getVolume ( 2 , false ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getCluster ( false ) ) . when ( clusterDao ) . get ( org.mockito.Mockito.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER ) ; }

Target:
public void validateFailsWithArbiterWithClusterDoesNotArbiterVolume ( ) { setVolume ( getVolume ( 3 , false , GlusterVolumeType.REPLICATE , 3 , true ) ) ; org.mockito.Mockito.doReturn ( getCluster ( true , Version.v4_0 ) ) . when ( clusterDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_ARBITER_VOLUME_NOT_SUPPORTED ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { if ( model.equals ( getViewFilterType ( ) ) ) { setItems ( ( ( java.util.Collection < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { if ( filter.equals ( getViewFilterType ( ) ) ) { setItems ( ( ( java.util.Collection < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VM > > ) ( returnValue.getReturnValue ( ) ) ) ) ; } }
Source:
private static org.ovirt.engine.core.bll.snapshots.SnapshotsValidator mockSuccessfulSnapshotValidator ( ) { org.ovirt.engine.core.bll.snapshots.SnapshotsValidator snapshotsValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsValidator.class ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( ValidationResult.VALID ) ; return snapshotsValidator ; }

Target:
private org.ovirt.engine.core.bll.snapshots.SnapshotsValidator mockSuccessfulSnapshotValidator ( ) { org.ovirt.engine.core.bll.snapshots.SnapshotsValidator snapshotsValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsValidator.class ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.doReturn ( snapshotsValidator ) . when ( command ) . getSnapshotsValidator ( ) ; return snapshotsValidator ; }
Source:
public void getVmAndTemplatesIdsWithoutAttachedImageDiכsks ( ) { addVmDevice ( FixturesTool.VM_WITH_NO_ATTACHED_DISKS , FixturesTool.IMAGE_GROUP_ID_2 , null ) ; addVmDevice ( FixturesTool.VM_WITH_NO_ATTACHED_DISKS , FixturesTool.DISK_ID , FixturesTool.EXISTING_SNAPSHOT_ID ) ; java.util.List < org.ovirt.engine.core.compat.Guid > ids = dao.getVmAndTemplatesIdsWithoutAttachedImageDisks ( false ) ; org.junit.Assert.assertTrue ( ids.contains ( FixturesTool.VM_RHEL5_POOL_51 ) ) ; org.junit.Assert.assertTrue ( ids.contains ( FixturesTool.VM_TEMPLATE_RHEL5_2 ) ) ; org.junit.Assert.assertTrue ( ids.contains ( FixturesTool.VM_WITH_NO_ATTACHED_DISKS ) ) ; org.junit.Assert.assertFalse ( ids.contains ( FixturesTool.VM_TEMPLATE_RHEL5 ) ) ; }

Target:
private void checkVmsDcAndDisks ( java.util.List < org.ovirt.engine.core.compat.Guid > vmIds , org.ovirt.engine.core.compat.Guid storagePoolId , boolean hasDisks ) { for ( org.ovirt.engine.core.compat.Guid vmId : vmIds ) { org.junit.Assert.assertEquals ( storagePoolId , dbFacade.getVmDao ( ) . get ( vmId ) . getStoragePoolId ( ) ) ; checkDisks ( vmId , hasDisks ) ; } }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( ! ( bondDialogModel.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > potentialNetworks = computeLabelChanges ( bondDialogModel.getLabelsModel ( ) , nicMap.get ( entity.getName ( ) ) . getItems ( ) ) ; if ( validateLabelChanges ( potentialNetworks ) ) { setBondOptions ( entity , bondDialogModel ) ; commitLabelChanges ( bondDialogModel.getLabelsModel ( ) , entity , potentialNetworks ) ; redraw ( ) ; } }

Target:
private boolean computeAndCommitLabelChanges ( final org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity , org.ovirt.engine.ui.uicommonweb.models.hosts.PfNicLabelModel labelsModel ) { if ( ! ( labelsModel.wasChanged ( ) ) ) { return true ; } java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > potentialNetworks = getPotentialNetworks ( labelsModel , nicMap.get ( entity.getName ( ) ) . getItems ( ) ) ; if ( validateNetworksCanCoexist ( potentialNetworks ) ) { commitNetworksAndLabelChanges ( labelsModel , entity , potentialNetworks ) ; redraw ( ) ; return true ; } return false ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "network_cluster {id=" ) . append ( getId ( ) ) . append ( ", status=" ) . append ( getstatus ( ) ) . append ( ", is_display=" ) . append ( getis_display ( ) ) . append ( ", required=" ) . append ( isRequired ( ) ) . append ( "}" ) ; return builder.toString ( ) ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "NetworkCluster {id=" ) . append ( getId ( ) ) . append ( ", status=" ) . append ( getstatus ( ) ) . append ( ", is_display=" ) . append ( getis_display ( ) ) . append ( ", required=" ) . append ( isRequired ( ) ) . append ( "}" ) ; return builder.toString ( ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , getEntityList ( ) ) ; verifyModel ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , getEntityList ( ) ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
private java.lang.String getTemplateSharedLockMessage ( ) { return new java.lang.StringBuilder ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_IS_USED_FOR_CREATE_VM.name ( ) ) . append ( java.lang.String.format ( "$VmName %1$s" , org.ovirt.engine.core.bll.AddVmCommand.getVmName ( ) ) ) . toString ( ) ; }

Target:
protected java.lang.String getDiskSharedLockMessage ( ) { if ( ( cachedDiskSharedLockMessage ) == null ) { cachedDiskSharedLockMessage = new java.lang.StringBuilder ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_USED_FOR_CREATE_VM.name ( ) ) . append ( java.lang.String.format ( "$VmName %1$s" , org.ovirt.engine.core.bll.AddVmCommand.getVmName ( ) ) ) . toString ( ) ; } return cachedDiskSharedLockMessage ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotaList = org.ovirt.engine.core.bll.GetQuotasConsumptionForCurrentUserQuery.getDbFacade ( ) . getQuotaDao ( ) . getQuotaByAdElementId ( org.ovirt.engine.core.bll.GetQuotasConsumptionForCurrentUserQuery.getUser ( ) . getId ( ) , null , true ) ; org.ovirt.engine.core.bll.GetQuotasConsumptionForCurrentUserQuery.getQueryReturnValue ( ) . setReturnValue ( quotaManager.generatePerUserUsageReport ( quotaList ) ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotaList = quotaDao.getQuotaByAdElementId ( org.ovirt.engine.core.bll.GetQuotasConsumptionForCurrentUserQuery.getUser ( ) . getId ( ) , null , true ) ; org.ovirt.engine.core.bll.GetQuotasConsumptionForCurrentUserQuery.getQueryReturnValue ( ) . setReturnValue ( quotaManager.generatePerUserUsageReport ( quotaList ) ) ; }
Source:
public java.util.List < org.ovirt.engine.api.model.Device > getDevices ( org.ovirt.engine.core.compat.Guid vmId , java.lang.String mac ) { java.util.List < org.ovirt.engine.api.model.Device > devices = new java.util.ArrayList < org.ovirt.engine.api.model.Device > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface iface : getDevicesCollection ( vmId ) ) { if ( org.apache.commons.lang.StringUtils.equals ( iface.getMacAddress ( ) , mac ) ) { devices.add ( org.ovirt.engine.api.common.util.LinkHelper.addLinks ( getUriInfo ( ) , org.ovirt.engine.api.restapi.types.ReportedDeviceMapper.map ( iface , new org.ovirt.engine.api.model.Device ( ) ) ) ) ; } } return devices ; }

Target:
public java.util.List < org.ovirt.engine.api.model.ReportedDevice > getDevices ( org.ovirt.engine.core.compat.Guid vmId , java.lang.String mac ) { java.util.List < org.ovirt.engine.api.model.ReportedDevice > devices = new java.util.ArrayList < org.ovirt.engine.api.model.ReportedDevice > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface iface : getDevicesCollection ( vmId ) ) { if ( org.apache.commons.lang.StringUtils.equals ( iface.getMacAddress ( ) , mac ) ) { devices.add ( org.ovirt.engine.api.common.util.LinkHelper.addLinks ( getUriInfo ( ) , org.ovirt.engine.api.restapi.types.ReportedDeviceMapper.map ( iface , new org.ovirt.engine.api.model.ReportedDevice ( ) ) ) ) ; } } return devices ; }
Source:
protected boolean CheckStorageDomainNameLengthValid ( ) { boolean result = true ; if ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getstorage_name ( ) . length ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.StorageDomainNameSizeLimit ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ; result = false ; } return result ; }

Target:
protected boolean checkStorageDomainNameLengthValid ( ) { boolean result = true ; if ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getstorage_name ( ) . length ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.StorageDomainNameSizeLimit ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ; result = false ; } return result ; }
Source:
public void getUsbPolicyUsbTypeNative ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; usb.setType ( "native" ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup ) , UsbPolicy.ENABLED_NATIVE ) ; }

Target:
public void getUsbPolicySetDisabled ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( false ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnCreate ( usb , vdsGroup.getcompatibility_version ( ) ) , UsbPolicy.DISABLED ) ; }