|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jbenchmark.TestFeature
net.sf.jbenchmark.Test
net.sf.jbenchmark.sql.AbstractSQLCallTest
net.sf.jbenchmark.sql.StoredProcedureTest
Encapsulates a single test that executes a stored procedure. A benchmark test for a stored procedure can operate in two different modes or types. These are:
MODIFY_TYPE
- If the stored procedure is known to modify the state of the database. The value
established by setCleanupScript(java.lang.String)
is currently optional and will only be executed
when the type matches this value. It is the responsibility of the test script writer to ensure the
database state is maintained.
QUERY_TYPE
- If the stored procedure is just performs some work and does not change the
state of the database.
Field Summary | |
static java.lang.String |
MODIFY_TYPE
Indicates that the stored procedure will modify something in the database. |
static java.lang.String |
QUERY_TYPE
Indicates that the stored procedure will only query from the DB and does not require a clean up script. |
Fields inherited from class net.sf.jbenchmark.sql.AbstractSQLCallTest |
connection, LOG, sqlArguments |
Constructor Summary | |
StoredProcedureTest()
|
Method Summary | |
protected void |
doCleanup()
Run the clean up script if this is a modify type of stored procedure. |
protected void |
doValidate()
Validate that the name of the stored procedure is not empty. |
java.lang.String |
getCleanupScript()
Script for restoring the db to a clean state. |
java.lang.String |
getName()
Name of the stored procedure. |
protected java.sql.PreparedStatement |
getPreparedStatement()
Return the stored procedure SQL statement as a prepared statement. |
java.lang.String |
getType()
Type of the stored procedure. |
static void |
registerBenchmarkTest(org.apache.commons.digester.Digester digester)
Register this benchmark test with the digester. |
protected void |
runCleanupScript()
The clean up script is executed at the end. |
void |
setCleanupScript(java.lang.String cleanupScript)
Script for restoring the db to a clean state. |
void |
setName(java.lang.String name)
Name of the stored procedure. |
void |
setType(java.lang.String type)
Type of the stored procedure. |
Methods inherited from class net.sf.jbenchmark.sql.AbstractSQLCallTest |
addSqlCallArgument, doInitialise, doRun, executeResult, getSqlArguments, setSqlArguments |
Methods inherited from class net.sf.jbenchmark.Test |
addAssertion, addFeature, addResource, finish, getFeatureContext, getResource, run, setContext |
Methods inherited from class net.sf.jbenchmark.TestFeature |
getContext, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String MODIFY_TYPE
public static final java.lang.String QUERY_TYPE
Constructor Detail |
public StoredProcedureTest()
Method Detail |
public java.lang.String getType()
public void setType(java.lang.String type)
public java.lang.String getCleanupScript()
public void setCleanupScript(java.lang.String cleanupScript)
protected void doValidate()
doValidate
in class AbstractSQLCallTest
protected void doCleanup() throws java.lang.Exception
doCleanup
in class AbstractSQLCallTest
java.lang.Exception
protected void runCleanupScript() throws java.lang.Exception
java.lang.Exception
protected java.sql.PreparedStatement getPreparedStatement() throws java.sql.SQLException
getPreparedStatement
in class AbstractSQLCallTest
java.sql.SQLException
public java.lang.String getName()
getName
in class TestFeature
public void setName(java.lang.String name)
setName
in class TestFeature
public static final void registerBenchmarkTest(org.apache.commons.digester.Digester digester)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |