auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void Dispose ( ) { synchronized ( syncObj ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.info ( "IrsProxyData::disposing" ) ; ResetIrs ( ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . deleteJob ( storagePoolRefreshJobId ) ; if ( ( privatemIrsProxy ) != null ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcUtils.shutDownConnection ( ( ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsServerWrapper ) ( privatemIrsProxy ) ) . getHttpClient ( ) ) ; } _disposed = true ; } }

Target:
private void nullifyInternalProxies ( ) { if ( ( privatemIrsProxy ) != null ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcUtils.shutDownConnection ( ( ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsServerWrapper ) ( privatemIrsProxy ) ) . getHttpClient ( ) ) ; } setmCurrentIrsHost ( null ) ; privatemIrsProxy = null ; mCurrentVdsId = null ; }
Source:
public boolean Validate ( ) { org.ovirt.engine.ui.uicommonweb.validation.LengthValidation tempVar = new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( ) ; tempVar.setMaxLength ( 40 ) ; getName ( ) . ValidateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , tempVar , new org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation ( ) } ) ; return getName ( ) . getIsValid ( ) ; }

Target:
public boolean Validate ( ) { org.ovirt.engine.ui.uicommonweb.validation.LengthValidation tempVar = new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( ) ; tempVar.setMaxLength ( 40 ) ; getName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , tempVar , new org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation ( ) } ) ; return getName ( ) . getIsValid ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc getExternalVmList ( java.lang.String uri , java.lang.String username , java.lang.String password ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVMs ( uri , username , password ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMNamesListReturnForXmlRpc getExternalVmNamesList ( java.lang.String uri , java.lang.String username , java.lang.String password ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVMsNames ( uri , username , password ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMNamesListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMNamesListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void validClusterFirewallTypeForClusterVersion ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( Version.v4_0 ) ; org.mockito.Mockito.when ( cluster.getFirewallType ( ) ) . thenReturn ( FirewallType.FIREWALLD ) ; org.junit.Assert.assertThat ( validator.supportedFirewallTypeForClusterVersion ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void validClusterFirewallTypeForClusterVersion ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( Version.v4_0 ) ; org.mockito.Mockito.when ( cluster.getFirewallType ( ) ) . thenReturn ( FirewallType.FIREWALLD ) ; org.hamcrest.MatcherAssert.assertThat ( validator.supportedFirewallTypeForClusterVersion ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { buildVmData ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.log.info ( "VM {}" , createInfo ) ; vmReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.getBroker ( ) . create ( createInfo ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vm.getDynamicData ( ) , vmReturn.vm , org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.getVds ( ) ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { buildVmData ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CreateBrokerVDSCommand.log.info ( "VM {}" , createInfo ) ; vmReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.CreateBrokerVDSCommand.getBroker ( ) . create ( createInfo ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CreateBrokerVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vm.getDynamicData ( ) , vmReturn.vm , org.ovirt.engine.core.vdsbroker.vdsbroker.CreateBrokerVDSCommand.getVds ( ) ) ; }
Source:
public void getClusterUnsupportedVmsCpus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vdsGroupId , java.lang.String newCpuName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.HashMap ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterUnsupportedVmsCpus , new org.ovirt.engine.core.common.queries.GetClusterUnsupportedVmsCpusParameters ( vdsGroupId , newCpuName ) , aQuery ) ; }

Target:
public void getClusterEditWarnings ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterEditWarnings , new org.ovirt.engine.core.common.queries.ClusterEditParameters ( cluster ) , aQuery ) ; }
Source:
public void testGetAllByStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > result = dao.getAllByStatus ( StoragePoolStatus.Up ) ; org.junit.Assert.assertNotNull ( "list of returned pools in status up shouldn't be null" , result ) ; org.junit.Assert.assertEquals ( "wrong number of storage pools returned for up status" , 7 , result.size ( ) ) ; result = dao.getAllByStatus ( StoragePoolStatus.Maintenance ) ; org.junit.Assert.assertNotNull ( "list of returned pools in maintenance status shouldn't be null" , result ) ; org.junit.Assert.assertEquals ( "wrong number of storage pool returned for maintenance status" , 0 , result.size ( ) ) ; }

Target:
public void testGetAllByStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > result = dao.getAllByStatus ( StoragePoolStatus.Up ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result , "list of returned pools in status up shouldn't be null" ) ; org.junit.jupiter.api.Assertions.assertEquals ( 7 , result.size ( ) , "wrong number of storage pools returned for up status" ) ; result = dao.getAllByStatus ( StoragePoolStatus.Maintenance ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result , "list of returned pools in status up shouldn't be null" ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , result.size ( ) , "wrong number of storage pool returned for maintenance status" ) ; }
Source:
public void UpdateDetails ( org.ovirt.engine.core.common.businessentities.VM vm ) { getSelectedItemDefinedMemory ( ) . setEntity ( SizeParser ( vm.getvm_mem_size_mb ( ) ) ) ; getSelectedItemNumOfCpuCores ( ) . setEntity ( ( ( ( ( ( ( ( vm.getnum_of_cpus ( ) ) + " " ) + "(" ) + ( vm.getnum_of_sockets ( ) ) ) + " Socket(s), " ) + ( vm.getcpu_per_socket ( ) ) ) + " Core(s) per Socket)" ) ) ; }

Target:
public void UpdateDetails ( org.ovirt.engine.core.common.businessentities.VM vm ) { getSelectedItemDefinedMemory ( ) . setEntity ( SizeParser ( vm.getVmMemSizeMb ( ) ) ) ; getSelectedItemNumOfCpuCores ( ) . setEntity ( ( ( ( ( ( ( ( vm.getNumOfCpus ( ) ) + " " ) + "(" ) + ( vm.getNumOfSockets ( ) ) ) + " Socket(s), " ) + ( vm.getCpuPerSocket ( ) ) ) + " Core(s) per Socket)" ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { addVmImagesAndSnapshots ( ) ; updateSnapshotsFromExport ( ) ; MoveOrCopyAllImageGroups ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( getVm ( ) . getStaticData ( ) , getParameters ( ) . isImportAsNewEntity ( ) ) ; org.ovirt.engine.core.bll.VmHandler.LockVm ( getVm ( ) . getId ( ) ) ; if ( getParameters ( ) . isImportAsNewEntity ( ) ) { getParameters ( ) . setVm ( getVm ( ) ) ; setVmId ( getVm ( ) . getId ( ) ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { addVmImagesAndSnapshots ( ) ; updateSnapshotsFromExport ( ) ; moveOrCopyAllImageGroups ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( getVm ( ) . getStaticData ( ) , getParameters ( ) . isImportAsNewEntity ( ) ) ; org.ovirt.engine.core.bll.VmHandler.LockVm ( getVm ( ) . getId ( ) ) ; if ( getParameters ( ) . isImportAsNewEntity ( ) ) { getParameters ( ) . setVm ( getVm ( ) ) ; setVmId ( getVm ( ) . getId ( ) ) ; } return null ; }
Source:
protected boolean validateNoDuplicateDiskImages ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { if ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) { org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( images ) ; return validate ( diskImagesValidator.diskImagesAlreadyExist ( ) ) ; } return true ; }

Target:
java.util.Set < org.ovirt.engine.core.common.businessentities.GraphicsType > getGraphicsTypesForVm ( ) { java.util.Set < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypes = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice graphics : getDevicesOfType ( VmDeviceGeneralType.GRAPHICS ) ) { graphicsTypes.add ( org.ovirt.engine.core.common.businessentities.GraphicsType.fromVmDeviceType ( org.ovirt.engine.core.common.utils.VmDeviceType.getByName ( graphics.getDevice ( ) ) ) ) ; } return graphicsTypes ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getAddParameters ( network , entity ) ; return performCreate ( addAction , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }

Target:
private org.ovirt.engine.api.model.Networks mapCollection ( java.util.List < org.ovirt.engine.api.model.Network > entities ) { org.ovirt.engine.api.model.Networks collection = new org.ovirt.engine.api.model.Networks ( ) ; for ( org.ovirt.engine.api.model.Network entity : entities ) { collection.getNetworks ( ) . add ( addLinks ( map ( entity ) ) ) ; } return collection ; }
Source:
private void networkNotUsedByHostsTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { org.ovirt.engine.core.dao.VdsDao hostDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDao.class ) ; org.mockito.Mockito.when ( hostDao.getAllForNetwork ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( hosts ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; org.junit.Assert.assertThat ( validator.networkNotUsedByHosts ( ) , matcher ) ; }

Target:
private void networkNotUsedByHostsTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { org.ovirt.engine.core.dao.VdsDao hostDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDao.class ) ; org.mockito.Mockito.when ( hostDao.getAllForNetwork ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( hosts ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; org.junit.Assert.assertThat ( validator.networkNotUsedByHosts ( ) , matcher ) ; }
Source:
public void testAddAllSupportedHostFeature ( ) { java.util.Set < java.lang.String > newFatures = new java.util.HashSet < > ( java.util.Arrays.asList ( "NEW__FEATURE_1" , "NEW__FEATURE_2" , "NEW__FEATURE_3" ) ) ; dao.addAllSupportedHostFeature ( org.ovirt.engine.core.dao.SupportedHostFeatureDaoTest.EXISTING_HOST_ID_1 , newFatures ) ; java.util.Set < java.lang.String > featuresSupported = dao.getSupportedHostFeaturesByHostId ( org.ovirt.engine.core.dao.SupportedHostFeatureDaoTest.EXISTING_HOST_ID_1 ) ; org.junit.Assert.assertTrue ( "Failed to add the feature" , featuresSupported.containsAll ( newFatures ) ) ; }

Target:
public void testAddAllSupportedHostFeature ( ) { java.util.Set < java.lang.String > newFatures = new java.util.HashSet < > ( java.util.Arrays.asList ( "NEW__FEATURE_1" , "NEW__FEATURE_2" , "NEW__FEATURE_3" ) ) ; dao.addAllSupportedHostFeature ( FixturesTool.HOST_ID , newFatures ) ; java.util.Set < java.lang.String > featuresSupported = dao.getSupportedHostFeaturesByHostId ( FixturesTool.HOST_ID ) ; org.junit.Assert.assertTrue ( "Failed to add the feature" , featuresSupported.containsAll ( newFatures ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.Cluster createDefaultCluster ( ) { org.ovirt.engine.core.common.businessentities.Cluster group = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DEFAULT_CLUSTER_ID ) ; group.setCpuName ( "Intel Conroe" ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DC_ID1 ) ; group.setArchitecture ( ArchitectureType.x86_64 ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.Cluster createDefaultCluster ( ) { org.ovirt.engine.core.common.businessentities.Cluster group = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DEFAULT_CLUSTER_ID ) ; group.setCpuName ( "Intel Conroe" ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.DC_ID1 ) ; group.setArchitecture ( ArchitectureType.x86_64 ) ; group.setClusterPolicyId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return group ; }
Source:
public void validateCantUploadLockedImage ( ) { initializeSuppliedImage ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED , "" ) ) . when ( diskImagesValidator ) . diskImagesNotLocked ( ) ; getCommand ( ) . validate ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "Can't start a transfer for a locked image." , getCommand ( ) , EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED ) ; }

Target:
public void validateCantUploadLockedImage ( ) { initializeSuppliedImage ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED , "" ) ) . when ( diskImagesValidator ) . diskImagesNotLocked ( ) ; transferImageCommand.validate ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "Can't start a transfer for a locked image." , transferImageCommand , EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED ) ; }
Source:
protected void ExecuteVDSCommand ( ) { if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateSpmHostNameVDSCommand.getCurrentIrsProxyData ( ) . getmCurrentIrsHost ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.UpdateSpmHostNameVDSCommand.getParameters ( ) . getOldHostName ( ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.UpdateSpmHostNameVDSCommand.getCurrentIrsProxyData ( ) . setmCurrentIrsHost ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateSpmHostNameVDSCommand.getParameters ( ) . getNewHostName ( ) ) ; } }

Target:
protected void ExecuteVDSCommand ( ) { if ( org.apache.commons.lang.StringUtils.equals ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateSpmHostNameVDSCommand.getCurrentIrsProxyData ( ) . getmCurrentIrsHost ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.UpdateSpmHostNameVDSCommand.getParameters ( ) . getOldHostName ( ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.UpdateSpmHostNameVDSCommand.getCurrentIrsProxyData ( ) . setmCurrentIrsHost ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateSpmHostNameVDSCommand.getParameters ( ) . getNewHostName ( ) ) ; } }
Source:
private boolean areAgentsVersionCompatible ( org.ovirt.engine.core.common.businessentities.VDS proxyCandidate ) { org.ovirt.engine.core.utils.pm.VdsFenceOptions options = new org.ovirt.engine.core.utils.pm.VdsFenceOptions ( proxyCandidate.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) ; boolean supported = true ; for ( org.ovirt.engine.core.common.businessentities.FenceAgent agent : proxyCandidate.getFenceAgents ( ) ) { supported = supported && ( options.isAgentSupported ( agent.getType ( ) ) ) ; } return supported ; }

Target:
protected boolean isFencingPolicySupported ( org.ovirt.engine.core.common.businessentities.VDS proxyCandidate , org.ovirt.engine.core.compat.Version minimalSupportedVersion ) { boolean supported = ( ( fencingPolicy ) == null ) || ( proxyCandidate.getSupportedClusterVersionsSet ( ) . contains ( minimalSupportedVersion ) ) ; org.ovirt.engine.core.bll.pm.FenceProxyLocator.log.debug ( "Proxy candidate '{}' supports fencing policy '{}': {}" , proxyCandidate.getHostName ( ) , fencingPolicy , supported ) ; return supported ; }
Source:
private void doTestBadAddNic ( boolean valid , boolean success , java.lang.String detail ) { setUriInfo ( setUpActionExpectations ( ActionType.AddVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicsResourceTest.VM_ID } , valid , success ) ) ; org.ovirt.engine.api.model.Nic model = org.ovirt.engine.api.restapi.resource.BackendVmNicsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddNic ( boolean valid , boolean success , java.lang.String detail ) { setUriInfo ( setUpActionExpectations ( ActionType.AddVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicsResourceTest.VM_ID } , valid , success ) ) ; org.ovirt.engine.api.model.Nic model = org.ovirt.engine.api.restapi.resource.BackendVmNicsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public static java.util.Map < java.lang.String , java.lang.Object > getVideoDeviceSpecParams ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { return org.ovirt.engine.core.bll.utils.VideoDeviceSettings.selectVideoRAMSettings ( vmBase ) . getVideoDeviceSpecParams ( vmBase ) ; }

Target:
public static java.util.Map < java.lang.String , java.lang.Object > getVideoDeviceSpecParams ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { return org.ovirt.engine.core.bll.utils.VideoDeviceSettings.getVideoDeviceSettings ( vmBase ) . entrySet ( ) . stream ( ) . collect ( java.util.stream.Collectors.toMap ( java.util.Map.Entry :: getKey , ( e ) -> java.lang.String.valueOf ( e.getValue ( ) ) ) ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getParameters ( ) . getVmId ( ) ; status = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getBroker ( ) . migrateCancel ( vmId.toString ( ) ) ; proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . RemoveAsyncRunningVm ( vmId ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getParameters ( ) . getVmId ( ) ; status = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getBroker ( ) . migrateCancel ( vmId.toString ( ) ) ; proceedProxyReturnValue ( ) ; if ( ! ( org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getParameters ( ) . isRerunAfterCancel ( ) ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . RemoveAsyncRunningVm ( vmId ) ; } }
Source:
public static void getMaximalVmMemSize64OS ( 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.VM64BitMaxMemorySizeInMB ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static 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 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.businessentities.ImageFileType.All } , setUpFiles ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All } , setUpFiles ( ) , failure ) ; control.replay ( ) ; }
Source:
private boolean restoreInitialState ( ) { org.ovirt.engine.core.compat.Guid snapshotId = getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.RestoreStatelessVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ; if ( snapshotId == null ) { return true ; } java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesList = org.ovirt.engine.core.bll.RestoreStatelessVmCommand.getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ; if ( ( imagesList == null ) || ( imagesList.isEmpty ( ) ) ) { return true ; } return runInternalActionWithTasksContext ( VdcActionType.RestoreAllSnapshots , buildRestoreAllSnapshotsParameters ( imagesList ) , org.ovirt.engine.core.bll.RestoreStatelessVmCommand.getLock ( ) ) . getSucceeded ( ) ; }

Target:
private org.ovirt.engine.core.compat.Guid getVmSnapshotIdForType ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType type ) { return getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.RestoreStatelessVmCommand.getVmId ( ) , type ) ; }
Source:
private void removeEntry ( org.ovirt.engine.core.common.utils.Pair < T , V > item ) { items.remove ( item ) ; contentPanel.remove ( item.getSecond ( ) . getParent ( ) ) ; onRemove ( item.getFirst ( ) , item.getSecond ( ) ) ; }

Target:
public M flush ( ) { modelItems.clear ( ) ; for ( org.ovirt.engine.core.common.utils.Pair < T , V > item : items ) { T value = item.getFirst ( ) ; if ( ! ( isGhost ( value ) ) ) { modelItems.add ( value ) ; } } return model ; }
Source:
private void updateVmAfterMigrationToDifferentCluster ( ) { if ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getVdsGroupId ( ) . equals ( org.ovirt.engine.core.bll.MigrateVmCommand.getParameters ( ) . getTargetVdsGroupId ( ) ) ) { return ; } org.ovirt.engine.core.common.action.ChangeVMClusterParameters params = new org.ovirt.engine.core.common.action.ChangeVMClusterParameters ( org.ovirt.engine.core.bll.MigrateVmCommand.getParameters ( ) . getTargetVdsGroupId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) ) ; setSucceeded ( org.ovirt.engine.core.bll.MigrateVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.ChangeVMCluster , params ) . getSucceeded ( ) ) ; }

Target:
private void updateVmAfterMigrationToDifferentCluster ( ) { if ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getClusterId ( ) . equals ( org.ovirt.engine.core.bll.MigrateVmCommand.getParameters ( ) . getTargetClusterId ( ) ) ) { return ; } org.ovirt.engine.core.common.action.ChangeVMClusterParameters params = new org.ovirt.engine.core.common.action.ChangeVMClusterParameters ( org.ovirt.engine.core.bll.MigrateVmCommand.getParameters ( ) . getTargetClusterId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) ) ; setSucceeded ( org.ovirt.engine.core.bll.MigrateVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.ChangeVMCluster , params ) . getSucceeded ( ) ) ; }
Source:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.MacPool model = createIncompleteMacPool ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "MacPool" , "add" , getIncompleteFields ( ) ) ; } }

Target:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.MacPool model = createIncompleteMacPool ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "MacPool" , "add" , getIncompleteFields ( ) ) ; } }
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 GetAllowClusterWithVirtGlusterEnabled ( 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 ? source : java.lang.Boolean.TRUE ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.AllowClusterWithVirtGlusterEnabled , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
private boolean checkDerivedVmFromTemplateExists ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { java.util.List < java.lang.String > vmNames = getNamesOfDerivedVmsFromTemplate ( diskImage ) ; if ( ! ( vmNames.isEmpty ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.VMT_CANNOT_REMOVE_DETECTED_DERIVED_VM ) ; addCanDoActionMessageVariable ( "vmsList" , org.apache.commons.lang.StringUtils.join ( vmNames , "," ) ) ; return false ; } return true ; }

Target:
private boolean checkDerivedVmFromTemplateExists ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { java.util.List < java.lang.String > vmNames = getNamesOfDerivedVmsFromTemplate ( diskImage ) ; if ( ! ( vmNames.isEmpty ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.VMT_CANNOT_REMOVE_DETECTED_DERIVED_VM ) ; addCanDoActionMessageVariable ( "vmsList" , org.apache.commons.lang.StringUtils.join ( vmNames , "," ) ) ; return false ; } return true ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > createClusterList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setcompatibility_version ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.VERSION_1_0 ) ; cluster.setName ( "firstCluster" ) ; clusters.add ( cluster ) ; return clusters ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StoragePool createLowerVersionStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.createBasicPool ( ) ; pool.setIsLocal ( true ) ; pool.setCompatibilityVersion ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.VERSION_1_0 ) ; return pool ; }
Source:
public void execute ( ) { doGridTimerExecute ( ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.GridTimer getTimer ( ) { if ( ( gettimer ( ) ) == null ) { settimer ( new org.ovirt.engine.ui.uicommonweb.models.GridTimer ( getListName ( ) ) { @ java.lang.Override public void execute ( ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.logger.fine ( ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.this . getClass ( ) . getName ( ) ) + ": Executing search" ) ) ; syncSearch ( ) ; } } ) ; gettimer ( ) . setRefreshRate ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.getConfigurator ( ) . getPollingTimerInterval ( ) ) ; } return gettimer ( ) ; }
Source:
protected void setUpGetPayloadExpectations ( int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; }

Target:
protected void setUpGetPayloadExpectations ( int index , int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , getPayloadModel ( ) ) ; } }
Source:
private void addManagementNetworksToPool ( org.ovirt.engine.core.compat.Guid ... managementNetworkIds ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > managementNetworks = new java.util.ArrayList ( managementNetworkIds.length ) ; for ( org.ovirt.engine.core.compat.Guid managementNetworkId : managementNetworkIds ) { managementNetworks.add ( createNetwork ( managementNetworkId ) ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( managementNetworkId ) ) . thenReturn ( true ) ; } org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( managementNetworks ) ; }

Target:
private void addNonManagementNetworksToPool ( int numberOfNetwworks ) { for ( int i = 0 ; i < numberOfNetwworks ; i ++ ) { final org.ovirt.engine.core.compat.Guid networkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( networkId ) ; network.setId ( networkId ) ; allDcNetworks.add ( network ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( networkId ) ) . thenReturn ( false ) ; } org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( allDcNetworks ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( getEntityList ( ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UnlabelNetwork , org.ovirt.engine.core.common.action.UnlabelNetworkParameters.class , new java.lang.String [ ] { "NetworkId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelResourceTest.NETWORK_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( getEntityList ( ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.UnlabelNetwork , org.ovirt.engine.core.common.action.UnlabelNetworkParameters.class , new java.lang.String [ ] { "NetworkId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelResourceTest.NETWORK_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
protected void endStepJob ( org.ovirt.engine.core.common.job.Step step ) { getJobRepository ( ) . updateStep ( step ) ; org.ovirt.engine.core.bll.job.ExecutionContext finalContext = org.ovirt.engine.core.bll.job.ExecutionHandler.createFinalizingContext ( step.getId ( ) ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endTaskJob ( finalContext , org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJob.isTaskSuccess ( step ) ) ; }

Target:
private void createJobForTaskFromCLI ( final org.ovirt.engine.core.common.businessentities.VDSGroup cluster , final org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask task ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { 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 ( ) { try { createJobToMonitor ( cluster , task ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJob.log.error ( "Error creating job for task from CLI" , e ) ; } return null ; } } ) ; } } ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; alreadyInSystemVmMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VM > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmList ) { alreadyInSystemVmMap.put ( vm.getId ( ) , vm ) ; } setSuperItems ( value ) ; }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; alreadyInSystemVmMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VM > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmList ) { alreadyInSystemVmMap.put ( vm.getId ( ) , vm ) ; } org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel.super . setItems ( value ) ; }
Source:
protected boolean isVmRunningOnNonDefaultVds ( ) { return ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDedicatedVmForVds ( ) ) != null ) && ( ! ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getRunOnVds ( ) . equals ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDedicatedVmForVds ( ) ) ) ) ; }

Target:
protected void initParametersForPassthroughVnics ( ) { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setPassthroughVnicToVfMap ( getVnicToVfMap ( ) ) ; vfScheduler.cleanVmData ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; }
Source:
public void run ( ) { org.ovirt.engine.core.bll.VdsEventListener.log.infoFormat ( "ResourceManager::vdsNotResponding entered for Host {0}, {1}" , vds.getId ( ) , vds.gethost_name ( ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.VdsNotRespondingTreatment , new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.FenceActionType.Restart ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
public void run ( ) { org.ovirt.engine.core.bll.VdsEventListener.log.infoFormat ( "ResourceManager::vdsNotResponding entered for Host {0}, {1}" , vds.getId ( ) , vds.getHostName ( ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.VdsNotRespondingTreatment , new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.FenceActionType.Restart ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; if ( returnValue != null ) { org.ovirt.engine.core.common.businessentities.VDS localStorageHost = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( returnValue ) ) ; dataCenterGuideModel.localStorageHost = localStorageHost ; } else { noLocalStorageHost = true ; } dataCenterGuideModel.UpdateOptionsLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; if ( returnValue != null ) { org.ovirt.engine.core.common.businessentities.VDS localStorageHost = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( returnValue ) ) ; dataCenterGuideModel.localStorageHost = localStorageHost ; } else { noLocalStorageHost = true ; } dataCenterGuideModel.updateOptionsLocalFS ( ) ; }
Source:
private void initializeMacPool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { java.util.List < java.lang.String > macsForMacPool = macPoolDao.getAllMacsForMacPool ( macPool.getId ( ) ) ; final org.ovirt.engine.core.bll.network.macpool.MacPool pool = createPoolInternal ( macPool ) ; for ( java.lang.String mac : macsForMacPool ) { pool.forceAddMac ( mac ) ; } }

Target:
private void initializeMacPool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { java.util.List < java.lang.String > macsForMacPool = macPoolDao.getAllMacsForMacPool ( macPool.getId ( ) ) ; final org.ovirt.engine.core.bll.network.macpool.MacPool pool = createPoolInternal ( macPool ) ; org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.log.debug ( "Initializing with macs: {}" , pool , macsForMacPool ) ; for ( java.lang.String mac : macsForMacPool ) { pool.forceAddMac ( mac ) ; } }
Source:
protected void setUpGetEntityNextRunExpectations ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmNextRunConfiguration , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; }

Target:
protected void verifyModelOnNewCluster ( org.ovirt.engine.api.model.Vm model , int index ) { assertNotNull ( model.getCluster ( ) . getId ( ) ) ; assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyModel ( model , index ) ; }
Source:
public void testGetDiskAttachedToMultipleVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregisteredDisk = dao.getByDiskIdAndStorageDomainId ( FixturesTool.UNREGISTERED_DISK3 , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; org.junit.Assert.assertTrue ( "Disk should exists in the UnregisteredDisks table" , ( ! ( unregisteredDisk.isEmpty ( ) ) ) ) ; org.junit.Assert.assertEquals ( "Disk should be attached to VM" , 1 , unregisteredDisk.get ( 0 ) . getVms ( ) . size ( ) ) ; }

Target:
public void testGetDiskAttachedToMultipleVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregisteredDisk = dao.getByDiskIdAndStorageDomainId ( FixturesTool.UNREGISTERED_DISK3 , FixturesTool.STORAGE_DOMAIN_NFS2_1 ) ; org.junit.Assert.assertTrue ( "Disk should exists in the UnregisteredDisks table" , ( ! ( unregisteredDisk.isEmpty ( ) ) ) ) ; org.junit.Assert.assertEquals ( "Disk should be attached to VM" , 1 , unregisteredDisk.get ( 0 ) . getVms ( ) . size ( ) ) ; }
Source:
public void testParseWholeRangeMulticast ( ) { java.lang.String start = "01:FF:FF:FF:FF:00" ; java.lang.String end = "01:FF:FF:FF:FF:00" ; final java.util.Collection < org.apache.commons.lang.math.LongRange > ranges = org.ovirt.engine.core.utils.MacAddressRangeUtils.parseRangeString ( ( ( start + '-' ) + end ) ) ; org.junit.Assert.assertThat ( ranges.isEmpty ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testParseWholeRangeMulticast ( ) { java.lang.String start = "01:FF:FF:FF:FF:00" ; java.lang.String end = "01:FF:FF:FF:FF:00" ; final java.util.Collection < org.apache.commons.lang.math.LongRange > ranges = org.ovirt.engine.core.utils.MacAddressRangeUtils.parseRangeString ( ( ( start + '-' ) + end ) ) ; org.hamcrest.MatcherAssert.assertThat ( ranges.isEmpty ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; mockVdsDbFacadeAndDao ( ) ; setupExpectedGlusterVolumeOptionInfo ( ) ; setupMock ( ) ; }

Target:
private void setupMock ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( expected ) ; org.mockito.Mockito.doReturn ( returnValue ) . when ( getQuery ( ) ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeOptionsInfo ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ; org.mockito.Mockito.doReturn ( glusterUtils ) . when ( getQuery ( ) ) . getGlusterUtils ( ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( CLUSTER_ID ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }
Source:
private void validateAndExpectMtuValidation ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper , org.ovirt.engine.core.common.businessentities.network.Network net1 , org.ovirt.engine.core.common.businessentities.network.Network net2 ) { validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_MTU_DIFFERENCES , java.lang.String.format ( "[%s(%s), %s(%d)]" , net1.getName ( ) , ( ( net1.getMtu ( ) ) == 0 ? "default" : net1.getMtu ( ) ) , net2.getName ( ) , net2.getMtu ( ) ) ) ; }

Target:
private void validateAndExpectMtuValidation ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper , org.ovirt.engine.core.common.businessentities.network.Network net1 , org.ovirt.engine.core.common.businessentities.network.Network net2 ) { validateAndExpectViolation ( helper , EngineMessage.NETWORK_MTU_DIFFERENCES , java.lang.String.format ( "[%s(%s), %s(%d)]" , net1.getName ( ) , ( ( net1.getMtu ( ) ) == 0 ? "default" : net1.getMtu ( ) ) , net2.getName ( ) , net2.getMtu ( ) ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getPath ( ) ) ) ) { getPathChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; } else if ( ( ev.matchesDefinition ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getOverride ( ) ) ) ) { Override_EntityChanged ( args ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getPath ( ) ) ) ) { getPathChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; } else if ( ( ev.matchesDefinition ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getOverride ( ) ) ) ) { override_EntityChanged ( args ) ; } }
Source:
public static void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }

Target:
public void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return java.util.Collections.< org.ovirt.engine.core.common.businessentities.CertificateInfo > emptyList ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }