|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread biocell.BioThread db.DbInterface
public class DbInterface
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected java.sql.Connection |
conn
Connection to server, initialized in setUp() Cleaned up in tearDown(). |
protected java.lang.String |
dbClass
The driver to use |
protected static java.lang.String |
dbUrl
JDBC URL, initialized from com.mysql.jdbc.testsuite.url system property, or defaults to jdbc:mysql:///test |
protected java.sql.PreparedStatement |
pstmt
PreparedStatement to be used in tests, not initialized. |
protected java.sql.ResultSet |
rs
ResultSet to be used in tests, not initialized. |
protected java.sql.Statement |
stmt
Statement to be used in tests, initialized in setUp(). |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
DbInterface(java.lang.String name)
Creates a new BaseTestCase object. |
Method Summary | |
---|---|
protected void |
createTable(java.lang.String tableName,
java.lang.String columnsAndOtherStuff)
|
protected void |
dropTable(java.lang.String tableName)
|
protected java.sql.Connection |
getAdminConnection()
|
protected java.sql.Connection |
getAdminConnectionWithProps(java.util.Properties props)
|
protected java.sql.Connection |
getConnectionWithProps(java.util.Properties props)
Returns a new connection with the given properties |
protected java.sql.Connection |
getConnectionWithProps(java.lang.String url,
java.util.Properties props)
|
protected int |
getInstanceNumber()
Returns the per-instance counter (for messages when multi-threading stress tests) |
protected java.lang.String |
getMysqlVariable(java.sql.Connection c,
java.lang.String variableName)
|
protected java.lang.String |
getMysqlVariable(java.lang.String variableName)
Returns the named MySQL variable from the currently connected server. |
protected int |
getRowCount(java.lang.String tableName)
|
protected java.lang.Object |
getSingleIndexedValueWithQuery(java.sql.Connection c,
int columnIndex,
java.lang.String query)
|
protected java.lang.Object |
getSingleIndexedValueWithQuery(int columnIndex,
java.lang.String query)
|
protected java.lang.Object |
getSingleValue(java.lang.String tableName,
java.lang.String columnName,
java.lang.String whereClause)
|
protected java.lang.Object |
getSingleValueWithQuery(java.lang.String query)
|
protected boolean |
isAdminConnectionConfigured()
|
void |
logDebug(java.lang.String message)
|
protected boolean |
runLongTests()
|
protected boolean |
runTestIfSysPropDefined(java.lang.String propName)
Checks whether a certain system property is defined, in order to run/not-run certain tests |
void |
setUp()
Creates resources used by all tests. |
void |
tearDown()
Destroys resources created during the test case. |
protected boolean |
versionMeetsMinimum(int major,
int minor)
Checks whether the database we're connected to meets the given version minimum |
protected boolean |
versionMeetsMinimum(int major,
int minor,
int subminor)
Checks whether the database we're connected to meets the given version minimum |
Methods inherited from class biocell.BioThread |
---|
getCurrentmood, getMoodParam, getstate, setMood, stepEnergy |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static java.lang.String dbUrl
protected java.sql.Connection conn
protected java.sql.PreparedStatement pstmt
protected java.sql.ResultSet rs
protected java.sql.Statement stmt
protected java.lang.String dbClass
Constructor Detail |
---|
public DbInterface(java.lang.String name)
name
- The name of the JUnit test caseMethod Detail |
---|
public void setUp() throws java.lang.Exception
java.lang.Exception
- if an error occurs.public void tearDown() throws java.lang.Exception
java.lang.Exception
- DOCUMENT ME!protected java.sql.Connection getAdminConnection() throws java.sql.SQLException
java.sql.SQLException
protected boolean isAdminConnectionConfigured()
protected java.sql.Connection getAdminConnectionWithProps(java.util.Properties props) throws java.sql.SQLException
java.sql.SQLException
protected java.sql.Connection getConnectionWithProps(java.util.Properties props) throws java.sql.SQLException
props
- the properties to use (the URL will come from the standard for
this testcase).
java.sql.SQLException
- DOCUMENT ME!protected int getInstanceNumber()
protected java.lang.String getMysqlVariable(java.lang.String variableName) throws java.sql.SQLException
variableName
- the name of the variable to return
java.sql.SQLException
- if an error occursprotected java.lang.String getMysqlVariable(java.sql.Connection c, java.lang.String variableName) throws java.sql.SQLException
java.sql.SQLException
protected int getRowCount(java.lang.String tableName) throws java.sql.SQLException
java.sql.SQLException
protected java.lang.Object getSingleIndexedValueWithQuery(int columnIndex, java.lang.String query) throws java.sql.SQLException
java.sql.SQLException
protected java.lang.Object getSingleIndexedValueWithQuery(java.sql.Connection c, int columnIndex, java.lang.String query) throws java.sql.SQLException
java.sql.SQLException
protected java.lang.Object getSingleValue(java.lang.String tableName, java.lang.String columnName, java.lang.String whereClause) throws java.sql.SQLException
java.sql.SQLException
protected java.lang.Object getSingleValueWithQuery(java.lang.String query) throws java.sql.SQLException
java.sql.SQLException
protected boolean runTestIfSysPropDefined(java.lang.String propName)
propName
- the property name to check for
protected boolean versionMeetsMinimum(int major, int minor) throws java.sql.SQLException
major
- the major version to meetminor
- the minor version to meet
java.sql.SQLException
- if an error occurs.protected boolean versionMeetsMinimum(int major, int minor, int subminor) throws java.sql.SQLException
major
- the major version to meetminor
- the minor version to meet
java.sql.SQLException
- if an error occurs.protected void createTable(java.lang.String tableName, java.lang.String columnsAndOtherStuff) throws java.sql.SQLException
java.sql.SQLException
protected void dropTable(java.lang.String tableName) throws java.sql.SQLException
java.sql.SQLException
public void logDebug(java.lang.String message)
protected final boolean runLongTests()
protected java.sql.Connection getConnectionWithProps(java.lang.String url, java.util.Properties props) throws java.sql.SQLException
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |