auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; } }
Source:
public void validateFailsOnNoConflictServers ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = getHookEntity ( ) ; hook.setServerHooks ( java.util.Collections.singletonList ( getGlusterServerHook ( 0 , GlusterHookStatus.MISSING ) ) ) ; setUpMocksForUpdate ( true , hook ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS.toString ( ) ) ) ; }

Target:
public void validateFailsOnNoConflictServers ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = getHookEntity ( ) ; hook.setServerHooks ( java.util.Collections.singletonList ( getGlusterServerHook ( 0 , GlusterHookStatus.MISSING ) ) ) ; setUpMocksForUpdate ( true , hook ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.validate ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS.toString ( ) ) ) ; }
Source:
public void autoLogin ( org.ovirt.engine.core.common.users.VdcUser user ) { loggingInAutomatically = true ; getUserName ( ) . setEntity ( user.getUserName ( ) ) ; getDomain ( ) . setSelectedItem ( user.getDomainControler ( ) ) ; disableLoginScreen ( ) ; setLoggedUser ( user ) ; raiseLoggedInEvent ( ) ; }

Target:
public void autoLogin ( org.ovirt.engine.core.common.businessentities.DbUser user ) { loggingInAutomatically = true ; getUserName ( ) . setEntity ( user.getLoginName ( ) ) ; getDomain ( ) . setSelectedItem ( user.getDomain ( ) ) ; disableLoginScreen ( ) ; setLoggedUser ( user ) ; raiseLoggedInEvent ( ) ; }
Source:
public void setItems ( java.util.Collection < T > value ) { java.util.SortedSet < T > items = new java.util.TreeSet < T > ( comparator ) ; items.addAll ( value ) ; super . setItems ( items ) ; }

Target:
protected final java.util.Collection < T > sortItems ( java.util.Collection < T > items ) { if ( ( items == null ) || ( ( comparator ) == null ) ) { return items ; } java.util.SortedSet < T > sortedItems = new java.util.TreeSet < T > ( comparator ) ; sortedItems.addAll ( items ) ; return sortedItems ; }
Source:
public void getMaxSpmPriority ( 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 ) ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public void getDataCenterVersions ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.compat.Version > > aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.SortListConverter < > ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters tempVar = new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableClusterVersionsByStoragePool , tempVar , aQuery ) ; }
Source:
protected void setStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VdsDynamic currentHost = org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getDbFacade ( ) . getVdsDynamicDao ( ) . get ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getVds ( ) . getId ( ) ) ; if ( ( currentHost != null ) && ( ( currentHost.getStatus ( ) ) != status ) ) { getBackend ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getVds ( ) . getId ( ) , status ) ) ; } }

Target:
protected void setStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VdsDynamic currentHost = org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getDbFacade ( ) . getVdsDynamicDao ( ) . get ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getVds ( ) . getId ( ) ) ; if ( ( currentHost != null ) && ( ( currentHost.getStatus ( ) ) != status ) ) { setVdsStatus ( status ) ; } }
Source:
public void testHotsetUpdateableWhenHotsetNotRequestedWithStatus ( ) { org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; oic.addField ( VMStatus.Down , "name" ) ; oic.addHotsetFields ( "name" ) ; org.junit.Assert.assertTrue ( "hot set not requested field should be updateable according to status" , oic.isFieldUpdatable ( VMStatus.Down , "name" , null , false ) ) ; }

Target:
public void testHotsetUpdateableWhenHotsetNotRequestedWithStatus ( ) { org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; oic.addField ( VMStatus.Down , "name" ) ; oic.addHotsetField ( "name" , java.util.EnumSet.of ( VMStatus.Up ) ) ; org.junit.Assert.assertTrue ( "hot set not requested field should be updateable according to status" , oic.isFieldUpdatable ( VMStatus.Down , "name" , null , false ) ) ; }
Source:
public void cleanDownVmsTest ( ) { org.ovirt.engine.core.common.businessentities.HostDevice device = getNetworkDevice ( ) ; org.ovirt.engine.core.common.businessentities.HostDeviceId deviceId = device.getId ( ) ; org.ovirt.engine.core.compat.Guid vmId = FixturesTool.VM_WITH_NO_ATTACHED_DISKS ; dao.setVmIdOnHostDevice ( deviceId , vmId ) ; device = dao.get ( deviceId ) ; org.junit.Assert.assertNotNull ( device ) ; org.junit.Assert.assertEquals ( vmId , device.getVmId ( ) ) ; dao.cleanDownVms ( ) ; device = dao.get ( deviceId ) ; org.junit.Assert.assertNull ( device.getVmId ( ) ) ; }

Target:
public void cleanDownVmsTest ( ) { org.ovirt.engine.core.common.businessentities.HostDevice device = getNetworkDevice ( ) ; org.ovirt.engine.core.common.businessentities.HostDeviceId deviceId = device.getId ( ) ; org.ovirt.engine.core.compat.Guid vmId = FixturesTool.VM_WITH_NO_ATTACHED_DISKS ; dao.setVmIdOnHostDevice ( deviceId , vmId ) ; device = dao.get ( deviceId ) ; org.junit.jupiter.api.Assertions.assertNotNull ( device ) ; org.junit.jupiter.api.Assertions.assertEquals ( vmId , device.getVmId ( ) ) ; dao.cleanDownVms ( ) ; device = dao.get ( deviceId ) ; org.junit.jupiter.api.Assertions.assertNull ( device.getVmId ( ) ) ; }
Source:
protected R resolveCreated ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.EntityIdResolver entityResolver , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { try { Q created = entityResolver.resolve ( ( ( org.ovirt.engine.core.compat.Guid ) ( result.getActionReturnValue ( ) ) ) ) ; return addLinks ( populate ( org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.map ( created ) , created ) , suggestedParentType ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; return null ; } }

Target:
private final R mapEntity ( java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType , Q created ) { R model = org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.map ( created ) ; model = org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.deprecatedPopulate ( model , created ) ; model = org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.doPopulate ( model , created ) ; return org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.addLinks ( model , suggestedParentType ) ; }
Source:
public void testNotEnoughForMultipleDiskAndDomainsAllDomainsFail ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesDisks = org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; imagesDisks.addAll ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID2 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ) ; org.mockito.Mockito.doReturn ( imagesDisks ) . when ( cmd ) . getSourceImages ( ) ; mockStorageDomainDAOGetForStoragePool ( 10 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; mockStorageDomainDAOGetForStoragePool ( 10 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID2 ) ; org.junit.Assert.assertFalse ( "Validation should fail. Second domain should not have enough free space for request." , cmd.validateStorageDomains ( ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > mockDisksList ( int numberOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = new java.util.ArrayList < > ( numberOfDisks ) ; for ( int index = 0 ; index < numberOfDisks ; index ++ ) { org.ovirt.engine.core.common.businessentities.DiskImage image = createDiskImage ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; disksList.add ( image ) ; } org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSourceImages ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSnapshotsDummiesForStorageAllocations ( ) ; return disksList ; }
Source:
private java.lang.Object getStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > sds = new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; org.ovirt.engine.core.common.businessentities.storage_domains sd = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; sd.setstorage_name ( "Storage_Domain_1" ) ; sd.setId ( GUIDS [ 2 ] ) ; sds.add ( sd ) ; return sds ; }

Target:
private java.lang.Object getStorageDomains ( ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > sds = new java.util.LinkedList < org.ovirt.engine.api.model.StorageDomain > ( ) ; org.ovirt.engine.api.model.StorageDomain sd = new org.ovirt.engine.api.model.StorageDomain ( ) ; sd.setStorageName ( "Storage_Domain_1" ) ; sd.setId ( GUIDS [ 2 ] ) ; sds.add ( sd ) ; return sds ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { createSpmControls ( object ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( object.getIsDiscorveredHosts ( ) . getEntity ( ) ) == true ) { rbDiscoveredHost.setValue ( true ) ; showDiscoveredHostsWidgets ( true ) ; } else { rbProvisionedHost.setValue ( true ) ; showProvisionedHostsWidgets ( true ) ; } }
Source:
public boolean detectBrowserPlugin ( ) { if ( configurator.isClientLinuxFirefox ( ) ) { return detectXpiPlugin ( ) ; } else if ( configurator.isClientWindowsExplorer ( ) ) { return detectActiveXPlugin ( ) ; } return false ; }

Target:
public boolean detectBrowserPlugin ( ) { if ( configurator.isClientLinuxFirefox ( ) ) { return detectXpiPlugin ( ) ; } else if ( ( configurator.isClientWindowsExplorer ( ) ) || ( cu.isIE11 ( ) ) ) { return detectActiveXPlugin ( ) ; } return false ; }
Source:
public static void getDefaultTimeZone ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.TimeZoneType timeZoneType ) { 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 "" ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setTimeZoneType ( timeZoneType ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDefualtTimeZone , params , aQuery ) ; }

Target:
public static void getDefaultTimeZone ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.TimeZoneType timeZoneType ) { 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 "" ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setTimeZoneType ( timeZoneType ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDefaultTimeZone , params , aQuery ) ; }
Source:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.List < java.lang.String > consoleDevices = returnValue.getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; }

Target:
public void onSuccess ( java.util.Set < java.lang.String > returnValue ) { if ( returnValue != null ) { java.util.Set < java.lang.String > emulatedSet = new java.util.TreeSet < > ( returnValue ) ; emulatedSet.add ( "" ) ; java.lang.String oldVal = getModel ( ) . getEmulatedMachine ( ) . getSelectedItem ( ) ; getModel ( ) . getEmulatedMachine ( ) . setItems ( emulatedSet ) ; getModel ( ) . getEmulatedMachine ( ) . setSelectedItem ( oldVal ) ; } }
Source:
private boolean isHostSupported ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusterList , org.ovirt.engine.core.common.businessentities.VDS host ) { for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusterList ) { if ( ! ( host.getSupportedClusterVersionsSet ( ) . contains ( cluster.getcompatibility_version ( ) ) ) ) { return false ; } } return true ; }

Target:
private boolean doesHostSupportAnyCluster ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusterList , org.ovirt.engine.core.common.businessentities.VDS host ) { for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusterList ) { if ( host.getSupportedClusterVersionsSet ( ) . contains ( cluster.getcompatibility_version ( ) ) ) { return true ; } } return false ; }
Source:
public static void getRoleList ( 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.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
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.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; return getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }

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.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; return getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) ; }
Source:
private static boolean isBalloonEnabled ( org.ovirt.engine.core.common.action.VmManagementParametersBase params ) { java.lang.Boolean balloonEnabled = params.isBalloonEnabled ( ) ; return balloonEnabled != null ? balloonEnabled : org.ovirt.engine.core.bll.utils.VmDeviceUtils.osRepository.isBalloonEnabled ( params.getVmStaticData ( ) . getOsId ( ) , org.ovirt.engine.core.bll.utils.ClusterUtils.getCompatibilityVersion ( params.getVmStaticData ( ) ) ) ; }

Target:
private static boolean isBalloonEnabled ( org.ovirt.engine.core.common.action.VmManagementParametersBase params ) { java.lang.Boolean balloonEnabled = params.isBalloonEnabled ( ) ; return balloonEnabled != null ? balloonEnabled : org.ovirt.engine.core.bll.utils.VmDeviceUtils.isBalloonEnabled ( params.getVmStaticData ( ) . getId ( ) ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { return ( super . equals ( obj ) ) && ( equalValues ( ( ( org.ovirt.engine.core.common.businessentities.qos.CpuQos ) ( obj ) ) ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.qos.CpuQos ) ) { return false ; } org.ovirt.engine.core.common.businessentities.qos.CpuQos other = ( ( org.ovirt.engine.core.common.businessentities.qos.CpuQos ) ( obj ) ) ; return ( super . equals ( obj ) ) && ( java.util.Objects.equals ( cpuLimit , other.cpuLimit ) ) ; }
Source:
public void testIsNetworkInSyncWhenBootProtocolDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testReportConfigurationsOnHostWhenSwitchTypeIsOutOfSync ( ) throws java.lang.Exception { cluster.setRequiredSwitchTypeForCluster ( SwitchType.OVS ) ; org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations reportedConfigurations = createTestedInstance ( ) . reportConfigurationsOnHost ( ) ; org.junit.Assert.assertThat ( reportedConfigurations.isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration > reportedConfigurationList = reportedConfigurations.getReportedConfigurationList ( ) ; org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration expectedReportedConfiguration = new org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration ( org.ovirt.engine.core.common.businessentities.network.ReportedConfigurationType.SWITCH_TYPE , org.ovirt.engine.core.common.network.SwitchType.LEGACY , org.ovirt.engine.core.common.network.SwitchType.OVS , false ) ; org.junit.Assert.assertThat ( reportedConfigurationList.contains ( expectedReportedConfiguration ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
public void setUp ( ) { newEnoughHost = newHost ( "RHEL - 7.2 - 1.el7" ) ; tooOldHost = newHost ( "RHEL - 5.0 - 1.el5" ) ; currentHost = newHost ( "RHEL - 6.1 - 1.el6" ) ; runningVm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; runningVm.setRunOnVds ( currentHost.getId ( ) ) ; org.mockito.Mockito.when ( vdsDynamicDao.get ( org.mockito.Matchers.eq ( currentHost.getId ( ) ) ) ) . thenReturn ( currentHost.getDynamicData ( ) ) ; }

Target:
public void setUp ( ) { newEnoughHost = newHost ( "RHEL - 7.2 - 1.el7" ) ; tooOldHost = newHost ( "RHEL - 5.0 - 1.el5" ) ; currentHost = newHost ( "RHEL - 6.1 - 1.el6" ) ; runningVm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; runningVm.setRunOnVds ( currentHost.getId ( ) ) ; org.mockito.Mockito.when ( vdsDynamicDao.get ( org.mockito.ArgumentMatchers.eq ( currentHost.getId ( ) ) ) ) . thenReturn ( currentHost.getDynamicData ( ) ) ; }
Source:
private boolean networkRequiredOnVds ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmIface , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > networksByName , boolean onlyRequiredNetworks ) { boolean networkRequiredOnVds = true ; if ( ! ( vmIface.isActive ( ) ) ) { networkRequiredOnVds = false ; } else if ( onlyRequiredNetworks ) { networkRequiredOnVds = networksByName.get ( vmIface.getNetworkName ( ) ) . getCluster ( ) . isRequired ( ) ; } return networkRequiredOnVds ; }

Target:
private boolean networkRequiredOnVds ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmIface , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > networksByName , boolean onlyRequiredNetworks ) { boolean networkRequiredOnVds = true ; if ( ! ( vmIface.isPlugged ( ) ) ) { networkRequiredOnVds = false ; } else if ( onlyRequiredNetworks ) { networkRequiredOnVds = networksByName.get ( vmIface.getNetworkName ( ) ) . getCluster ( ) . isRequired ( ) ; } return networkRequiredOnVds ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( ) { com.google.gwt.safehtml.shared.SafeHtml tooltip = null ; if ( ( getModel ( ) . isHotPlugAvailable ( ) ) && ( ! ( getModel ( ) . getIsDiskHotPlugSupported ( ) ) ) ) { tooltip = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( org.ovirt.engine.ui.common.widget.uicommon.vm.VmDiskListModelTable.constants.diskHotPlugNotSupported ( ) ) ; } return tooltip ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( ) { com.google.gwt.safehtml.shared.SafeHtml tooltip = null ; if ( ( getModel ( ) . isHotPlugAvailable ( ) ) && ( ! ( getModel ( ) . isPlugAvailableByDisks ( true ) ) ) ) { tooltip = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( org.ovirt.engine.ui.common.widget.uicommon.vm.VmDiskListModelTable.constants.diskHotPlugNotSupported ( ) ) ; } return tooltip ; }
Source:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getTemplateDiskList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
protected void updateCpuSharesAvailability ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; boolean availableCpuShares = ( cluster.getcompatibility_version ( ) . compareTo ( Version.v3_3 ) ) >= 0 ; getModel ( ) . getCpuSharesAmountSelection ( ) . setIsAvailable ( availableCpuShares ) ; getModel ( ) . getCpuSharesAmount ( ) . setIsAvailable ( availableCpuShares ) ; } }

Target:
protected void updateCpuSharesAvailability ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; boolean availableCpuShares = ( cluster.getCompatibilityVersion ( ) . compareTo ( Version.v3_3 ) ) >= 0 ; getModel ( ) . getCpuSharesAmountSelection ( ) . setIsAvailable ( availableCpuShares ) ; getModel ( ) . getCpuSharesAmount ( ) . setIsAvailable ( availableCpuShares ) ; } }
Source:
protected org.ovirt.engine.api.model.Cluster postPopulate ( org.ovirt.engine.api.model.Cluster model ) { org.ovirt.engine.api.model.ErrorHandling errorHandling = new org.ovirt.engine.api.model.ErrorHandling ( ) ; errorHandling.setOnError ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.MigrateOnError.class ) . value ( ) ) ; model.setErrorHandling ( errorHandling ) ; model.getSerialNumber ( ) . setPolicy ( SerialNumberPolicy.CUSTOM.value ( ) ) ; model.getRequiredRngSources ( ) . getRequiredRngSources ( ) . clear ( ) ; model.getRequiredRngSources ( ) . getRequiredRngSources ( ) . add ( RngSource.RANDOM.name ( ) ) ; return model ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Cluster postPopulate ( org.ovirt.engine.core.common.businessentities.Cluster model ) { org.ovirt.engine.api.model.ErrorHandling errorHandling = new org.ovirt.engine.api.model.ErrorHandling ( ) ; errorHandling.setOnError ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.MigrateOnError.class ) . value ( ) ) ; model.setErrorHandling ( errorHandling ) ; model.getSerialNumber ( ) . setPolicy ( SerialNumberPolicy.CUSTOM.value ( ) ) ; model.getRequiredRngSources ( ) . getRequiredRngSources ( ) . clear ( ) ; model.getRequiredRngSources ( ) . getRequiredRngSources ( ) . add ( RngSource.RANDOM.name ( ) ) ; return model ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageDomainDynamicDao ( ) ; staticDao = dbFacade.getStorageDomainStaticDao ( ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setstorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; newDynamicDomain.setavailable_disk_size ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.USED_DISK_SIZE ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageDomainDynamicDao ( ) ; staticDao = dbFacade.getStorageDomainStaticDao ( ) ; existingDynamic = dao.get ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.EXISTING_DOMAIN_ID ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setStorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newDynamicDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; newDynamicDomain.setavailable_disk_size ( org.ovirt.engine.core.dao.StorageDomainDynamicDAOTest.USED_DISK_SIZE ) ; }
Source:
void localize ( org.ovirt.engine.ui.userportal.ApplicationConstants constants ) { headerLabel.setText ( constants.loginHeaderLabel ( ) ) ; userNameEditor.setLabel ( constants.loginFormUserNameLabel ( ) ) ; passwordEditor.setLabel ( constants.loginFormPasswordLabel ( ) ) ; domainEditor.setLabel ( constants.loginFormDomainLabel ( ) ) ; connectAutomatically.setLabel ( constants.loginFormConnectAutomaticallyLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.userportal.ApplicationConstants constants ) { headerLabel.setText ( constants.loginHeaderLabel ( ) ) ; userNameLabel.setText ( constants.loginFormUserNameLabel ( ) ) ; passwordLabel.setText ( constants.loginFormPasswordLabel ( ) ) ; domainLabel.setText ( constants.loginFormDomainLabel ( ) ) ; connectAutomatically.setLabel ( constants.loginFormConnectAutomaticallyLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { initImportClonedTemplateDisks ( ) ; AddVmTemplateToDb ( ) ; AddVmInterfaces ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; MoveOrCopyAllImageGroups ( getVmTemplateId ( ) , getParameters ( ) . getImages ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( getVmTemplate ( ) ) ; setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { initImportClonedTemplateDisks ( ) ; AddVmTemplateToDb ( ) ; AddVmInterfaces ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; MoveOrCopyAllImageGroups ( getVmTemplateId ( ) , getParameters ( ) . getImages ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( getVmTemplate ( ) , getParameters ( ) . isImportAsNewEntity ( ) ) ; setSucceeded ( true ) ; }
Source:
private org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > setupCanAddVmFromTemplateTests ( final int domainSizeGB , final int sizeRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > cmd = createVmFromTemplateCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > generateDisksList ( int size ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < size ; ++ i ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disksList.add ( diskImage ) ; } return disksList ; }
Source:
public void testRemoveNonFound ( ) throws java.lang.Exception { 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.BackendNetworkResourceTest.NETWORK_ID } , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( p.getvm_count ( ) ) < ( highVdsCountTemp * ( p.getcpu_cores ( ) ) ) ) && ( ( p.getvm_count ( ) ) >= ( lowVdsCountTemp * ( p.getcpu_cores ( ) ) ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( p.getvm_count ( ) ) < ( highVdsCountTemp * ( org.ovirt.engine.core.bll.VdsSelector.getEffectiveCpuCores ( p ) ) ) ) && ( ( p.getvm_count ( ) ) >= ( lowVdsCountTemp * ( org.ovirt.engine.core.bll.VdsSelector.getEffectiveCpuCores ( p ) ) ) ) ; }
Source:
protected java.lang.Double [ ] getRawValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { return new java.lang.Double [ ] { object.getStatistics ( ) . getReceiveDropRate ( ) , object.getStatistics ( ) . getTransmitDropRate ( ) } ; }

Target:
protected java.lang.Double [ ] getRawValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { java.lang.Double receiveDropRate = ( object != null ) ? object.getStatistics ( ) . getReceiveDropRate ( ) : null ; java.lang.Double transmitDropRate = ( object != null ) ? object.getStatistics ( ) . getTransmitDropRate ( ) : null ; return new java.lang.Double [ ] { receiveDropRate , transmitDropRate } ; }
Source:
public void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean doRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.SearchParameters params = new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , ( doRefresh ? params : params.withoutRefresh ( ) ) , aQuery ) ; }

Target:
public void getConfigurationValueBoolean ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.queries.ConfigurationValues configVal ) { 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 ( configVal , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void validateQueryType ( javax.servlet.http.HttpServletRequest request ) throws java.lang.Exception { java.lang.String queryType = org.ovirt.engine.core.sso.utils.SSOUtils.getRequestParameter ( request , SSOConstants.HTTP_PARAM_SEARCH_QUERY_TYPE ) ; if ( ( ! ( directoryQueries.containsKey ( queryType ) ) ) && ( ! ( directoryPublicQueries.containsKey ( queryType ) ) ) ) { throw new org.ovirt.engine.core.sso.utils.OAuthException ( org.ovirt.engine.core.sso.utils.SSOConstants.ERR_CODE_INVALID_REQUEST , java.lang.String.format ( ssoContext.getLocalizationUtils ( ) . localize ( SSOConstants.APP_ERROR_UNSUPPORTED_PARAMETER_IN_REQUEST , ( ( java.util.Locale ) ( request.getAttribute ( SSOConstants.LOCALE ) ) ) ) , queryType , SSOConstants.HTTP_PARAM_SEARCH_QUERY_TYPE ) ) ; } }

Target:
private void validateQueryType ( javax.servlet.http.HttpServletRequest request ) throws java.lang.Exception { java.lang.String queryType = org.ovirt.engine.core.sso.utils.SsoUtils.getRequestParameter ( request , SsoConstants.HTTP_PARAM_SEARCH_QUERY_TYPE ) ; if ( ( ! ( directoryQueries.containsKey ( queryType ) ) ) && ( ! ( directoryPublicQueries.containsKey ( queryType ) ) ) ) { throw new org.ovirt.engine.core.sso.utils.OAuthException ( org.ovirt.engine.core.sso.utils.SsoConstants.ERR_CODE_INVALID_REQUEST , java.lang.String.format ( ssoContext.getLocalizationUtils ( ) . localize ( SsoConstants.APP_ERROR_UNSUPPORTED_PARAMETER_IN_REQUEST , ( ( java.util.Locale ) ( request.getAttribute ( SsoConstants.LOCALE ) ) ) ) , queryType , SsoConstants.HTTP_PARAM_SEARCH_QUERY_TYPE ) ) ; } }
Source:
public void getUsbPolicyOnUpdateCurrentlyDisabledGotEnabledPolicyNotSetUsbOnPre3_1Cluster ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setCompatibilityVersion ( Version.v3_0 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( usb , UsbPolicy.DISABLED , vdsGroup.getCompatibilityVersion ( ) ) , UsbPolicy.ENABLED_LEGACY ) ; }

Target:
public void getUsbPolicyOnUpdateCurrentlyNativeGotEnabledNotSetPolicyNotSetUsb ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; org.ovirt.engine.core.common.businessentities.UsbPolicy currentPolicy = org.ovirt.engine.core.common.businessentities.UsbPolicy.ENABLED_NATIVE ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( usb , currentPolicy ) , currentPolicy ) ; }
Source:
private void assignVNumaToPhysicalNuma ( org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel vNodeModel , java.lang.Integer nodeIdx ) { if ( ! ( p2vNumaNodesMap.containsKey ( nodeIdx ) ) ) { p2vNumaNodesMap.put ( nodeIdx , new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel > ( ) ) ; } p2vNumaNodesMap.get ( nodeIdx ) . add ( vNodeModel ) ; }

Target:
private void assignVNumaToPhysicalNuma ( org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel vNodeModel , java.lang.Integer hostNodeIndex ) { if ( ! ( p2vNumaNodesMap.containsKey ( hostNodeIndex ) ) ) { p2vNumaNodesMap.put ( hostNodeIndex , new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel > ( ) ) ; } p2vNumaNodesMap.get ( hostNodeIndex ) . add ( vNodeModel ) ; }
Source:
public void testRemoveNotFound ( ) throws java.lang.Exception { 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.BackendClusterNetworkResourceTest.NETWORK_ID } , null , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpClusterExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpEntityQueryExpectations ( 2 , false , false , false , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachNetworkToCluster , org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.QueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String identifier , boolean notFoundAs404 , boolean isMandatory ) { try { return doGetEntity ( clz , query , queryParams , identifier , isMandatory ) ; } catch ( java.lang.Exception e ) { return handleError ( clz , e , notFoundAs404 ) ; } }

Target:
public < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.QueryType query , org.ovirt.engine.core.common.queries.QueryParametersBase queryParams , java.lang.String identifier , boolean notFoundAs404 , boolean isMandatory ) { try { return doGetEntity ( clz , query , queryParams , identifier , isMandatory ) ; } catch ( java.lang.Exception e ) { return handleError ( clz , e , notFoundAs404 ) ; } }
Source:
public static void getDataCenterList ( 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( connectAutomatically.readConnectAutomatically ( ) ) && ( model.getCanConnectAutomatically ( ) ) ) && ( ! ( alreadyOpened ) ) ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel userPortalItemModel = model.GetStatusUpVms ( model.getItems ( ) ) . get ( 0 ) ; if ( userPortalItemModel != null ) { userPortalItemModel.getDefaultConsole ( ) . getConnectCommand ( ) . Execute ( ) ; alreadyOpened = true ; } } unregisterModels ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( connectAutomatically.readConnectAutomatically ( ) ) && ( model.getCanConnectAutomatically ( ) ) ) && ( ! ( alreadyOpened ) ) ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel userPortalItemModel = model.GetUpVms ( model.getItems ( ) ) . get ( 0 ) ; if ( userPortalItemModel != null ) { userPortalItemModel.getDefaultConsoleModel ( ) . getConnectCommand ( ) . Execute ( ) ; alreadyOpened = true ; } } unregisterModels ( ) ; }
Source:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.HostDevice > getDeviceAtomicGroup ( org.ovirt.engine.core.common.businessentities.HostDevice hostDevice ) { if ( ( ! ( org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.CAPABILITY_PCI.equals ( hostDevice.getCapability ( ) ) ) ) || ( ( hostDevice.getIommuGroup ( ) ) == null ) ) { return java.util.Collections.singleton ( hostDevice ) ; } return hostDeviceDao.getHostDevicesByHostIdAndIommuGroup ( org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getVm ( ) . getDedicatedVmForVds ( ) , hostDevice.getIommuGroup ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.HostDevice fetchHostDevice ( java.lang.String deviceName ) { return hostDeviceDao.getHostDeviceByHostIdAndDeviceName ( org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getVm ( ) . getDedicatedVmForVdsList ( ) . get ( 0 ) , deviceName ) ; }
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 getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( vm.getVmPoolId ( ) ) == null ) { org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig config = org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig.from ( vm.getVmType ( ) , vm.isStateless ( ) , vm.isNextRunConfigurationExists ( ) ) ; return config.getImageResource ( ) ; } else { if ( ! ( vm.isNextRunConfigurationExists ( ) ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeColumn.resources.manyDesktopsImage ( ) ; } else { return org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeColumn.resources.manyDesktopsChangesImage ( ) ; } } }

Target:
private static com.google.gwt.resources.client.ImageResource getPoolVmImageResource ( org.ovirt.engine.core.common.businessentities.VmType vmType , boolean nextRunConfigurationExists ) { switch ( vmType ) { case Server : return nextRunConfigurationExists ? org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeColumn.resources.manyServersChangesImage ( ) : org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeColumn.resources.manyServersImage ( ) ; case Desktop : default : return nextRunConfigurationExists ? org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeColumn.resources.manyDesktopsChangesImage ( ) : org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeColumn.resources.manyDesktopsImage ( ) ; } }