auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void handleAddPermissions ( java.lang.String domainName , java.lang.String userName , java.lang.String userId ) { if ( args.containsKey ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ARG_ADD_PERMISSIONS ) ) { updatePermissionsTable ( userName , domainName , userId ) ; } else if ( ! ( userHasPermissions ( userName , domainName ) ) ) { java.lang.System.out.println ( java.lang.String.format ( INFO_ABOUT_NOT_ADDING_PERMISSIONS , domainName ) ) ; } }

Target:
private void handleAddPermissions ( java.lang.String domainName , java.lang.String userName , java.lang.String userId ) { java.lang.System.out.println ( java.lang.String.format ( INFO_ABOUT_NOT_ADDING_PERMISSIONS , domainName ) ) ; }
Source:
protected boolean disconnectStorage ( ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DisconnectStorageServer , new org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters ( org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections [ ] { org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getConnection ( ) } ) ) ) ) . getSucceeded ( ) ; }

Target:
protected boolean disconnectStorage ( ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DisconnectStorageServer , new org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters ( org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections [ ] { org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getConnection ( ) } ) ) ) ) . getSucceeded ( ) ; }
Source:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getCompatibilityVersion ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangeable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; }

Target:
private void updateShareableDiskEnabled ( ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangeable ( isEditEnabled ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter : dataCenters ) { reportModel.addDataCenterID ( dataCenter.getId ( ) . toString ( ) ) ; } if ( reportModel == null ) { return ; } setWidgetModel ( reportModel ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters ) { for ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter : dataCenters ) { reportModel.addDataCenterID ( dataCenter.getId ( ) . toString ( ) ) ; } if ( reportModel == null ) { return ; } setWidgetModel ( reportModel ) ; }
Source:
public void testSave ( ) { dao.save ( dummyPolicy ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy result = dao.get ( dummyPolicy.getId ( ) , java.util.Collections.emptyMap ( ) ) ; org.junit.Assert.assertTrue ( result.equals ( dummyPolicy ) ) ; dao.remove ( dummyPolicy.getId ( ) ) ; }

Target:
public void testSave ( ) { dao.save ( dummyPolicy ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy result = dao.get ( dummyPolicy.getId ( ) , java.util.Collections.emptyMap ( ) ) ; org.junit.Assert.assertEquals ( result , dummyPolicy ) ; dao.remove ( dummyPolicy.getId ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > setupCanAddVmFromSnapshotTests ( final int domainSizeGB , final int sizeRequired , final int pctRequired , org.ovirt.engine.core.compat.Guid sourceSnapshotId ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired , pctRequired ) ; initializeVmDAOMock ( vm ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > cmd = createVmFromSnapshotCommand ( vm , sourceSnapshotId ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }

Target:
private org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > setupCanAddVmFromSnapshotTests ( final int domainSizeGB , final int sizeRequired , org.ovirt.engine.core.compat.Guid sourceSnapshotId ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; initializeVmDAOMock ( vm ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > cmd = createVmFromSnapshotCommand ( vm , sourceSnapshotId ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.core.common.businessentities.Cluster model = org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; org.ovirt.engine.core.common.businessentities.Cluster model = org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
protected void addJNDIBeans ( ) { addBeanJNDIName ( BeanType.BACKEND , org.ovirt.engine.core.utils.StringUtils.concat ( org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX , "engine-bll/Backend" ) ) ; addBeanJNDIName ( BeanType.SCHEDULER , org.ovirt.engine.core.utils.StringUtils.concat ( org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX , "engine-scheduler/Scheduler" ) ) ; addBeanJNDIName ( BeanType.USERS_DOMAINS_CACHE , org.ovirt.engine.core.utils.StringUtils.concat ( org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX , "engine-bll/UsersDomainsCacheManagerService" ) ) ; addBeanJNDIName ( BeanType.VDS_EVENT_LISTENER , org.ovirt.engine.core.utils.StringUtils.concat ( org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX , "engine-bll/VdsEventListener" ) ) ; addBeanJNDIName ( BeanType.LOCK_MANAGER , org.ovirt.engine.core.utils.StringUtils.concat ( org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX , "engine-bll/LockManager" ) ) ; }

Target:
protected void addJNDIBeans ( ) { addBeanJNDIName ( BeanType.BACKEND , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/Backend" ) ) ; addBeanJNDIName ( BeanType.SCHEDULER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-scheduler/Scheduler" ) ) ; addBeanJNDIName ( BeanType.USERS_DOMAINS_CACHE , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/UsersDomainsCacheManagerService" ) ) ; addBeanJNDIName ( BeanType.VDS_EVENT_LISTENER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/VdsEventListener" ) ) ; addBeanJNDIName ( BeanType.LOCK_MANAGER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/LockManager" ) ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsHooksByIdQuery.getParameters ( ) . getVdsId ( ) ) ; org.ovirt.engine.core.common.queries.ValueObjectMap result = new org.ovirt.engine.core.common.queries.ValueObjectMap ( ) ; if ( vds != null ) { result = org.ovirt.engine.core.utils.vdshooks.VdsHooksParser.parseHooks ( vds.getHooksStr ( ) ) ; } org.ovirt.engine.core.bll.GetVdsHooksByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsHooksByIdQuery.getParameters ( ) . getVdsId ( ) ) ; java.util.Map < java.lang.String , java.lang.Object > result = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; if ( vds != null ) { result = org.ovirt.engine.core.utils.vdshooks.VdsHooksParser.parseHooks ( vds.getHooksStr ( ) ) ; } org.ovirt.engine.core.bll.GetVdsHooksByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.core.common.businessentities.StorageDomain isoDomain = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( result ) ) ; if ( isoDomain != null ) { org.ovirt.engine.core.common.queries.GetImagesListByStoragePoolIdParameters getIsoParams = new org.ovirt.engine.core.common.queries.GetImagesListByStoragePoolIdParameters ( vm.getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.ISO ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetImagesListByStoragePoolId , getIsoParams , imagesListQuery ) ; } else { ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ( model ) ) . invokeClient ( null ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.StorageDomain isoDomain ) { if ( isoDomain != null ) { org.ovirt.engine.core.common.queries.GetImagesListByStoragePoolIdParameters getIsoParams = new org.ovirt.engine.core.common.queries.GetImagesListByStoragePoolIdParameters ( vm.getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.ISO ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetImagesListByStoragePoolId , getIsoParams , imagesListQuery ) ; } else { invokeClient ( null ) ; } }
Source:
public void init ( ) { mockCpuFlagsManagerHandler ( ) ; vmHandler.init ( ) ; mockVmPropertiesUtils ( ) ; org.mockito.Mockito.doNothing ( ) . when ( vmPropertiesUtils ) . separateCustomPropertiesToUserAndPredefined ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Version.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) ) ; }

Target:
public void init ( ) { mockCpuFlagsManagerHandler ( ) ; vmHandler.init ( ) ; mockVmPropertiesUtils ( ) ; }
Source:
private boolean shouldVdsBeFenced ( ) { boolean result ; switch ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getstatus ( ) ) { case Down : case InstallFailed : case Maintenance : case NonOperational : case NonResponsive : result = true ; break ; default : result = false ; break ; } return result ; }

Target:
private boolean shouldVdsBeFenced ( ) { boolean result ; switch ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStatus ( ) ) { case Down : case InstallFailed : case Maintenance : case NonOperational : case NonResponsive : result = true ; break ; default : result = false ; break ; } return result ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > consoleDevices = ( ( java.util.List < java.lang.String > ) ( ( ( 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.util.List < java.lang.String > consoleDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; }
Source:
public void testGetUserInfoObject ( ) { org.codehaus.jackson.node.ObjectNode result = testServlet.getUserInfoObject ( mockUser , "mockSsoToken" ) ; org.junit.Assert.assertNotNull ( result.get ( "id" ) ) ; org.junit.Assert.assertEquals ( result.get ( "userName" ) . asText ( ) , "admin" ) ; org.junit.Assert.assertEquals ( result.get ( "domain" ) . asText ( ) , "internal" ) ; org.junit.Assert.assertEquals ( result.get ( "ssoToken" ) . asText ( ) , "mockSsoToken" ) ; }

Target:
public void testGetUserInfoObject ( ) { org.codehaus.jackson.node.ObjectNode result = testServlet.getUserInfoObject ( mockUser , "mockSsoToken" ) ; org.junit.Assert.assertNotNull ( result.get ( "id" ) ) ; org.junit.Assert.assertEquals ( "admin" , result.get ( "userName" ) . asText ( ) ) ; org.junit.Assert.assertEquals ( "internal" , result.get ( "domain" ) . asText ( ) ) ; org.junit.Assert.assertEquals ( "mockSsoToken" , result.get ( "ssoToken" ) . asText ( ) ) ; }
Source:
public void getLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String dataCenterName ) { 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 ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable item : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) { return item ; } } return null ; } } ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "hosts: datacenter=" + dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , sp , aQuery ) ; }

Target:
public void getLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String dataCenterName ) { 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 ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable item : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) { return item ; } } return null ; } } ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "hosts: datacenter=" + dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , sp , aQuery ) ; }
Source:
public void mapWatchdog ( ) { org.ovirt.engine.api.model.Watchdog model = new org.ovirt.engine.api.model.Watchdog ( ) ; model.setAction ( WatchdogAction.RESET ) ; model.setModel ( WatchdogModel.I6300ESB ) ; model.setId ( Guid.Empty.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.VmWatchdog entity = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model , null ) ; org.junit.Assert.assertNotNull ( entity ) ; org.junit.Assert.assertEquals ( entity.getAction ( ) , VmWatchdogAction.RESET ) ; org.junit.Assert.assertEquals ( entity.getModel ( ) , VmWatchdogType.i6300esb ) ; }

Target:
public void mapWatchdog ( ) { org.ovirt.engine.api.model.Watchdog model = new org.ovirt.engine.api.model.Watchdog ( ) ; model.setAction ( WatchdogAction.RESET ) ; model.setModel ( WatchdogModel.I6300ESB ) ; model.setId ( Guid.Empty.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.VmWatchdog entity = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model , null ) ; org.junit.Assert.assertNotNull ( entity ) ; org.junit.Assert.assertEquals ( VmWatchdogAction.RESET , entity.getAction ( ) ) ; org.junit.Assert.assertEquals ( VmWatchdogType.i6300esb , entity.getModel ( ) ) ; }
Source:
public void updateCommandStatus ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.common.asynctasks.AsyncTaskType taskType , org.ovirt.engine.core.compat.CommandStatus status ) { final org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = get ( commandId ) ; if ( cmdEntity != null ) { cmdEntity.setCommandStatus ( status ) ; if ( ( taskType.equals ( AsyncTaskType.notSupported ) ) || ( cmdEntity.isCallBackEnabled ( ) ) ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.Required , new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Object > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; return null ; } } ) ; } } }

Target:
public void updateCommandStatus ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.common.asynctasks.AsyncTaskType taskType , org.ovirt.engine.core.compat.CommandStatus status ) { final org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = get ( commandId ) ; if ( cmdEntity != null ) { cmdEntity.setCommandStatus ( status ) ; if ( ( taskType.equals ( AsyncTaskType.notSupported ) ) || ( cmdEntity.isCallBackEnabled ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; } } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > uniteAgents ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > vdsMap = getVdsMap ( vdsList ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > results = new java.util.LinkedList < > ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > entry : vdsMap.entrySet ( ) ) { results.add ( uniteAgentsSingleVds ( entry.getValue ( ) ) ) ; } return results ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > uniteAgents ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > vdsMap = getVdsMap ( vdsList ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > results = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > entry : vdsMap.entrySet ( ) ) { results.add ( uniteAgentsSingleVds ( entry.getValue ( ) ) ) ; } return results ; }
Source:
public void testValidationCallOnSuppliedImage ( ) { org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; transferImageCommand.getParameters ( ) . setImageId ( imageId ) ; org.mockito.Mockito.doReturn ( true ) . when ( transferImageCommand ) . validateImageTransfer ( imageId ) ; transferImageCommand.validate ( ) ; org.mockito.Mockito.verify ( transferImageCommand , org.mockito.Mockito.times ( 1 ) ) . validateImageTransfer ( imageId ) ; }

Target:
public void testValidationCallOnSuppliedImage ( ) { org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; transferImageCommand.getParameters ( ) . setImageId ( imageId ) ; org.mockito.Mockito.doReturn ( true ) . when ( transferImageCommand ) . validateImageTransfer ( ) ; transferImageCommand.validate ( ) ; org.mockito.Mockito.verify ( transferImageCommand , org.mockito.Mockito.times ( 1 ) ) . validateImageTransfer ( ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Group model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( EXTERNAL_IDS [ index ] . toHex ( ) , model.getExternalId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertNotNull ( model.getDomain ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Group model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertNotNull ( model.getDomain ( ) ) ; verifyLinks ( model ) ; }
Source:
public void testBadGuid ( ) throws java.lang.Exception { control.replay ( ) ; try { new org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResource ( new org.ovirt.engine.api.restapi.resource.BackendDataCenterClustersResource ( org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId.toString ( ) ) , "foo" ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testBadGuid ( ) throws java.lang.Exception { try { new org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResource ( new org.ovirt.engine.api.restapi.resource.BackendDataCenterClustersResource ( org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId.toString ( ) ) , "foo" ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.setVds ( null ) ; if ( ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) ) == null ) { org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.setCommandShouldBeLogged ( false ) ; log.info ( "Kdump detection will not be executed on host '{}' ({}) since it doesn't exist anymore." , org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVdsName ( ) , org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVdsId ( ) ) ; org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getReturnValue ( ) . setSucceeded ( false ) ; return ; } kdumpDetectionResult = detectHostKdumping ( ) ; org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getReturnValue ( ) . setSucceeded ( ( ( kdumpDetectionResult ) == ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.KdumpDetectionResult.KDUMP_FINISHED ) ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.setVds ( null ) ; if ( ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) ) == null ) { org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.setCommandShouldBeLogged ( false ) ; log.info ( "Kdump detection will not be executed on host '{}' ({}) since it doesn't exist anymore." , org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVdsName ( ) , org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVdsId ( ) ) ; org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getReturnValue ( ) . setSucceeded ( false ) ; return ; } org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.setCommandShouldBeLogged ( true ) ; kdumpDetectionResult = detectHostKdumping ( ) ; org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getReturnValue ( ) . setSucceeded ( ( ( kdumpDetectionResult ) == ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.KdumpDetectionResult.KDUMP_FINISHED ) ) ) ; }
Source:
private void updateVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { clearVms ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > externalVms = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > ( vm ) ) ; } externalVmModels.setItems ( externalVms ) ; stopProgress ( ) ; }

Target:
private void updateVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { clearVms ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > externalVms = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( vm ) ) ; } externalVmModels.setItems ( externalVms ) ; stopProgress ( ) ; }
Source:
protected org.ovirt.engine.api.model.OpenStackNetworkProvider postPopulate ( org.ovirt.engine.api.model.OpenStackNetworkProvider model ) { model.setPluginType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.NetworkPluginType.class ) . value ( ) ) ; org.ovirt.engine.api.model.AgentConfiguration agentConfiguration = model.getAgentConfiguration ( ) ; agentConfiguration.setBrokerType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.MessageBrokerType.class ) . value ( ) ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.OpenStackNetworkProvider postPopulate ( org.ovirt.engine.api.model.OpenStackNetworkProvider model ) { model.setPluginType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.NetworkPluginType.class ) ) ; org.ovirt.engine.api.model.AgentConfiguration agentConfiguration = model.getAgentConfiguration ( ) ; agentConfiguration.setBrokerType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.MessageBrokerType.class ) ) ; return model ; }
Source:
private static java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network > getClustersMap ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network > map = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.businessentities.network > ( ) ; org.ovirt.engine.core.common.businessentities.network net = new org.ovirt.engine.core.common.businessentities.network ( ) ; net.setname ( "oz" ) ; net.setMtu ( 9000 ) ; map.put ( "oz" , net ) ; return map ; }

Target:
private static java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > getClustersMap ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > map = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > ( ) ; org.ovirt.engine.core.common.businessentities.Network net = new org.ovirt.engine.core.common.businessentities.Network ( ) ; net.setname ( "oz" ) ; net.setMtu ( 9000 ) ; map.put ( "oz" , net ) ; return map ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VdsNetworkInterface getMaster ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.VdsNetworkInterface ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setBonded ( true ) ; entity.setBootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.BOOT_PROTOCOL ) ; return org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getMaster ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setBonded ( true ) ; entity.setBootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.BOOT_PROTOCOL ) ; return org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_GUID ) ; }
Source:
private void bookmarkListModel_Navigated ( java.lang.Object sender , final org.ovirt.engine.ui.uicommonweb.models.bookmarks.BookmarkEventArgs e ) { getTagList ( ) . getSelectedItemsChangedEvent ( ) . removeListener ( this ) ; getTagList ( ) . getResetCommand ( ) . execute ( ) ; getTagList ( ) . getSelectedItemsChangedEvent ( ) . addListener ( this ) ; updateAvailability ( SystemTreeItemType.System , null ) ; setSearchStringPrefix ( "" ) ; setSearchString ( e.getBookmark ( ) . getbookmark_value ( ) ) ; getSearchCommand ( ) . execute ( ) ; }

Target:
private void bookmarkListModel_Navigated ( java.lang.Object sender , final org.ovirt.engine.ui.uicommonweb.models.bookmarks.BookmarkEventArgs e ) { getTagList ( ) . getSelectedItemsChangedEvent ( ) . removeListener ( this ) ; getTagList ( ) . getResetCommand ( ) . execute ( ) ; getTagList ( ) . getSelectedItemsChangedEvent ( ) . addListener ( this ) ; updateAvailability ( SystemTreeItemType.System , null ) ; setSearchStringPrefix ( "" ) ; setSearchString ( e.getBookmark ( ) . getValue ( ) ) ; getSearchCommand ( ) . execute ( ) ; }
Source:
protected void saveSnapshotIfNotExists ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { if ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . exists ( getVm ( ) . getId ( ) , snapshotId ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.Snapshot ( snapshotId , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK , getVm ( ) . getId ( ) , null , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR , disk.getDescription ( ) , disk.getLastModifiedDate ( ) , disk.getAppList ( ) ) ) ; } }

Target:
protected void saveSnapshotIfNotExists ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { if ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . exists ( org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) . getId ( ) , snapshotId ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.Snapshot ( snapshotId , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK , org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) . getId ( ) , null , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR , disk.getDescription ( ) , disk.getLastModifiedDate ( ) , disk.getAppList ( ) ) ) ; } }
Source:
public java.lang.String generateId ( org.ovirt.engine.api.model.Version v ) { org.ovirt.engine.core.compat.NGuid guid = new org.ovirt.engine.core.compat.NGuid ( ( ( ( v.getMajor ( ) ) + "." ) + ( v.getMinor ( ) ) ) . getBytes ( ) , true ) ; return guid != null ? guid.toString ( ) : null ; }

Target:
public java.lang.String generateId ( org.ovirt.engine.api.model.Version v ) { org.ovirt.engine.core.compat.Guid guid = new org.ovirt.engine.core.compat.Guid ( ( ( ( v.getMajor ( ) ) + "." ) + ( v.getMinor ( ) ) ) . getBytes ( ) , true ) ; return guid.toString ( ) ; }
Source:
protected void init ( ) { super . init ( ) ; initResource ( resource.getParent ( ) ) ; resource.getParent ( ) . setBackend ( backend ) ; resource.getParent ( ) . setMappingLocator ( mapperLocator ) ; resource.getParent ( ) . setValidatorLocator ( validatorLocator ) ; resource.getParent ( ) . setSessionHelper ( sessionHelper ) ; resource.getParent ( ) . setMessageBundle ( messageBundle ) ; resource.getParent ( ) . setHttpHeaders ( httpHeaders ) ; }

Target:
protected void init ( ) { super . init ( ) ; initResource ( resource.getParent ( ) ) ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { getImage ( ) . setDiskProfileId ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getDiskProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( getImage ( ) , org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getCurrentUser ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { getImage ( ) . setDiskProfileId ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getDiskProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( getImage ( ) , org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand.getCurrentUser ( ) ) ) ; }
Source:
public static synchronized java.lang.String [ ] getLinksToExclude ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isIsoDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "disks" , "storageconnections" , "images" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isExportDomain ( storageDomain ) ? new java.lang.String [ ] { "files" , "storageconnections" , "images" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isImageDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "files" , "disks" , "storageconnections" } : new java.lang.String [ ] { "templates" , "vms" , "files" , "images" } ; }

Target:
public static synchronized java.lang.String [ ] getLinksToExclude ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isIsoDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "disks" , "images" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isExportDomain ( storageDomain ) ? new java.lang.String [ ] { "files" , "images" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isImageDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "files" , "disks" , "storageconnections" } : new java.lang.String [ ] { "templates" , "vms" , "files" , "images" } ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( T value ) { if ( ( ( value != null ) && ( ( value.getComment ( ) ) != null ) ) && ( ! ( value.getComment ( ) . isEmpty ( ) ) ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.CommentColumn.getApplicationResources ( ) . commentImage ( ) ; } return null ; }

Target:
public java.lang.String getValue ( T value ) { if ( ( ( value != null ) && ( ( value.getComment ( ) ) != null ) ) && ( ! ( value.getComment ( ) . isEmpty ( ) ) ) ) { return value.getComment ( ) ; } return null ; }
Source:
public void sendMessage ( byte [ ] message ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { waitForConnect ( ) ; send ( new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . send ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_DESTINATION , this . getRequestQueue ( ) ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_REPLY_TO , getResponseQueue ( ) ) . withContent ( message ) . build ( ) ) ; }

Target:
public void sendMessage ( byte [ ] message ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { waitForConnect ( ) ; } finally { send ( new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . send ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_DESTINATION , this . getRequestQueue ( ) ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_REPLY_TO , getResponseQueue ( ) ) . withContent ( message ) . build ( ) ) ; } }
Source:
protected void executeCommand ( ) { int missingDiskCount = getMissingDiskCount ( ) ; if ( missingDiskCount == 0 ) { setOvfUpdateStep ( OvfUpdateStep.OVF_UPLOAD ) ; updateOvfStoreContent ( ) ; } else { setOvfUpdateStep ( OvfUpdateStep.OVF_STORES_CREATION ) ; createOvfStoreDisks ( getMissingDiskCount ( ) ) ; } org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { int missingDiskCount = getMissingDiskCount ( ) ; if ( missingDiskCount <= 0 ) { setOvfUpdateStep ( OvfUpdateStep.OVF_UPLOAD ) ; updateOvfStoreContent ( ) ; } else { setOvfUpdateStep ( OvfUpdateStep.OVF_STORES_CREATION ) ; createOvfStoreDisks ( getMissingDiskCount ( ) ) ; } org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.setSucceeded ( true ) ; }
Source:
public void validateVmInPreview ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }

Target:
public void validateVmInPreview ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }
Source:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected void verifyFault ( javax.ws.rs.WebApplicationException wae , java.lang.String reason , java.lang.String detail , int status ) { assertEquals ( status , wae.getResponse ( ) . getStatus ( ) ) ; assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; org.ovirt.engine.api.model.Fault fault = ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) ; assertEquals ( reason , fault.getReason ( ) ) ; assertEquals ( detail , fault.getDetail ( ) ) ; }

Target:
protected void verifyFault ( javax.ws.rs.WebApplicationException wae , int status ) { assertEquals ( status , wae.getResponse ( ) . getStatus ( ) ) ; assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; }
Source:
public void canDoActionFailedUpdateReadOnly ( ) { org.ovirt.engine.core.common.businessentities.VmDevice device = createVmDevice ( diskImageGuid , vmId ) ; org.junit.Assert.assertEquals ( true , device.getIsPlugged ( ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.getDiskInfo ( ) . setReadOnly ( true ) ; initializeCommand ( parameters , java.util.Collections.singletonList ( createVm ( VMStatus.Up ) ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }

Target:
public void canDoActionFailedUpdateReadOnly ( ) { org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.getDiskInfo ( ) . setReadOnly ( true ) ; initializeCommand ( parameters , java.util.Collections.singletonList ( createVm ( VMStatus.Up ) ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }
Source:
private void initParentResource ( ) { org.ovirt.engine.api.restapi.resource.AbstractBackendResource parent = resource.getParent ( ) . getParent ( ) . getParent ( ) ; parent.setBackend ( backend ) ; parent.setMappingLocator ( mapperLocator ) ; parent.setMessageBundle ( messageBundle ) ; parent.setHttpHeaders ( httpHeaders ) ; }

Target:
private void initParentResource ( ) { org.ovirt.engine.api.restapi.resource.AbstractBackendResource parent = resource.getParent ( ) . getParent ( ) . getParent ( ) ; parent.setMappingLocator ( mapperLocator ) ; parent.setMessageBundle ( messageBundle ) ; parent.setHttpHeaders ( httpHeaders ) ; }
Source:
private void removeVmStatlessImages ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.IdParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }

Target:
private void removeVmStatlessImages ( ) { runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.IdParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }
Source:
protected boolean canDoAction ( ) { boolean returnValue = ( ( ( ( ( super . canDoAction ( ) ) && ( org.ovirt.engine.core.bll.storage.pool.AddStoragePoolWithStoragesCommand.checkStoragePool ( ) ) ) && ( checkStoragePoolStatus ( StoragePoolStatus.Uninitialized ) ) ) && ( org.ovirt.engine.core.bll.storage.pool.AddStoragePoolWithStoragesCommand.initializeVds ( ) ) ) && ( checkStorageDomainsInPool ( ) ) ) && ( isDomainAttachedToDifferentStoragePool ( ) ) ; return returnValue ; }

Target:
protected boolean validate ( ) { boolean returnValue = ( ( ( ( ( super . validate ( ) ) && ( org.ovirt.engine.core.bll.storage.pool.AddStoragePoolWithStoragesCommand.checkStoragePool ( ) ) ) && ( checkStoragePoolStatus ( StoragePoolStatus.Uninitialized ) ) ) && ( org.ovirt.engine.core.bll.storage.pool.AddStoragePoolWithStoragesCommand.initializeVds ( ) ) ) && ( checkStorageDomainsInPool ( ) ) ) && ( isDomainAttachedToDifferentStoragePool ( ) ) ; return returnValue ; }
Source:
public void testCheckGlusterQuorumWithTwoServersDown ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getCluster ( true ) ; java.lang.Iterable < org.ovirt.engine.core.compat.Guid > hostIds = java.util.Arrays.asList ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 ) ; org.junit.Assert.assertTrue ( "Quorum check is failing" , ( ( hostValidator.checkGlusterQuorum ( cluster , hostIds ) . size ( ) ) == 2 ) ) ; org.junit.Assert.assertTrue ( java.util.Arrays.asList ( "Vol-1" , "Vol-2" ) . equals ( hostValidator.checkGlusterQuorum ( cluster , hostIds ) ) ) ; }

Target:
public void testCheckGlusterQuorumWithTwoServersDown ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getCluster ( true ) ; java.lang.Iterable < org.ovirt.engine.core.compat.Guid > hostIds = java.util.Arrays.asList ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 ) ; org.junit.Assert.assertEquals ( "Quorum check is failing" , 2 , hostValidator.checkGlusterQuorum ( cluster , hostIds ) . size ( ) ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( "Vol-1" , "Vol-2" ) , hostValidator.checkGlusterQuorum ( cluster , hostIds ) ) ; }
Source:
protected void updateMemoryBalloon ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; boolean hasMemoryBalloon = ( cluster.getcompatibility_version ( ) . compareTo ( VmListModel.BALLOON_DEVICE_MIN_VERSION ) ) >= 0 ; getModel ( ) . getMemoryBalloonDeviceEnabled ( ) . setIsAvailable ( hasMemoryBalloon ) ; } }

Target:
protected void updateMemoryBalloon ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { updateMemoryBalloon ( getModel ( ) . getSelectedCluster ( ) . getcompatibility_version ( ) ) ; } }