org.jminor.common.db.tools
Class QueryLoadTestModel.QueryScenario

java.lang.Object
  extended by org.jminor.common.model.LoadTestModel.AbstractUsageScenario<QueryLoadTestModel.QueryApplication>
      extended by org.jminor.common.db.tools.QueryLoadTestModel.QueryScenario
All Implemented Interfaces:
Serializable, LoadTest.UsageScenario<QueryLoadTestModel.QueryApplication>
Enclosing class:
QueryLoadTestModel

public static class QueryLoadTestModel.QueryScenario
extends LoadTestModel.AbstractUsageScenario<QueryLoadTestModel.QueryApplication>

A usage scenario based on a SQL query.

See Also:
Serialized Form

Constructor Summary
QueryLoadTestModel.QueryScenario(String name, String query)
          Instantiates a new non-transactional QueryScenario.
QueryLoadTestModel.QueryScenario(String name, String query, boolean transactional)
          Instantiates a new QueryScenario.
 
Method Summary
protected  List<Object> getParameters()
          For overriding, returns the parameter values to use for the next query execution, these must of course match the parameter slots in the underlying query.
protected  void performScenario(QueryLoadTestModel.QueryApplication application)
          Runs a set of actions on the given application.
 
Methods inherited from class org.jminor.common.model.LoadTestModel.AbstractUsageScenario
cleanup, clearExceptions, equals, getDefaultWeight, getExceptions, getName, getSuccessfulRunCount, getTotalRunCount, getUnsuccessfulRunCount, hashCode, prepare, resetRunCount, run, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryLoadTestModel.QueryScenario

public QueryLoadTestModel.QueryScenario(String name,
                                        String query)
Instantiates a new non-transactional QueryScenario.

Parameters:
name - a unique name for the scenario
query - the query

QueryLoadTestModel.QueryScenario

public QueryLoadTestModel.QueryScenario(String name,
                                        String query,
                                        boolean transactional)
Instantiates a new QueryScenario.

Parameters:
name - a unique name for the scenario
query - the query
transactional - if true, commit and rollback is performed on success and error respectively
Method Detail

performScenario

protected final void performScenario(QueryLoadTestModel.QueryApplication application)
                              throws LoadTest.ScenarioException
Description copied from class: LoadTestModel.AbstractUsageScenario
Runs a set of actions on the given application.

Specified by:
performScenario in class LoadTestModel.AbstractUsageScenario<QueryLoadTestModel.QueryApplication>
Parameters:
application - the connection pool providing connections
Throws:
ScenarioException - in case of an exception during the scenario run
LoadTest.ScenarioException

getParameters

protected List<Object> getParameters()
For overriding, returns the parameter values to use for the next query execution, these must of course match the parameter slots in the underlying query.

Returns:
a list of parameters for the next query run