auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected javax.ws.rs.core.UriInfo setUpBasicUriExpectations ( java.lang.String path ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; org.easymock.EasyMock.expect ( uriInfo.getPath ( ) ) . andReturn ( path ) . anyTimes ( ) ; return uriInfo ; }

Target:
protected javax.ws.rs.core.UriInfo setUpBasicUriExpectations ( java.lang.String path ) { javax.ws.rs.core.UriInfo uriInfo = control.createMock ( javax.ws.rs.core.UriInfo.class ) ; java.net.URI baseUri = java.net.URI.create ( ( ( org.ovirt.engine.api.restapi.resource.AbstractBackendBaseTest.URI_BASE ) + '/' ) ) ; org.easymock.EasyMock.expect ( uriInfo.getBaseUri ( ) ) . andReturn ( baseUri ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( uriInfo.getPath ( ) ) . andReturn ( path ) . anyTimes ( ) ; return uriInfo ; }
Source:
public void setSearchString ( java.lang.String value , boolean checkIfNewValue ) { if ( ( ! checkIfNewValue ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( searchString , value ) ) ) ) { searchString = value ; SearchStringChanged ( ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SearchString" ) ) ; } }

Target:
public void setSearchString ( java.lang.String value , boolean checkIfNewValue ) { if ( ( ! checkIfNewValue ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( searchString , value ) ) ) ) { searchString = value ; searchStringChanged ( ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SearchString" ) ) ; } }
Source:
public java.lang.String getFingerprint ( java.lang.String hostName ) { org.ovirt.engine.core.utils.ssh.SSHClient client = null ; try { client = connect ( hostName ) ; return getFingerprint ( client ) ; } finally { if ( client != null ) { client.disconnect ( ) ; } } }

Target:
public java.lang.String getFingerprint ( java.lang.String hostName ) { org.ovirt.engine.core.utils.ssh.EngineSSHClient client = null ; try { client = connect ( hostName ) ; return client.getHostFingerprint ( ) ; } catch ( java.io.IOException e ) { log.error ( "Could not get server key" ) ; return null ; } finally { if ( client != null ) { client.disconnect ( ) ; } } }
Source:
private void handleError ( org.ovirt.engine.core.common.businessentities.VDSStatus lastStatus , final org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue ) { if ( ! ( ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( vdsReturnValue.getReturnValue ( ) ) ) . getIsSkipped ( ) ) ) { org.ovirt.engine.core.bll.FenceVdsBaseCommand.setSucceeded ( false ) ; org.ovirt.engine.core.bll.FenceVdsBaseCommand.log.errorFormat ( "Failed to {0} VDS" , org.ovirt.engine.core.bll.FenceVdsBaseCommand.getParameters ( ) . getAction ( ) . name ( ) . toLowerCase ( ) ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.VDS_FENCE_OPERATION_FAILED ) ; } else { setStatus ( lastStatus ) ; } }

Target:
private void handleError ( org.ovirt.engine.core.common.businessentities.VDSStatus lastStatus , final org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue , org.ovirt.engine.core.common.businessentities.FenceAgentOrder order ) { if ( ! ( ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( vdsReturnValue.getReturnValue ( ) ) ) . getIsSkipped ( ) ) ) { org.ovirt.engine.core.bll.FenceVdsBaseCommand.setSucceeded ( false ) ; org.ovirt.engine.core.bll.FenceVdsBaseCommand.log.errorFormat ( "Failed to {0} VDS using {1} Power Management agent" , org.ovirt.engine.core.bll.FenceVdsBaseCommand.getParameters ( ) . getAction ( ) . name ( ) . toLowerCase ( ) , order.name ( ) ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.VDS_FENCE_OPERATION_FAILED ) ; } else { setStatus ( lastStatus ) ; } }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.ENTITY , Schema.Entities.GROUP ) . mput ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.GroupIdentifiers.NAME , args.get ( "group" ) ) . mput ( Schema.SharedKeys.REMOVE_GROUP , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.ENTITY , Schema.Entities.GROUP ) . mput ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.GroupIdentifiers.NAME , args.get ( "group" ) ) . mput ( Schema.SharedKeys.ADD_GROUP , context.get ( ContextKeys.POSITIONAL ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.storage_domain_static storage = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainStaticDAO ( ) . get ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( storage.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = ExecuteVerb ( ) ; BuildOvfReturnValue ( retVal.getReturnValue ( ) ) ; } else { org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getQueryReturnValue ( ) . setReturnValue ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.storage_domain_static storage = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainStaticDao ( ) . get ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( storage.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = executeVerb ( ) ; buildOvfReturnValue ( retVal.getReturnValue ( ) ) ; } else { org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getQueryReturnValue ( ) . setReturnValue ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setstatus ( VMStatus.Down ) ; vm.setguest_os ( "rhel6" ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( command , vmDAO ) ; mockGetForDisk ( new org.ovirt.engine.core.common.businessentities.VM ( ) ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; return vm ; }

Target:
private void initializeCommand ( ) { initializeCommand ( createParameters ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; if ( returnValue != null ) { dataCenterGuideModel.localStorageHost = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( returnValue ) ) ; } else { noLocalStorageHost = true ; } dataCenterGuideModel.updateOptionsLocalFS ( ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.VDS returnValue ) { if ( returnValue != null ) { localStorageHost = returnValue ; } else { noLocalStorageHost = true ; } updateOptionsLocalFS ( ) ; }
Source:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.setModel ( this ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setItems ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ) ( returnValue ) ) ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVnicProfilesByNetworkId ( asyncQuery , getEntity ( ) . getId ( ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVnicProfilesByNetworkId ( new org.ovirt.engine.ui.uicommonweb.models.networks.SetRawItemsAsyncQuery ( ) , getEntity ( ) . getId ( ) ) ; }
Source:
public javax.ws.rs.core.Response deactivate ( org.ovirt.engine.api.model.Action action ) { boolean stopGlusterService = org.ovirt.engine.api.common.util.QueryHelper.getBooleanMatrixParameter ( uriInfo , org.ovirt.engine.api.restapi.resource.BackendHostResource.STOP_GLUSTER_SERVICE , true , false ) ; return doAction ( VdcActionType.MaintenanceNumberOfVdss , new org.ovirt.engine.core.common.action.MaintenanceNumberOfVdssParameters ( asList ( guid ) , false , ( action.isSetReason ( ) ? action.getReason ( ) : null ) , stopGlusterService ) , action ) ; }

Target:
public javax.ws.rs.core.Response deactivate ( org.ovirt.engine.api.model.Action action ) { boolean stopGlusterService = org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendHostResource.STOP_GLUSTER_SERVICE , true , false ) ; return doAction ( VdcActionType.MaintenanceNumberOfVdss , new org.ovirt.engine.core.common.action.MaintenanceNumberOfVdssParameters ( asList ( guid ) , false , ( action.isSetReason ( ) ? action.getReason ( ) : null ) , stopGlusterService ) , action ) ; }
Source:
private java.lang.Class < ? > findResource ( java.lang.String path , java.util.List < java.lang.Class < ? > > classes ) throws java.io.IOException , java.lang.ClassNotFoundException { path = "/" + path ; for ( java.lang.Class < ? > clazz : classes ) { if ( path.equals ( getPath ( clazz ) ) ) { return clazz ; } } return null ; }

Target:
private java.lang.Class < ? > findResource ( java.lang.String path ) throws java.io.IOException , java.lang.ClassNotFoundException { for ( java.lang.reflect.Method locator : org.ovirt.engine.api.resource.SystemResource.class . getDeclaredMethods ( ) ) { if ( path.equals ( getPath ( locator ) ) ) { return locator.getReturnType ( ) ; } } return null ; }
Source:
private static org.ovirt.engine.core.common.action.VdcActionParametersBase deserializeParameters ( java.lang.String payload , java.lang.String className ) { if ( className == null ) { return null ; } java.lang.Class < java.io.Serializable > actionParamsClass = ( ( java.lang.Class < java.io.Serializable > ) ( org.ovirt.engine.core.utils.ReflectionUtils.getClassFor ( className ) ) ) ; return ( ( org.ovirt.engine.core.common.action.VdcActionParametersBase ) ( new org.ovirt.engine.core.utils.serialization.json.JsonObjectDeserializer ( ) . deserialize ( payload , actionParamsClass ) ) ) ; }

Target:
private static org.ovirt.engine.core.common.action.VdcActionParametersBase deserializeParameters ( java.lang.String payload , java.lang.String className ) { if ( className == null ) { return null ; } java.lang.Class < java.io.Serializable > actionParamsClass = ( ( java.lang.Class < java.io.Serializable > ) ( org.ovirt.engine.core.utils.ReflectionUtils.getClassFor ( className ) ) ) ; return ( ( org.ovirt.engine.core.common.action.VdcActionParametersBase ) ( org.ovirt.engine.core.utils.SerializationFactory.getDeserializer ( ) . deserialize ( payload , actionParamsClass ) ) ) ; }
Source:
protected void initDisksStorageDomainsList ( ) { for ( java.lang.Object item : getItems ( ) ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( item ) ) . getTemplate ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : template.getDiskList ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; addDiskImportData ( diskImage.getId ( ) , filteredStorageDomains , diskImage.getvolume_type ( ) , new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( true ) ) ; } } postInitDisks ( ) ; }

Target:
protected void initDisksStorageDomainsList ( ) { for ( java.lang.Object item : getItems ( ) ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( item ) ) . getTemplate ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : template.getDiskList ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; addDiskImportData ( diskImage.getId ( ) , filteredStorageDomains , diskImage.getVolumeType ( ) , new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( true ) ) ; } } postInitDisks ( ) ; }
Source:
protected void executeCommand ( ) { getParameters ( ) . getProfile ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getDiskProfileDao ( ) . save ( getParameters ( ) . getProfile ( ) ) ; getReturnValue ( ) . setActionReturnValue ( getParameters ( ) . getProfile ( ) . getId ( ) ) ; setSucceeded ( true ) ; }

Target:
protected org.ovirt.engine.core.dao.profiles.ProfilesDao < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > getProfileDao ( ) { return getDiskProfileDao ( ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VmDevice watchdogDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; watchdogDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( new org.ovirt.engine.core.compat.Guid ( ) , getParameters ( ) . getId ( ) ) ) ; watchdogDevice.setDevice ( VmDeviceType.WATCHDOG.getName ( ) ) ; watchdogDevice.setType ( VmDeviceType.WATCHDOG.getName ( ) ) ; watchdogDevice.setAddress ( StringUtils.EMPTY ) ; watchdogDevice.setSpecParams ( getSpecParams ( ) ) ; getVmDeviceDao ( ) . save ( watchdogDevice ) ; setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VmDevice watchdogDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; watchdogDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.Empty , getParameters ( ) . getId ( ) ) ) ; watchdogDevice.setDevice ( VmDeviceType.WATCHDOG.getName ( ) ) ; watchdogDevice.setType ( VmDeviceGeneralType.WATCHDOG ) ; watchdogDevice.setAddress ( StringUtils.EMPTY ) ; watchdogDevice.setSpecParams ( getSpecParams ( ) ) ; getVmDeviceDao ( ) . save ( watchdogDevice ) ; setSucceeded ( true ) ; setActionReturnValue ( watchdogDevice.getId ( ) ) ; }
Source:
public static void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public static void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroupWith ( boolean virtService , boolean glusterService ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ; group.setVirtService ( virtService ) ; group.setGlusterService ( glusterService ) ; group.setcompatibility_version ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createDefaultVdsGroup ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setCpuName ( "Intel Conroe" ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DC_ID1 ) ; group.setArchitecture ( ArchitectureType.x86_64 ) ; return group ; }
Source:
private void RemoveOtherImageAndParents ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid lastParent ) { org.ovirt.engine.core.common.businessentities.DiskImage image = org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( imageId ) ; org.ovirt.engine.core.compat.Guid currentParent = image.getParentId ( ) ; RemoveSnapshot ( image ) ; while ( ! ( lastParent.equals ( currentParent ) ) ) { image = org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( currentParent ) ; currentParent = image.getParentId ( ) ; RemoveSnapshot ( image ) ; } }

Target:
private void removeOtherImageAndParents ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid lastParent ) { org.ovirt.engine.core.common.businessentities.DiskImage image = org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( imageId ) ; org.ovirt.engine.core.compat.Guid currentParent = image.getParentId ( ) ; removeSnapshot ( image ) ; while ( ! ( lastParent.equals ( currentParent ) ) ) { image = org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( currentParent ) ; currentParent = image.getParentId ( ) ; removeSnapshot ( image ) ; } }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForUpdate ( ) ; mockBackend ( false , VdcBllErrors.GlusterHookUpdateFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_UPDATE_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForUpdate ( ) ; mockBackend ( false , EngineError.GlusterHookUpdateFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_UPDATE_FAILED ) ; }
Source:
public boolean isPowerManagementEnabledAndLegal ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup , java.util.List < java.lang.String > messages ) { if ( ! ( ( vds.getpm_enabled ( ) ) && ( isPowerManagementLegal ( vds.getFenceAgents ( ) , vdsGroup , messages ) ) ) ) { messages.add ( VdcBllMessages.VDS_FENCE_DISABLED.name ( ) ) ; return false ; } else { return true ; } }

Target:
public boolean isPowerManagementEnabledAndLegal ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup , java.util.List < java.lang.String > messages ) { if ( ! ( ( vds.isPmEnabled ( ) ) && ( isPowerManagementLegal ( vds.getFenceAgents ( ) , vdsGroup , messages ) ) ) ) { messages.add ( VdcBllMessages.VDS_FENCE_DISABLED.name ( ) ) ; return false ; } else { return true ; } }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > locksMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.StorageDevice disk : getParameters ( ) . getDisks ( ) ) { locksMap.put ( disk.getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.HOST_STORAGE_DEVICES , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DEVICE_LOCKED ) ) ; } return locksMap ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > locksMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.StorageDevice disk : getParameters ( ) . getDisks ( ) ) { locksMap.put ( disk.getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.HOST_STORAGE_DEVICES , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DEVICE_LOCKED ) ) ; } return locksMap ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetStorageDomainsByStoragePoolId , org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ ( ( NAMES.length ) - 1 ) ] } , setUpStorageDomains ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetStorageDomainsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ ( ( NAMES.length ) - 1 ) ] } , setUpStorageDomains ( ) , failure ) ; control.replay ( ) ; }
Source:
public void testBondNotUpdatedAndRemovedSimultaneouslyValid ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addBonds ( org.ovirt.engine.core.common.action.CreateOrUpdateBond.fromBond ( bond ) ) . addRemovedBonds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . build ( ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( params ) . build ( ) ; org.junit.Assert.assertThat ( validator.bondNotUpdatedAndRemovedSimultaneously ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testBondNotUpdatedAndRemovedSimultaneouslyValid ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addBonds ( org.ovirt.engine.core.common.action.CreateOrUpdateBond.fromBond ( bond ) ) . addRemovedBonds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . build ( ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( params ) . build ( ) ; org.hamcrest.MatcherAssert.assertThat ( validator.bondNotUpdatedAndRemovedSimultaneously ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.HostDevice > getDeviceAtomicGroup ( org.ovirt.engine.core.common.businessentities.HostDevice hostDevice ) { if ( ( ! ( org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.CAPABILITY_PCI.equals ( hostDevice.getCapability ( ) ) ) ) || ( ( hostDevice.getIommuGroup ( ) ) == null ) ) { return java.util.Collections.singleton ( hostDevice ) ; } return hostDeviceDao.getHostDevicesByHostIdAndIommuGroup ( org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getVm ( ) . getDedicatedVmForVds ( ) , hostDevice.getIommuGroup ( ) ) ; }

Target:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.HostDevice > getDeviceAtomicGroup ( org.ovirt.engine.core.common.businessentities.HostDevice hostDevice ) { if ( ! ( hasIommu ( hostDevice ) ) ) { return java.util.Collections.singleton ( hostDevice ) ; } return hostDeviceDao.getHostDevicesByHostIdAndIommuGroup ( org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getVm ( ) . getDedicatedVmForVds ( ) , hostDevice.getIommuGroup ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkNotChanged ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment ) { boolean when = ( oldAttachment != null ) && ( ! ( java.util.Objects.equals ( oldAttachment.getNetworkId ( ) , attachment.getNetworkId ( ) ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.CANNOT_CHANGE_ATTACHED_NETWORK ) . when ( when ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkNotChanged ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment ) { org.ovirt.engine.core.compat.Guid oldAttachmentId = ( oldAttachment == null ) ? null : oldAttachment.getId ( ) ; boolean when = ( oldAttachment != null ) && ( ! ( java.util.Objects.equals ( oldAttachment.getNetworkId ( ) , attachment.getNetworkId ( ) ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.CANNOT_CHANGE_ATTACHED_NETWORK , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator.VAR_NETWORK_ATTACHMENT_ID , oldAttachmentId ) ) . when ( when ) ; }
Source:
public static void initTestCase ( ) throws java.lang.Exception { if ( ( org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource ) == null ) { org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource = org.ovirt.engine.core.dao.BaseDAOTestCase.createDataSource ( ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dataset = org.ovirt.engine.core.dao.BaseDAOTestCase.initDataSet ( ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dbFacade = new org.ovirt.engine.core.dal.dbbroker.DbFacade ( ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dbFacade.setDbEngineDialect ( org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.loadDbEngineDialect ( ) ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dbFacade.setTemplate ( org.ovirt.engine.core.dao.BaseDAOTestCase.dbFacade.getDbEngineDialect ( ) . createJdbcTemplate ( org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource ) ) ; DatabaseOperation.CLEAN_INSERT.execute ( org.ovirt.engine.core.dao.BaseDAOTestCase.getConnection ( ) , org.ovirt.engine.core.dao.BaseDAOTestCase.dataset ) ; } }

Target:
public static void initTestCase ( ) throws java.lang.Exception { if ( ( org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource ) == null ) { org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource = org.ovirt.engine.core.dao.BaseDAOTestCase.createDataSource ( ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.ejbRule.mockResource ( ContainerManagedResourceType.DATA_SOURCE , org.ovirt.engine.core.dao.BaseDAOTestCase.dataSource ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dataset = org.ovirt.engine.core.dao.BaseDAOTestCase.initDataSet ( ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dbFacade = org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.getDbFacade ( ) ; org.ovirt.engine.core.dao.BaseDAOTestCase.dbFacade.setDbEngineDialect ( org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.loadDbEngineDialect ( ) ) ; DatabaseOperation.CLEAN_INSERT.execute ( org.ovirt.engine.core.dao.BaseDAOTestCase.getConnection ( ) , org.ovirt.engine.core.dao.BaseDAOTestCase.dataset ) ; } }
Source:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setupGetHostExpectations ( 2 ) ; setupGetNetworkExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkToVdsInterface , org.ovirt.engine.core.common.action.UpdateNetworkToVdsParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.update ( getHostNicModel ( 1 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setupGetHostExpectations ( 2 ) ; setupGetNetworkExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkToVdsInterface , org.ovirt.engine.core.common.action.UpdateNetworkToVdsParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( getHostNicModel ( 1 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected void onSelectedItemChanged ( ) { super . onSelectedItemChanged ( ) ; updateActionAvailability ( ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = super . validate ( value ) ; if ( ! ( result.getSuccess ( ) ) ) { result.getReasons ( ) . add ( getAlreadyAssignedClonedNameMessage ( ) ) ; } return result ; }
Source:
private void onImportSourceChanged ( ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource source = importSources.getSelectedItem ( ) ; if ( source == null ) { return ; } importedVmModels.setItems ( null ) ; externalVmModels.setItems ( null ) ; switch ( source ) { case EXPORT_DOMAIN : onExportDomainChosen ( ) ; break ; default : } }

Target:
private void initImportSources ( ) { importSources.setItems ( java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.values ( ) ) ) ; importSources.setSelectedItem ( ImportSource.EXPORT_DOMAIN ) ; importSources.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { clearVms ( ) ; } } ) ; }
Source:
private boolean isSysprepUsed ( org.ovirt.engine.core.common.businessentities.VM vm ) { return ( ( ( vm.getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.Sysprep ) ) && ( org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . isWindows ( vm.getVmOsId ( ) ) ) ) && ( ( ( vm.getFloppyPath ( ) ) == null ) || ( "" . equals ( vm.getFloppyPath ( ) ) ) ) ; }

Target:
private boolean isSysprepUsed ( ) { return ( ( ( vm.getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.Sysprep ) ) && ( windows ) ) && ( ( ( vm.getFloppyPath ( ) ) == null ) || ( "" . equals ( vm.getFloppyPath ( ) ) ) ) ; }
Source:
public void testUpdateFailed ( ) { try { update ( true , false , 1 ) ; } catch ( javax.ws.rs.WebApplicationException e ) { org.junit.jupiter.api.Assertions.assertNotNull ( e.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 400 , e.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testUpdateFailed ( ) { try { update ( true , false , 1 ) ; } catch ( javax.ws.rs.WebApplicationException e ) { verifyBadRequest ( e ) ; } }
Source:
public static java.lang.String getMessage ( org.ovirt.engine.core.common.AuditLogType logType ) { java.lang.String value = "" ; if ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.containsKey ( logType ) ) { value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.get ( logType ) ; } return value ; }

Target:
private static void logMessage ( org.ovirt.engine.core.common.AuditLogSeverity severity , java.lang.String logMessage ) { switch ( severity ) { case NORMAL : org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.info ( logMessage ) ; break ; case ERROR : org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( logMessage ) ; break ; case ALERT : case WARNING : default : org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.warn ( logMessage ) ; break ; } }
Source:
protected void storeRdpData ( org.ovirt.engine.ui.uicommonweb.models.vms.IRdp rdp , org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.KeyMaker keyMaker ) { storeBool ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.USE_LOCAL_DRIVES ) , rdp.getUseLocalDrives ( ) ) ; }

Target:
protected void storeRdpData ( org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel model , org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.KeyMaker keyMaker ) { org.ovirt.engine.ui.uicommonweb.models.vms.RdpConsoleModel consoleModel = asRdpConsoleModel ( model ) ; org.ovirt.engine.ui.uicommonweb.models.vms.IRdp rdpImpl = consoleModel.getrdp ( ) ; clientStorage.setLocalItem ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.RDP_CLIENT_MODE ) , consoleModel.getClientConsoleMode ( ) . toString ( ) ) ; storeBool ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.USE_LOCAL_DRIVES ) , rdpImpl.getUseLocalDrives ( ) ) ; }
Source:
public void testConflictedUpdate ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , false ) ; org.ovirt.engine.api.model.VnicProfile model = org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource resource = ( ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource ) ( this . resource ) ) ; resource.update ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , false ) ; org.ovirt.engine.api.model.VnicProfile model = org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource resource = ( ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource ) ( this . resource ) ) ; resource.update ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }

Target:
public void getClusterFeaturesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { getQuotaDAO ( ) . remove ( getParameters ( ) . getQuotaId ( ) ) ; org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . removeQuotaFromCache ( getQuota ( ) . getStoragePoolId ( ) , getParameters ( ) . getQuotaId ( ) ) ; getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { getQuotaDAO ( ) . remove ( getParameters ( ) . getQuotaId ( ) ) ; getQuotaManager ( ) . removeQuotaFromCache ( getQuota ( ) . getStoragePoolId ( ) , getParameters ( ) . getQuotaId ( ) ) ; getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
public void testChangeClusterForbidden ( ) { prepareVmToPassCanDoAction ( ) ; vmStatic.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with cant change cluster." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.VM_CANNOT_UPDATE_CLUSTER ) ; }

Target:
public void testDedicatedHostNotExist ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }
Source:
private void setupListExpectations ( ) { org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setName ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultClusterName ) ; cluster.setId ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.clusterId.toString ( ) ) ; org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock = control.createMock ( org.ovirt.engine.api.resource.ClusterResource.class ) ; org.easymock.EasyMock.expect ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock.get ( ) ) . andReturn ( cluster ) . anyTimes ( ) ; }

Target:
private void setupListExpectations ( ) { org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setName ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultClusterName ) ; cluster.setId ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.clusterId.toString ( ) ) ; org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock = org.mockito.Mockito.mock ( org.ovirt.engine.api.resource.ClusterResource.class ) ; org.mockito.Mockito.when ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock.get ( ) ) . thenReturn ( cluster ) ; }
Source:
protected void beforeCommandExecuted ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . beforeCommandExecuted ( command ) ; if ( command == ( model.getDefaultCommand ( ) ) ) { removeListeners ( model ) ; getView ( ) . flushToPrivateModel ( ) ; org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent.fire ( getEventBus ( ) , model.getModel ( ) ) ; } }

Target:
protected void beforeCommandExecuted ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . beforeCommandExecuted ( command ) ; if ( command == ( model.getDefaultCommand ( ) ) ) { removeListeners ( model ) ; getView ( ) . flushToPrivateModel ( ) ; consoleOptionsPersister.storeToLocalStorage ( model.getModel ( ) , model.getConsoleContext ( ) ) ; org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent.fire ( getEventBus ( ) , model.getModel ( ) ) ; } }
Source:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void getDataCenterById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public static void GetPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters ( userId ) , aQuery ) ; }

Target:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters ( roleId ) , aQuery ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute Logoff: " + caught ) , caught ) ; callback.onFailure ( caught ) ; }

Target:
private static void failureEventHandler ( java.lang.String description , java.util.ArrayList < java.lang.String > errorMessages ) { java.util.ArrayList < org.ovirt.engine.ui.frontend.Message > messages = new java.util.ArrayList < org.ovirt.engine.ui.frontend.Message > ( ) ; for ( java.lang.String errorMessage : errorMessages ) { messages.add ( new org.ovirt.engine.ui.frontend.Message ( description , errorMessage ) ) ; } org.ovirt.engine.ui.frontend.Frontend.frontendFailureEvent.raise ( org.ovirt.engine.ui.frontend.Frontend.class , new org.ovirt.engine.ui.frontend.FrontendFailureEventArgs ( messages ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VmTemplate getVmTemplate ( ) { if ( ( ( mVmTemplate ) == null ) && ( ( ( mVmTemplateId ) != null ) || ( ( getVm ( ) ) != null ) ) ) { mVmTemplate = getVmTemplateDAO ( ) . get ( ( ( mVmTemplateId ) != null ? getVmTemplateId ( ) : getVm ( ) . getvmt_guid ( ) ) ) ; } return mVmTemplate ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmTemplate getVmTemplate ( ) { if ( ( ( mVmTemplate ) == null ) && ( ( ( mVmTemplateId ) != null ) || ( ( getVm ( ) ) != null ) ) ) { mVmTemplate = getVmTemplateDAO ( ) . get ( ( ( mVmTemplateId ) != null ? getVmTemplateId ( ) : getVm ( ) . getVmtGuid ( ) ) ) ; } return mVmTemplate ; }