auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback getCallback ( ) { return new ConvertVmCallback ( org.ovirt.engine.core.bll.ConvertVmCommand.getVmId ( ) , org.ovirt.engine.core.bll.ConvertVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.ConvertVmCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ; }

Target:
private void addImportedDevices ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = vm.getStaticData ( ) ; vmStatic.setImages ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; vmStatic.setInterfaces ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; org.ovirt.engine.core.bll.ImportUtils.updateGraphicsDevices ( vmStatic , org.ovirt.engine.core.bll.ConvertVmCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( vmStatic , false ) ; }
Source:
public void rollbackQuota ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.compat.Guid > quotaList ) { org.ovirt.engine.core.bll.quota.QuotaManager.lock.writeLock ( ) . lock ( ) ; try { if ( ! ( org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.containsKey ( storagePoolId ) ) ) { return ; } synchronized ( org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.get ( storagePoolId ) ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.Quota > map = org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.get ( storagePoolId ) ; for ( org.ovirt.engine.core.compat.Guid quotaId : quotaList ) { map.remove ( quotaId ) ; } } } finally { org.ovirt.engine.core.bll.quota.QuotaManager.lock.writeLock ( ) . unlock ( ) ; } }

Target:
public void removeQuotaFromCache ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.compat.Guid > quotaList ) { org.ovirt.engine.core.bll.quota.QuotaManager.lock.writeLock ( ) . lock ( ) ; try { if ( ! ( org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.containsKey ( storagePoolId ) ) ) { return ; } synchronized ( org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.get ( storagePoolId ) ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.Quota > map = org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.get ( storagePoolId ) ; for ( org.ovirt.engine.core.compat.Guid quotaId : quotaList ) { map.remove ( quotaId ) ; } } } finally { org.ovirt.engine.core.bll.quota.QuotaManager.lock.writeLock ( ) . unlock ( ) ; } }
Source:
protected java.lang.Object runQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String sessionId ) { initQueryParams ( queryParams , sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runQuery ( queryType , queryParams ) ; return ( result != null ) && ( result.getSucceeded ( ) ) ? result.getReturnValue ( ) : null ; }

Target:
protected java.lang.Object runQuery ( org.ovirt.engine.core.common.queries.QueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String sessionId ) { initQueryParams ( queryParams , sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runQuery ( queryType , queryParams ) ; return ( result != null ) && ( result.getSucceeded ( ) ) ? result.getReturnValue ( ) : null ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.DELETE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.UserIdentifiers.USERNAME , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) ) ; } if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { 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.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.getGroupKeys ( args , context.get ( ContextKeys.POSITIONAL , java.lang.String.class ) ) ) ; if ( ! ( context.containsKey ( ContextKeys.EXIT_STATUS ) ) ) { 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 setConsoleDevice ( org.ovirt.engine.api.model.VM model ) { if ( ! ( model.isSetConsole ( ) ) ) { model.setConsole ( new org.ovirt.engine.api.model.Console ( ) ) ; } model.getConsole ( ) . setEnabled ( ( ! ( getConsoleDevicesForEntity ( new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) . isEmpty ( ) ) ) ) ; }

Target:
protected void setConsoleDevice ( org.ovirt.engine.api.model.Vm model ) { if ( ! ( model.isSetConsole ( ) ) ) { model.setConsole ( new org.ovirt.engine.api.model.Console ( ) ) ; } model.getConsole ( ) . setEnabled ( ( ! ( getConsoleDevicesForEntity ( new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) . isEmpty ( ) ) ) ) ; }
Source:
private boolean isShareableDiskOnGlusterDomain ( ) { if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . isShareable ( ) ) && ( ( org.ovirt.engine.core.bll.AddDiskCommand.getStorageDomain ( ) . getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISKS_NOT_SUPPORTED_ON_GLUSTER_DOMAIN ) ; return true ; } return false ; }

Target:
private boolean isShareableDiskOnGlusterDomain ( ) { if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . isShareable ( ) ) && ( ( org.ovirt.engine.core.bll.AddDiskCommand.getStorageDomain ( ) . getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.StorageType.GLUSTERFS ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISKS_NOT_SUPPORTED_ON_GLUSTER_DOMAIN ) ; return true ; } return false ; }
Source:
public void insertAsyncTaskEntity ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.common.VdcObjectType entityType ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) ; parameterSource.addValue ( "task_id" , taskId ) . addValue ( "entity_id" , entityId ) . addValue ( "entity_type" , entityType ) ; getCallsHandler ( ) . executeModification ( "InsertAsyncTaskEntities" , parameterSource ) ; }

Target:
public void insertAsyncTaskEntities ( java.util.Collection < org.ovirt.engine.core.common.businessentities.AsyncTaskEntity > asyncTaskEntities ) { getCallsHandler ( ) . executeStoredProcAsBatch ( "InsertAsyncTaskEntities" , asyncTaskEntities , mapper ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { java.lang.String value = "" ; if ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) ; java.util.ArrayList < java.lang.String > quotaNamesArr = diskImage.getQuotaNames ( ) ; if ( quotaNamesArr != null ) { value = org.ovirt.engine.core.compat.StringHelper.join ( ", " , quotaNamesArr.toArray ( ) ) ; } } return value ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { java.lang.String value = "" ; if ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) ; java.util.ArrayList < java.lang.String > quotaNamesArr = diskImage.getQuotaNames ( ) ; if ( quotaNamesArr != null ) { value = org.ovirt.engine.core.compat.StringHelper.join ( ", " , quotaNamesArr.toArray ( ) ) ; } } return value ; }
Source:
private void mockBackend ( boolean succeeded , org.ovirt.engine.core.common.errors.EngineError errorCode ) { org.mockito.Mockito.doReturn ( backend ) . when ( cmd ) . getBackend ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdsReturnValue.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( errorCode , "" ) ) ; } org.mockito.Mockito.when ( vdsBrokerFrontend.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.AddGlusterHook ) , org.mockito.Matchers.argThat ( anyHookVDS ( ) ) ) ) . thenReturn ( vdsReturnValue ) ; }

Target:
private void mockBackend ( boolean succeeded , org.ovirt.engine.core.common.errors.EngineError errorCode ) { org.mockito.Mockito.doReturn ( backend ) . when ( cmd ) . getBackend ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdsReturnValue.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( errorCode , "" ) ) ; } org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.AddGlusterHook ) , org.mockito.Matchers.argThat ( anyHookVDS ( ) ) ) ) . thenReturn ( vdsReturnValue ) ; }
Source:
private void addSyncDiff ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel ) { addRow ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.templates.imageTextSetupNetwork ( notInSyncImage , org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.constants.hostOutOfSync ( ) ) ) ; com.google.gwt.safehtml.shared.SafeHtml safeHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( generatePreviewSentence ( ) ) ; addRow ( safeHtml ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration > panelParameters = filterSyncProperties ( networkModel ) ; com.google.gwt.user.client.ui.Widget networkOutOfSyncPanel = new org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkOutOfSyncPanel ( panelParameters ) . outOfSyncTableAsWidget ( ) ; contents.insertRow ( contents.getRowCount ( ) ) ; contents.setWidget ( contents.getRowCount ( ) , 0 , networkOutOfSyncPanel ) ; }

Target:
private void addSyncDiff ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel ) { addRow ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.templates.imageTextSetupNetwork ( notInSyncImage , org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.constants.hostOutOfSync ( ) ) ) ; com.google.gwt.safehtml.shared.SafeHtml safeHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.ItemInfoPopup.constants.hostOutOfSyncPreviewSentence ( ) ) ; addRow ( safeHtml ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration > panelParameters = filterSyncProperties ( networkModel ) ; com.google.gwt.user.client.ui.Widget networkOutOfSyncPanel = new org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkOutOfSyncPanel ( panelParameters ) . outOfSyncTableAsWidget ( ) ; contents.insertRow ( contents.getRowCount ( ) ) ; contents.setWidget ( contents.getRowCount ( ) , 0 , networkOutOfSyncPanel ) ; }
Source:
public boolean exists ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType type ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , vmId ) . addValue ( "snapshot_type" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( type ) ) ; return getCallsHandler ( ) . executeRead ( "CheckIfSnapshotExistsByVmIdAndType" , createBooleanMapper ( ) , parameterSource ) ; }

Target:
public boolean exists ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType type ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , vmId ) . addValue ( "snapshot_type" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( type ) ) ; return getCallsHandler ( ) . executeRead ( "CheckIfSnapshotExistsByVmIdAndType" , org.springframework.jdbc.core.SingleColumnRowMapper.newInstance ( java.lang.Boolean.class ) , parameterSource ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotUnplugNic ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotunplugNic ( info.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotplugDisk ( java.util.Map info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotplugDisk ( info ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.StorageStatusReturnForXmlRpc activateStorageDomain ( java.lang.String sdUUID , java.lang.String spUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StorageDomain.activate" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "storagepoolID" , spUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "storageStatus" ) . withResponseType ( java.lang.String.class ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.StorageStatusReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.StorageStatusReturn activateStorageDomain ( java.lang.String sdUUID , java.lang.String spUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StorageDomain.activate" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "storagepoolID" , spUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "storageStatus" ) . withResponseType ( java.lang.String.class ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.StorageStatusReturn ( response ) ; }
Source:
private org.ovirt.engine.core.compat.Guid addDisk ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = getBackend ( ) . runInternalAction ( ActionType.AddDisk , buildAddDiskParameters ( disk ) , enclosingCommand.getContext ( ) . clone ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getFault ( ) . getError ( ) , java.lang.String.format ( "Failed to create disk! %s" , disk.getDiskAlias ( ) ) ) ; } return returnValue.getActionReturnValue ( ) ; }

Target:
private org.ovirt.engine.core.compat.Guid addDisk ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = getBackend ( ) . runInternalAction ( ActionType.AddDisk , buildAddDiskParameters ( disk ) , enclosingCommand.getContext ( ) . clone ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getFault ( ) . getError ( ) , java.lang.String.format ( "Failed to create disk! %s" , disk.getDiskAlias ( ) ) ) ; } return returnValue.getActionReturnValue ( ) ; }
Source:
public void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
protected void endSuccessfully ( ) { if ( ! ( org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getParameters ( ) . isParentHasTasks ( ) ) ) { org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getBackend ( ) . endAction ( org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getParameters ( ) . getParentCommand ( ) , org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getParameters ( ) . getParentParameters ( ) , org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.endVmCommand ( ) ; }

Target:
protected void endWithFailure ( ) { org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.setSucceeded ( true ) ; }
Source:
public void testCompleteParametersAlternativesSecond ( ) throws java.lang.Exception { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; vm.setName ( "foo" ) ; vm.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( VmStatus.UP ) ) ; org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "name" , "host|status" ) ; }

Target:
public void testCompleteParametersAlternativesSecond ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setName ( "foo" ) ; vm.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( VmStatus.UP ) ) ; org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( vm , "name" , "host|status" ) ; }
Source:
public boolean equals ( java.lang.Object o ) { return ( ( o != null ) && ( ( getClass ( ) ) == ( o.getClass ( ) ) ) ) && ( map.equals ( ( ( org.ovirt.engine.api.extensions.ExtMap ) ( o ) ) . map ) ) ; }

Target:
public int hashCode ( ) { return java.util.Objects.hashCode ( map ) ; }
Source:
public void clusterWithNoCpu ( ) { createCommandWithNoCpuName ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( glusterVolumeDao.getByClusterId ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( ) ) ; allQueriesForVms ( ) ; initAndAssertValidation ( true ) ; }

Target:
public void clusterWithNoCpu ( ) { createCommandWithNoCpuName ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( glusterVolumeDao.getByClusterId ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new java.util.ArrayList < > ( ) ) ; allQueriesForVms ( ) ; initAndAssertValidation ( true ) ; }
Source:
private static void setNewDisksForTemplate ( int numberOfNewDisks , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > disksMap ) { for ( int newDiskInd = 0 ; newDiskInd < numberOfNewDisks ; newDiskInd ++ ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImageTempalte = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImageTempalte.setImageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; disksMap.put ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , diskImageTempalte ) ; } }

Target:
private static void setNewDisksForTemplate ( int numberOfNewDisks , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > disksMap ) { for ( int newDiskInd = 0 ; newDiskInd < numberOfNewDisks ; newDiskInd ++ ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImageTempalte = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImageTempalte.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disksMap.put ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageTempalte ) ; } }
Source:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , boolean returnNull ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetDbGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { entityId } , ( returnNull ? null : getEntity ( 0 ) ) ) ; }

Target:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , boolean returnNull ) throws java.lang.Exception { setUpGetEntityExpectations ( QueryType.GetDbGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { entityId } , ( returnNull ? null : getEntity ( 0 ) ) ) ; }
Source:
protected boolean setUpMountBrokerOnSlave ( ) { return getBackend ( ) . runInternalAction ( VdcActionType.SetupGlusterGeoRepMountBrokerInternal , new org.ovirt.engine.core.common.action.gluster.SetUpMountBrokerParameters ( getParameters ( ) . getSlaveHostId ( ) , getParameters ( ) . getSlaveVolumeName ( ) , getParameters ( ) . getUserName ( ) , getParameters ( ) . getUserGroup ( ) ) ) . getSucceeded ( ) ; }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase setUpMountBrokerOnSlave ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase mountBrokerOnSlaveReturnValue = getBackend ( ) . runInternalAction ( VdcActionType.SetupGlusterGeoRepMountBrokerInternal , new org.ovirt.engine.core.common.action.gluster.SetUpMountBrokerParameters ( getParameters ( ) . getSlaveHostId ( ) , getParameters ( ) . getSlaveVolumeName ( ) , getParameters ( ) . getUserName ( ) , getParameters ( ) . getUserGroup ( ) ) ) ; return mountBrokerOnSlaveReturnValue ; }
Source:
private void vnicProfileTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , boolean networkLinkingSupported , org.ovirt.engine.core.compat.Guid vnicProfileId ) { mockConfigRule.mockConfigValue ( ConfigValues.NetworkLinkingSupported , version , networkLinkingSupported ) ; org.mockito.Mockito.when ( nic.getVnicProfileId ( ) ) . thenReturn ( vnicProfileId ) ; org.junit.Assert.assertThat ( validator.emptyNetworkValid ( ) , matcher ) ; }

Target:
private void vnicProfileLinkingTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , boolean networkLinkingSupported , org.ovirt.engine.core.compat.Guid vnicProfileId ) { mockConfigRule.mockConfigValue ( ConfigValues.NetworkLinkingSupported , version , networkLinkingSupported ) ; org.mockito.Mockito.when ( nic.getVnicProfileId ( ) ) . thenReturn ( vnicProfileId ) ; org.junit.Assert.assertThat ( validator.emptyNetworkValid ( ) , matcher ) ; }
Source:
protected boolean isSecured ( ) { boolean secured = true ; if ( url.getProtocol ( ) . equalsIgnoreCase ( java.lang.String.valueOf ( HttpURL.DEFAULT_SCHEME ) ) ) { secured = false ; } return secured ; }

Target:
public java.util.List < ? extends java.security.cert.Certificate > getCertificateChain ( ) { java.util.List < ? extends java.security.cert.Certificate > result = null ; if ( url.getProtocol ( ) . equalsIgnoreCase ( java.lang.String.valueOf ( "https" ) ) ) { try { result = org.ovirt.engine.core.uutils.crypto.CertificateChain.completeChain ( org.ovirt.engine.core.uutils.crypto.CertificateChain.getSSLPeerCertificates ( url ) , org.ovirt.engine.core.uutils.crypto.CertificateChain.keyStoreToTrustAnchors ( org.ovirt.engine.core.bll.provider.ExternalTrustStoreInitializer.getTrustStore ( ) ) ) ; } catch ( java.io.IOException | java.security.GeneralSecurityException e ) { org.ovirt.engine.core.bll.provider.BaseProviderProxy.handleException ( e ) ; } } return result ; }
Source:
public static void GetDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }
Source:
private static long retrieveIsoFileSize ( java.util.Map.Entry < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > fileStats ) { try { return java.lang.Long.valueOf ( ( ( java.lang.String ) ( fileStats.getValue ( ) . get ( VdsProperties.size ) ) ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.errorFormat ( "File's '{0}' size is illegal number" , fileStats.getKey ( ) , e ) ; return org.ovirt.engine.core.common.constants.StorageConstants.SIZE_IS_NOT_AVAILABLE ; } }

Target:
private static long retrieveIsoFileSize ( java.util.Map.Entry < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > fileStats ) { try { return java.lang.Long.valueOf ( ( ( java.lang.String ) ( fileStats.getValue ( ) . get ( VdsProperties.size ) ) ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.error ( "File's '{}' size is illegal number: {}" , fileStats.getKey ( ) , e.getMessage ( ) ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.debug ( "Exception" , e ) ; return org.ovirt.engine.core.common.constants.StorageConstants.SIZE_IS_NOT_AVAILABLE ; } }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; for ( java.lang.String name : NAMES ) { setUpProfileMock ( name ) ; } }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; extMgr.clear ( ) ; org.mockito.Mockito.doReturn ( extMgr ) . when ( getQuery ( ) ) . getExtensionsManager ( ) ; for ( java.lang.String name : NAMES ) { setUpAuthzMock ( name ) ; } }
Source:
private org.ovirt.engine.ui.frontend.server.dashboard.Dashboard populateUtilizationCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { long startTime = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.Dashboard dashboard = getDashboard ( ) ; long endTime = java.lang.System.currentTimeMillis ( ) ; if ( enableBackgroundCacheUpdate ) { org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.dashboardCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY , dashboard ) ; } else { org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.dashboardCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY , dashboard , org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_CACHE_UPDATE_INTERVAL , java.util.concurrent.TimeUnit.SECONDS ) ; } org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.log.debug ( "Dashboard utilization cache updated in {}ms" , ( endTime - startTime ) ) ; return dashboard ; }

Target:
private org.ovirt.engine.ui.frontend.server.dashboard.Dashboard populateUtilizationCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { long startTime = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.Dashboard dashboard = getDashboard ( ) ; long endTime = java.lang.System.currentTimeMillis ( ) ; if ( enableBackgroundCacheUpdate ) { dashboardCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY , dashboard ) ; } else { dashboardCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY , dashboard , org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_CACHE_UPDATE_INTERVAL , java.util.concurrent.TimeUnit.SECONDS ) ; } org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.log.debug ( "Dashboard utilization cache updated in {}ms" , ( endTime - startTime ) ) ; return dashboard ; }
Source:
public void testPreferIgnoresCase ( ) { org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "Persistent-Auth" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "PERSISTENT-AUTH" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_NEW_AUTH , getPrefer ( "new-auth" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_NEW_AUTH , getPrefer ( "NEW-AUTH" ) ) ; }

Target:
public void testPreferIgnoresCase ( ) { org.junit.jupiter.api.Assertions.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "Persistent-Auth" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "PERSISTENT-AUTH" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( FiltersHelper.PREFER_NEW_AUTH , getPrefer ( "new-auth" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( FiltersHelper.PREFER_NEW_AUTH , getPrefer ( "NEW-AUTH" ) ) ; }
Source:
public void testMigrateMacsToAnotherMacPool ( ) throws java.lang.Exception { underTest.migrateMacsToAnotherMacPool ( sourceMacPoolId , targetMacPoolId , macsToMigrate , false , commandContext ) ; org.mockito.Mockito.verify ( macPoolPerCluster ) . getMacPoolById ( sourceMacPoolId , commandContext ) ; org.mockito.Mockito.verify ( macPoolPerCluster ) . getMacPoolById ( targetMacPoolId , commandContext ) ; org.mockito.InOrder inOrder = org.mockito.Mockito.inOrder ( sourceMacPool , targetMacPool ) ; inOrder.verify ( sourceMacPool ) . freeMacs ( macsToMigrate ) ; inOrder.verify ( targetMacPool ) . forceAddMacs ( macsToMigrate ) ; }

Target:
public void canMigrateMacsToAnotherMacPoolWhenThereAreNoDuplicates ( ) { org.mockito.Mockito.when ( vmNicDao.getAllMacsByClusterId ( cluster.getId ( ) ) ) . thenReturn ( macsToMigrate ) ; org.junit.Assert.assertThat ( underTest.canMigrateMacsToAnotherMacPool ( cluster , targetMacPoolId ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static void getDomainListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
public void updateNetworkDevice ( ) { org.ovirt.engine.core.common.businessentities.HostDeviceId netDeviceId = new org.ovirt.engine.core.common.businessentities.HostDeviceId ( FixturesTool.NETWORK_HOST_DEVICE_HOST_ID , FixturesTool.NETWORK_HOST_DEVICE_NAME ) ; org.ovirt.engine.core.common.businessentities.HostDevice before = dao.get ( netDeviceId ) ; before.setNetworkInterfaceName ( ( ( before.getNetworkInterfaceName ( ) ) + "new" ) ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.HostDevice after = dao.get ( netDeviceId ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void updateNetworkDevice ( ) { org.ovirt.engine.core.common.businessentities.HostDevice before = getNetworkDevice ( ) ; before.setNetworkInterfaceName ( ( ( before.getNetworkInterfaceName ( ) ) + "new" ) ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.HostDevice after = dao.get ( before.getId ( ) ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }
Source:
public void nullifiedSnapshotOnUpdateDiskToShareable ( ) { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.setDiskInfo ( createShareableDisk ( VolumeFormat.RAW ) ) ; org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = createDiskImage ( ) ; oldDisk.setVmSnapshotId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( oldDisk ) ; initializeCommand ( parameters ) ; mockVmStatusDown ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( ( ( oldDisk.getVmSnapshotId ( ) ) == null ) ) ; }

Target:
public void nullifiedSnapshotOnUpdateDiskToShareable ( ) { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.setDiskInfo ( createShareableDisk ( VolumeFormat.RAW ) ) ; org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = createDiskImage ( ) ; oldDisk.setVmSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( oldDisk ) ; initializeCommand ( parameters ) ; mockVmStatusDown ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; command.executeVmCommand ( ) ; org.junit.Assert.assertTrue ( ( ( oldDisk.getVmSnapshotId ( ) ) == null ) ) ; }
Source:
private void TotalCPUCores_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getNumOfSockets ( ) . getSelectedItemChangedEvent ( ) . removeListener ( this ) ; getTotalCPUCores ( ) . getEntityChangedEvent ( ) . removeListener ( this ) ; getCoresPerSocket ( ) . getSelectedItemChangedEvent ( ) . removeListener ( this ) ; behavior.totalCpuCoresChanged ( ) ; getTotalCPUCores ( ) . getEntityChangedEvent ( ) . addListener ( this ) ; getNumOfSockets ( ) . getSelectedItemChangedEvent ( ) . addListener ( this ) ; getCoresPerSocket ( ) . getSelectedItemChangedEvent ( ) . addListener ( this ) ; }

Target:
private void totalCPUCores_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getNumOfSockets ( ) . getSelectedItemChangedEvent ( ) . removeListener ( this ) ; getTotalCPUCores ( ) . getEntityChangedEvent ( ) . removeListener ( this ) ; getCoresPerSocket ( ) . getSelectedItemChangedEvent ( ) . removeListener ( this ) ; behavior.totalCpuCoresChanged ( ) ; getTotalCPUCores ( ) . getEntityChangedEvent ( ) . addListener ( this ) ; getNumOfSockets ( ) . getSelectedItemChangedEvent ( ) . addListener ( this ) ; getCoresPerSocket ( ) . getSelectedItemChangedEvent ( ) . addListener ( this ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllIsoImagesList , org.ovirt.engine.core.common.queries.GetAllIsoImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , setUpFiles ( ) , failure ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllFloppyImagesList , org.ovirt.engine.core.common.queries.GetAllIsoImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , setUpFiles ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllImagesList , org.ovirt.engine.core.common.queries.GetAllIsoImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , setUpFiles ( ) , failure ) ; control.replay ( ) ; }
Source:
public void testStoragePoolIsNotUp ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_IMAGE_REPOSITORY_NOT_FOUND ) ) . when ( storagePoolValidator ) . existsAndUp ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_IMAGE_REPOSITORY_NOT_FOUND ) ; }

Target:
public void testStoragePoolIsNotUp ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ) . when ( storagePoolValidator ) . existsAndUp ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ; }
Source:
protected void syncSearch ( ) { onEntityChanged ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( result.getState ( ) ) ) ; localModel.stopProgress ( ) ; setConfirmWindow ( null ) ; if ( result.getReturnValue ( ) . getSucceeded ( ) ) { disableRemoveBrickStatusPopUpActions ( ) ; } }
Source:
protected boolean validateQuota ( ) { getParameters ( ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVmTemplate ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage di : getParameters ( ) . getImages ( ) ) { di.setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVmTemplate ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; } return true ; }

Target:
public void rollbackQuota ( ) { getQuotaManager ( ) . rollbackQuota ( getStoragePool ( ) , getQuotaManager ( ) . getQuotaListFromParameters ( getStorageQuotaListParameters ( ) ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > getLunsWithInitializedStorageType ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > existingStorageServerConnections = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun : luns ) { for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections storageServerConnection : lun.getLunConnections ( ) ) { storageServerConnection.setstorage_type ( storageType ) ; existingStorageServerConnections.add ( storageServerConnection ) ; } } return existingStorageServerConnections ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > getLunsWithInitializedStorageType ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > existingStorageServerConnections = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun : luns ) { for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections storageServerConnection : lun.getLunConnections ( ) ) { storageServerConnection.setStorageType ( storageType ) ; existingStorageServerConnections.add ( storageServerConnection ) ; } } return existingStorageServerConnections ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getvds_group_id ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getActionType ( ) . getActionGroup ( ) ) ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getVmTemplateId ( ) , org.ovirt.engine.core.common.VdcObjectType.VmTemplate , org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getActionType ( ) . getActionGroup ( ) ) ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getVmTemplateId ( ) , org.ovirt.engine.core.common.VdcObjectType.VmTemplate , org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }
Source:
public void canDoActionFailsWhenGlusterMultipleHostHasVolumesWithForce ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , true ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockHasMultipleClusters ( true ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }

Target:
public void canDoActionFailsWhenGlusterMultipleHostHasVolumesWithForce ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , true ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockHasMultipleClusters ( true ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }