auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testValidateStoragePoolSucceeds ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; storagePool.setStatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; command.setStoragePoolId ( storagePool.getId ( ) ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }

Target:
public void testValidateStoragePoolSucceeds ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; storagePool.setStatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; command.setStoragePoolId ( storagePool.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( command.validate ( ) ) ; }
Source:
public void testRemoveAll ( ) { org.ovirt.engine.core.common.businessentities.EngineSession result = dao.get ( existingEngineSession.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 2 , dao.removeAll ( ) ) ; result = dao.get ( existingEngineSession.getId ( ) ) ; org.junit.Assert.assertNull ( result ) ; org.junit.Assert.assertEquals ( 0 , dao.removeAll ( ) ) ; }

Target:
public void testRemoveAll ( ) { org.ovirt.engine.core.common.businessentities.EngineSession result = dao.get ( existingEngineSession.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , dao.removeAll ( ) ) ; result = dao.get ( existingEngineSession.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , dao.removeAll ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.RoleGroupMap > getAllForRole ( org.ovirt.engine.core.compat.Guid id ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "role_id" , id ) ; return getCallsHandler ( ) . executeReadList ( "Get_role_groups_By_role_id" , RoleGroupMapRowMapper.instance , parameterSource ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.RoleGroupMap getByActionGroupAndRole ( org.ovirt.engine.core.common.businessentities.ActionGroup group , org.ovirt.engine.core.compat.Guid id ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "action_group_id" , group.getId ( ) ) . addValue ( "role_id" , id ) ; return getCallsHandler ( ) . executeRead ( "Get_roles_groups_By_action_group_id_And_By_role_id" , org.ovirt.engine.core.dao.RoleGroupMapDAODbFacadeImpl.RoleGroupMapRowMapper.instance , parameterSource ) ; }
Source:
public void validateFailsIfStopped ( ) { cmd.getParameters ( ) . setVolumeId ( stoppedVolumeId ) ; cmd.setGlusterVolumeId ( stoppedVolumeId ) ; cmd.getParameters ( ) . setGeoRepSessionId ( geoRepSessionId ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId , GeoRepSessionStatus.STOPPED ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsIfStopped ( ) { cmd.getParameters ( ) . setVolumeId ( stoppedVolumeId ) ; cmd.setGlusterVolumeId ( stoppedVolumeId ) ; cmd.getParameters ( ) . setGeoRepSessionId ( geoRepSessionId ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId , GeoRepSessionStatus.STOPPED ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.validate ( ) ) ; }
Source:
private org.ovirt.engine.core.dao.VdsGroupDAO mockVdsGroup ( ) { org.ovirt.engine.core.dao.VdsGroupDAO mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDAO.class ) ; org.ovirt.engine.core.common.businessentities.VDSGroup value = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; value.setEmulatedMachine ( "pc-1.0" ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; return mock ; }

Target:
private org.ovirt.engine.core.dao.VdsGroupDAO mockVdsGroup ( ) { org.ovirt.engine.core.dao.VdsGroupDAO mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDAO.class ) ; org.ovirt.engine.core.common.businessentities.VDSGroup value = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; value.setEmulatedMachine ( "pc-1.0" ) ; value.getRequiredRngSources ( ) . add ( VmRngDevice.Source.RANDOM ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; return mock ; }
Source:
protected void InitDetailModels ( ) { super . InitDetailModels ( ) ; importDiskListModel = new org.ovirt.engine.ui.uicommonweb.models.vms.VmImportDiskListModel ( ) ; org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.vms.VmImportInterfaceListModel ( ) ) ; list.add ( importDiskListModel ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.vms.VmAppListModel ( ) ) ; setDetailModels ( list ) ; }

Target:
public void setEntity ( java.lang.Object value ) { super . setEntity ( ( value == null ? null : ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( value ) ) . getVm ( ) ) ) ; }
Source:
protected void init ( ) { resource = new org.ovirt.engine.api.restapi.resource.BackendHostResource ( GUIDS [ 0 ] . toString ( ) , new org.ovirt.engine.api.restapi.resource.BackendHostsResource ( ) ) ; resource.setBackend ( backend ) ; resource.setMappingLocator ( mapperLocator ) ; resource.setSessionHelper ( sessionHelper ) ; resource.setMessageBundle ( messageBundle ) ; resource.setHttpHeaders ( httpHeaders ) ; }

Target:
protected void init ( ) { resource = new org.ovirt.engine.api.restapi.resource.BackendHostResource ( GUIDS [ 0 ] . toString ( ) , new org.ovirt.engine.api.restapi.resource.BackendHostsResource ( ) ) ; resource.setBackend ( backend ) ; resource.setMappingLocator ( mapperLocator ) ; resource.setValidatorLocator ( validatorLocator ) ; resource.setSessionHelper ( sessionHelper ) ; resource.setMessageBundle ( messageBundle ) ; resource.setHttpHeaders ( httpHeaders ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setstorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; storageListModel.connection.setid ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }
Source:
protected org.ovirt.engine.api.model.Disk getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DiskImage entity = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setvolume_format ( VolumeFormat.RAW ) ; entity.setDiskInterface ( DiskInterface.VirtIO ) ; entity.setImageStatus ( ImageStatus.OK ) ; entity.setvolume_type ( VolumeType.Sparse ) ; entity.setBoot ( false ) ; entity.setShareable ( false ) ; entity.setPropagateErrors ( PropagateErrors.On ) ; return org.ovirt.engine.api.restapi.resource.BackendExportDomainDisksResourceTest.setUpStatisticalEntityExpectations ( entity ) ; }

Target:
protected org.ovirt.engine.api.model.Disk getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DiskImage entity = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setvolumeFormat ( VolumeFormat.RAW ) ; entity.setDiskInterface ( DiskInterface.VirtIO ) ; entity.setImageStatus ( ImageStatus.OK ) ; entity.setVolumeType ( VolumeType.Sparse ) ; entity.setBoot ( false ) ; entity.setShareable ( false ) ; entity.setPropagateErrors ( PropagateErrors.On ) ; return org.ovirt.engine.api.restapi.resource.BackendExportDomainDisksResourceTest.setUpStatisticalEntityExpectations ( entity ) ; }
Source:
public static boolean isGraphicsAndDisplaySupported ( int osId , org.ovirt.engine.core.compat.Version version , java.util.Collection < org.ovirt.engine.core.common.businessentities.GraphicsType > graphics , org.ovirt.engine.core.common.businessentities.DisplayType displayType ) { for ( org.ovirt.engine.core.common.businessentities.GraphicsType graphicType : graphics ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.getOsRepository ( ) . getGraphicsAndDisplays ( ) . get ( osId ) . get ( version ) . contains ( new org.ovirt.engine.core.common.utils.Pair ( graphicType , displayType ) ) ) ) { return false ; } } return true ; }

Target:
public boolean isGraphicsAndDisplaySupported ( int osId , org.ovirt.engine.core.compat.Version version , java.util.Collection < org.ovirt.engine.core.common.businessentities.GraphicsType > graphics , org.ovirt.engine.core.common.businessentities.DisplayType displayType ) { for ( org.ovirt.engine.core.common.businessentities.GraphicsType graphicType : graphics ) { if ( ! ( osRepository.getGraphicsAndDisplays ( ) . get ( osId ) . get ( version ) . contains ( new org.ovirt.engine.core.common.utils.Pair ( graphicType , displayType ) ) ) ) { return false ; } } return true ; }
Source:
public static void getMaximalVmMemSize32OS ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 20480 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void isClusterEmpty ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { runQueryByIdParameter ( VdcQueryType.IsClusterEmpty , aQuery , clusterId ) ; }
Source:
private void updateIsUsbEnabled ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isUSBEnabledByDefault ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { setIsUsbEnabled ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) ) ; }

Target:
private void updateSpiceUsbAutoShare ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getSpiceUsbAutoShare ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spice.getOptions ( ) . setUsbAutoShare ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) ) ; }
Source:
void handleUiMode ( org.ovirt.engine.ui.webadmin.uimode.UiModeData uiModeData ) { org.ovirt.engine.core.common.mode.ApplicationMode uiMode = uiModeData.getUiMode ( ) ; org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.setUiMode ( uiMode ) ; }

Target:
protected void performBootstrap ( ) { super . performBootstrap ( ) ; com.google.gwt.user.client.Window.setTitle ( dynamicMessages.applicationTitle ( ) ) ; org.ovirt.engine.core.common.mode.ApplicationMode uiMode = org.ovirt.engine.ui.webadmin.uimode.UiModeData.getUiMode ( ) ; if ( uiMode != null ) { org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.setUiMode ( uiMode ) ; } placeManager.revealCurrentPlace ( ) ; }
Source:
protected org.ovirt.engine.api.model.NIC populate ( org.ovirt.engine.api.model.NIC model , org.ovirt.engine.core.common.businessentities.VmNetworkInterface entity ) { org.ovirt.engine.core.common.businessentities.Network network = findNetwork ( model ) ; if ( network != null ) { model.getNetwork ( ) . setId ( network.getId ( ) . toString ( ) ) ; model.getNetwork ( ) . setName ( null ) ; } return model ; }

Target:
protected org.ovirt.engine.api.model.NIC populate ( org.ovirt.engine.api.model.NIC model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { org.ovirt.engine.core.common.businessentities.network.Network network = findNetwork ( model ) ; if ( network != null ) { model.getNetwork ( ) . setId ( network.getId ( ) . toString ( ) ) ; model.getNetwork ( ) . setName ( null ) ; } return model ; }
Source:
public static void isUSBEnabledByDefault ( 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 ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getRpmVersion ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
private void validateNetworkQos ( ) { validateQosOverriddenInterfaces ( ) ; validateQosNotPartiallyConfigured ( ) ; validateQosCommitment ( ) ; }

Target:
private void validateInterfacesExist ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : params.getInterfaces ( ) ) { updateBaseInterface ( iface ) ; java.lang.String nameWithoutVlanId = org.ovirt.engine.core.utils.NetworkUtils.stripVlan ( iface ) ; if ( ( ! ( getExistingIfaces ( ) . containsKey ( nameWithoutVlanId ) ) ) && ( ! ( bonds.containsKey ( nameWithoutVlanId ) ) ) ) { addViolation ( EngineMessage.NETWORK_INTERFACES_DONT_EXIST , nameWithoutVlanId ) ; } } }
Source:
public static void IsVmNameUnique ( 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 ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmWithSameNameExistParameters ( name ) , aQuery ) ; }

Target:
public static void GetDataCentersByStorageDomain ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }
Source:
public void testGetAllStorageDomainsByImageGroup ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > result = dao.getAllStorageDomainsByImageGroup ( new org.ovirt.engine.core.compat.Guid ( "1b26a52b-b60f-44cb-9f46-3ef333b04a34" ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( result.get ( 0 ) , existingDomain.getId ( ) ) ; }

Target:
public void testGetAllStorageDomainsByImageId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > result = dao.getAllStorageDomainsByImageId ( FixturesTool.TEMPLATE_IMAGE_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 , result.get ( 0 ) . getId ( ) ) ; }
Source:
public void customPropertiesNoNetwork ( ) { mockExistingNetworks ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNic ( "eth0" , null ) ; mockExistingIfaces ( iface ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndAssertNoChanges ( helper ) ; }

Target:
public void customPropertiesNoNetwork ( ) { mockExistingNetworks ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNic ( "eth0" , null ) ; mockExistingIfaces ( iface ) ; customProperties.add ( iface , createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndAssertNoChanges ( helper ) ; }
Source:
public void testUpdateBrickTaskByHostIdBrickDir ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask asyncTask = new org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask ( ) ; asyncTask.setTaskId ( FixturesTool.GLUSTER_ASYNC_TASK_ID1 ) ; dao.updateBrickTaskByHostIdBrickDir ( existingBrick.getServerId ( ) , existingBrick.getBrickDirectory ( ) , FixturesTool.GLUSTER_ASYNC_TASK_ID1 ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newEnity = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.Assert.assertEquals ( FixturesTool.GLUSTER_ASYNC_TASK_ID1 , newEnity.getAsyncTask ( ) . getTaskId ( ) ) ; }

Target:
public void testUpdateBrickTaskByHostIdBrickDir ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask asyncTask = new org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask ( ) ; asyncTask.setTaskId ( FixturesTool.GLUSTER_ASYNC_TASK_ID1 ) ; dao.updateBrickTaskByHostIdBrickDir ( existingBrick.getServerId ( ) , existingBrick.getBrickDirectory ( ) , FixturesTool.GLUSTER_ASYNC_TASK_ID1 ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newEnity = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.GLUSTER_ASYNC_TASK_ID1 , newEnity.getAsyncTask ( ) . getTaskId ( ) ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.List < ? > ) ( source ) ) ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; }

Target:
public void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > aQuery , org.ovirt.engine.core.compat.Guid spId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > consoleDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > devs = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsRngEnabled ( ) . setEntity ( ( ! ( devs.isEmpty ( ) ) ) ) ; getModel ( ) . setRngDevice ( ( devs.isEmpty ( ) ? new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) : devs.get ( 0 ) ) ) ; }
Source:
private boolean noChangesDetected ( ) { return ( ( ( getNetworks ( ) . isEmpty ( ) ) && ( getRemovedNetworks ( ) . isEmpty ( ) ) ) && ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getBonds ( ) . isEmpty ( ) ) ) && ( getRemovedBonds ( ) . isEmpty ( ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > applyUserConfiguredNics ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > userConfiguredNics = new java.util.ArrayList < > ( ) ; userConfiguredNics.addAll ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getBonds ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingBondToRemove : getRemovedBonds ( ) ) { existingBondToRemove.setLabels ( null ) ; userConfiguredNics.add ( existingBondToRemove ) ; } return userConfiguredNics ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result1.getState ( ) ) ) ; vmListModel1.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { vmListModel1.cancel ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel1.getWindow ( ) . stopProgress ( ) ; vmListModel1.cancel ( ) ; }
Source:
public java.lang.Object runInTransaction ( ) { org.ovirt.engine.core.compat.Guid guid1 = createTask ( ret1.getCreationInfo ( ) , VdcActionType.HibernateVm , VdcObjectType.Storage , getStorageDomainId ( ) . getValue ( ) ) ; getReturnValue ( ) . getTaskIdList ( ) . add ( guid1 ) ; getCompensationContext ( ) . resetCompensation ( ) ; return null ; }

Target:
public org.ovirt.engine.core.compat.Guid runInTransaction ( ) { getCompensationContext ( ) . resetCompensation ( ) ; return createTaskInCurrentTransaction ( ret1.getCreationInfo ( ) , VdcActionType.HibernateVm , VdcObjectType.Storage , getStorageDomainId ( ) . getValue ( ) ) ; }
Source:
public boolean equalValues ( org.ovirt.engine.core.common.businessentities.qos.CpuQos other ) { return java.util.Objects.equals ( cpuLimit , other.getCpuLimit ( ) ) ; }

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:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . update ( numOfVmsEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.hiddenField ( ) ) . update ( newPoolEditVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.hiddenField ( ) ) . update ( editPoolEditVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.simpleField ( ) ) . update ( editPoolIncraseNumOfVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.simpleField ( ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . update ( numOfVmsEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( newPoolEditVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( newPoolEditMaxAssignedVmsPerUserPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( editPoolEditVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField ( ) ) . update ( editPoolIncraseNumOfVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField ( ) ) . update ( editPoolEditMaxAssignedVmsPerUserPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField ( ) ) ; }
Source:
protected boolean isNotLocalData ( final boolean isInternal ) { boolean returnValue = true ; if ( ( ( ( this . getStoragePool ( ) . getstorage_pool_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) && ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) ) && ( ! isInternal ) ) { returnValue = false ; addCanDoActionMessage ( VdcBllMessages.VDS_GROUP_CANNOT_DETACH_DATA_DOMAIN_FROM_LOCAL_STORAGE ) ; } return returnValue ; }

Target:
protected boolean isNotLocalData ( final boolean isInternal ) { boolean returnValue = true ; if ( ( ( ( this . getStoragePool ( ) . getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) && ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) ) && ( ! isInternal ) ) { returnValue = false ; addCanDoActionMessage ( VdcBllMessages.VDS_GROUP_CANNOT_DETACH_DATA_DOMAIN_FROM_LOCAL_STORAGE ) ; } return returnValue ; }
Source:
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.VDSGroup > ( ) ; } final 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 ) ; }

Target:
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.VDSGroup > ( ) ; } final 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 ) ; }
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.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : java.util.Collections.emptyList ( ) ; }
Source:
public void testGetAllForStorageDomainWithVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllForStorageDomain ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.VM_RHEL5_POOL_57 , result.get ( 0 ) . getId ( ) ) ; }

Target:
public void testGetAllForStorageDomainWithVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllForStorageDomain ( FixturesTool.STORAGE_DOMAIN_SCALE_SD5 ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.VM_RHEL5_POOL_57 , result.get ( 0 ) . getId ( ) ) ; }
Source:
public void updateSuggestedDiskAliasFromServer ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNextAvailableDiskAliasNameByVMId ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String suggestedDiskAlias = ( ( java.lang.String ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( model ) ) ; diskModel.getAlias ( ) . setEntity ( suggestedDiskAlias ) ; } } ) , getVm ( ) . getId ( ) ) ; }

Target:
public void updateSuggestedDiskAliasFromServer ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNextAvailableDiskAliasNameByVMId ( new org.ovirt.engine.ui.uicommonweb.models.vms.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.String > ( ) { @ java.lang.Override public void onSuccess ( java.lang.String suggestedDiskAlias ) { getAlias ( ) . setEntity ( suggestedDiskAlias ) ; } } ) , getVm ( ) . getId ( ) ) ; }
Source:
public static void getAAANamespaces ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc refreshStoragePool ( java.lang.String spUUID , java.lang.String msdUUID , int masterVersion ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StoragePool.refresh" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "masterSdUUID" , msdUUID ) . withParameter ( "masterVersion" , masterVersion ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc prepareImage ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID , boolean allowIllegal ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Image.prepare" ) . withParameter ( "storagepoolID" , spID ) . withParameter ( "storagedomainID" , sdID ) . withParameter ( "imageID" , imageID ) . withParameter ( "volumeID" , volumeID ) . withParameter ( "allowIllegal" , allowIllegal ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc ( response ) ; }
Source:
public void testNotRemovingManagementNetwork ( ) { org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator networkAttachmentValidatorSpy = org.mockito.Mockito.spy ( createNetworkAttachmentValidator ( new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ) ) ; org.mockito.Mockito.doReturn ( networkValidatorMock ) . when ( networkAttachmentValidatorSpy ) . getNetworkValidator ( ) ; org.ovirt.engine.core.bll.ValidationResult propagatedResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_CANNOT_REMOVE_MANAGEMENT_NETWORK , "a" ) ; org.mockito.Mockito.when ( networkValidatorMock.notRemovingManagementNetwork ( ) ) . thenReturn ( propagatedResult ) ; org.junit.Assert.assertThat ( "ValidationResult is not propagated correctly" , networkAttachmentValidatorSpy.notRemovingManagementNetwork ( ) , org.hamcrest.Matchers.is ( propagatedResult ) ) ; }

Target:
public void testNotRemovingManagementNetwork ( ) { org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator networkAttachmentValidatorSpy = org.mockito.Mockito.spy ( createNetworkAttachmentValidator ( new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ) ) ; org.mockito.Mockito.doReturn ( networkValidatorMock ) . when ( networkAttachmentValidatorSpy ) . getNetworkValidator ( ) ; org.ovirt.engine.core.bll.ValidationResult propagatedResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_CANNOT_REMOVE_MANAGEMENT_NETWORK , "a" ) ; org.mockito.Mockito.when ( networkValidatorMock.notRemovingManagementNetwork ( ) ) . thenReturn ( propagatedResult ) ; org.hamcrest.MatcherAssert.assertThat ( "ValidationResult is not propagated correctly" , networkAttachmentValidatorSpy.notRemovingManagementNetwork ( ) , org.hamcrest.Matchers.is ( propagatedResult ) ) ; }
Source:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( 0 , true ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( 0 , true ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.VM_ID } , getVm ( ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVm , org.ovirt.engine.core.common.action.VmManagementParametersBase.class , new java.lang.String [ ] { "VmStaticData.IsoPath" } , new java.lang.Object [ ] { null } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.VM_ID } , getVm ( ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVm , org.ovirt.engine.core.common.action.VmManagementParametersBase.class , new java.lang.String [ ] { "VmStaticData.IsoPath" } , new java.lang.Object [ ] { null } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "vCenter" , getvCenter ( ) ) . append ( "ESX" , getEsx ( ) ) . append ( "dataCenter" , getDataCenter ( ) ) . append ( "verifySSL" , isVerifySSL ( ) ) . append ( "storagePoolId" , getStoragePoolId ( ) ) . append ( "proxyHostId" , getProxyHostId ( ) ) . build ( ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder getToStringBuilder ( ) { return super . getToStringBuilder ( ) . append ( "vCenter" , getvCenter ( ) ) . append ( "ESX" , getEsx ( ) ) . append ( "dataCenter" , getDataCenter ( ) ) . append ( "verifySSL" , isVerifySSL ( ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( getDisk ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } org.ovirt.engine.core.bll.validator.storage.DiskValidator oldDiskValidator = new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( getDisk ( ) ) ; return ( ( validate ( oldDiskValidator.validateNotHostedEngineDisk ( ) ) ) && ( validateAllVmsForDiskAreDown ( ) ) ) && ( canRemoveDiskBasedOnStorageTypeCheck ( ) ) ; }

Target:
protected boolean canDoAction ( ) { if ( ( getDisk ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } org.ovirt.engine.core.bll.validator.storage.DiskValidator oldDiskValidator = new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( getDisk ( ) ) ; return ( ( validate ( oldDiskValidator.validateNotHostedEngineDisk ( ) ) ) && ( validateAllVmsForDiskAreDown ( ) ) ) && ( canRemoveDiskBasedOnStorageTypeCheck ( ) ) ; }
Source:
public void calculateFreeVirtualMemory ( ) { if ( ( ( ( getMemCommited ( ) ) != null ) && ( ( getPhysicalMemMb ( ) ) != null ) ) && ( ( getReservedMem ( ) ) != null ) ) { maxSchedulingMemory = ( ( ( ( ( getMaxVdsMemoryOverCommit ( ) ) * ( getPhysicalMemMb ( ) ) ) / 100.0F ) - ( getMemCommited ( ) ) ) - ( getReservedMem ( ) ) ) - ( getPendingVmemSize ( ) ) ; maxSchedulingMemory = ( ( maxSchedulingMemory ) > 0 ) ? maxSchedulingMemory : 0 ; } }

Target:
public void calculateFreeSchedulingMemoryCache ( ) { if ( ( ( ( getMemCommited ( ) ) != null ) && ( ( getPhysicalMemMb ( ) ) != null ) ) && ( ( getReservedMem ( ) ) != null ) ) { maxSchedulingMemory = ( getFreeVirtualMemory ( ) ) - ( getPendingVmemSize ( ) ) ; maxSchedulingMemory = ( ( maxSchedulingMemory ) > 0 ) ? maxSchedulingMemory : 0 ; } }
Source:
public void testVirtCanMoveToMaintenance ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setstatus ( VDSStatus.PreparingForMaintenance ) ; vds.setvm_count ( 1 ) ; org.junit.Assert.assertFalse ( virtStrategy.canMoveToMaintenance ( vds ) ) ; vds.setvm_count ( 0 ) ; org.junit.Assert.assertTrue ( virtStrategy.canMoveToMaintenance ( vds ) ) ; }

Target:
public void testVirtCanMoveToMaintenance ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.PreparingForMaintenance ) ; vds.setVmCount ( 1 ) ; org.junit.Assert.assertFalse ( virtStrategy.canMoveToMaintenance ( vds ) ) ; vds.setVmCount ( 0 ) ; org.junit.Assert.assertTrue ( virtStrategy.canMoveToMaintenance ( vds ) ) ; }
Source:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { getView ( ) . spiceSelected ( event.getValue ( ) ) ; getView ( ) . setWanOptionsVisible ( ( ( wanOptionsAvailable ) && ( event.getValue ( ) ) ) ) ; getView ( ) . rdpSelected ( ( ! ( event.getValue ( ) ) ) ) ; }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { getView ( ) . showVncPanel ( event.getValue ( ) ) ; }
Source:
public void testGetAllStorageDomainsByImageId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getAllStorageDomainsByImageId ( FixturesTool.TEMPLATE_IMAGE_ID ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 , result.get ( 0 ) . getId ( ) ) ; }

Target:
public void testGetAllStorageDomainsByImageId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getAllStorageDomainsByImageId ( FixturesTool.TEMPLATE_IMAGE_ID ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = result.get ( 0 ) ; org.junit.Assert.assertEquals ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 , domain.getId ( ) ) ; org.junit.Assert.assertEquals ( "Wrong committed disk size" , 8 , domain.getCommittedDiskSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong actual disk size" , 4 , domain.getActualImagesSize ( ) ) ; }
Source:
protected java.util.List < java.lang.String > listFiles ( ) { org.ovirt.engine.core.common.queries.GetAllIsoImagesListParameters queryParams = new org.ovirt.engine.core.common.queries.GetAllIsoImagesListParameters ( asGuid ( storageDomainId ) ) ; queryParams.setForceRefresh ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > files = getBackendCollection ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData.class , VdcQueryType.GetAllImagesList , queryParams ) ; java.util.List < java.lang.String > fileNames = new java.util.LinkedList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData file : files ) { fileNames.add ( file.getRepoFileName ( ) ) ; } return fileNames ; }

Target:
protected java.util.List < java.lang.String > listFiles ( ) { org.ovirt.engine.core.common.queries.GetImagesListParameters queryParams = new org.ovirt.engine.core.common.queries.GetImagesListParameters ( asGuid ( storageDomainId ) , org.ovirt.engine.core.common.businessentities.FileTypeExtension.ISO ) ; queryParams.setForceRefresh ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > files = getBackendCollection ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData.class , VdcQueryType.GetImagesList , queryParams ) ; java.util.List < java.lang.String > fileNames = new java.util.LinkedList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.RepoFileMetaData file : files ) { fileNames.add ( file.getRepoFileName ( ) ) ; } return fileNames ; }
Source:
public void testUpdateLockedDisk ( ) { final org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = createDiskImage ( ) ; disk.setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; initializeCommand ( parameters ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED ) ; }

Target:
public void testUpdateLockedDisk ( ) { final org.ovirt.engine.core.common.action.VmDiskOperationParameterBase parameters = createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = createDiskImage ( ) ; disk.setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; initializeCommand ( parameters ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( target ) ) ; boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( returnValue ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; diskModel1.setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . directLUNDiskNotSupported ( ) : "" ) ) ; }

Target:
private void updateDirectLunDiskEnabled ( org.ovirt.engine.core.common.businessentities.storage_pool datacenter ) { boolean isInternal = ( ( java.lang.Boolean ) ( getIsInternal ( ) . getEntity ( ) ) ) ; if ( isInternal ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel.CONSTANTS.directLUNDiskNotSupported ( ) : "" ) ) ; }