|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.opensubsystems.core.persist.db.DatabaseTest
public abstract class DatabaseTest
Base class for all tests that access the database. Test cases derived from this class should use DatabaseTestSetup adapter and follow comments in this class to properly initialize and shutdown database.
| Field Summary | |
|---|---|
protected static java.lang.String |
DEFAULT_DB_PASSWORD
Default password for database user. |
protected static java.lang.String |
DEFAULT_DB_USER
Default name for database user. |
protected static java.lang.String |
DEFAULT_PROPERTY_FILE
Default property file used to run tests. |
protected java.sql.Connection |
m_connection
Connection to the database which can be used by test. |
protected int |
m_iRequestedConnectionCount
How many connections were requested at the beginning of the test from the pool. |
protected javax.transaction.UserTransaction |
m_transaction
Database transaction which can be used by test. |
| Constructor Summary | |
|---|---|
DatabaseTest(java.lang.String strTestName)
Create new DatabaseTest. |
|
| Method Summary | |
|---|---|
static void |
addDataSource(java.lang.String strDataSourceName,
java.lang.String strDriverName,
java.lang.String strUrl)
Create data source to be managed by the transaction manager. |
static void |
addDataSource(java.lang.String strDataSourceName,
java.lang.String strDriverName,
java.lang.String strUrl,
java.lang.String strUser,
java.lang.String strPassword)
Create data source to be managed by the transaction manager. |
static java.lang.String |
getDataSourceName()
Get the name of the data source used by this test. |
static void |
setDataSourceName(java.lang.String strDataSourceName)
Set the data source to be used by this database test. |
protected void |
setUp()
Set up environment for the test case. |
protected void |
tearDown()
Restore original environment after the test case. |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String DEFAULT_DB_USER
protected static final java.lang.String DEFAULT_DB_PASSWORD
protected static final java.lang.String DEFAULT_PROPERTY_FILE
protected javax.transaction.UserTransaction m_transaction
protected java.sql.Connection m_connection
protected int m_iRequestedConnectionCount
| Constructor Detail |
|---|
public DatabaseTest(java.lang.String strTestName)
strTestName - - name of the test| Method Detail |
|---|
public static void addDataSource(java.lang.String strDataSourceName,
java.lang.String strDriverName,
java.lang.String strUrl)
throws org.opensubsystems.core.error.OSSException
strDataSourceName - - data source which will be used by this teststrDriverName - - driver name which will be used by this teststrUrl - - url this test connects to the database \
org.opensubsystems.core.error.OSSException - - an error has occured
public static void addDataSource(java.lang.String strDataSourceName,
java.lang.String strDriverName,
java.lang.String strUrl,
java.lang.String strUser,
java.lang.String strPassword)
throws org.opensubsystems.core.error.OSSException
strDataSourceName - - data source which will be used by this teststrDriverName - - driver name which will be used by this teststrUrl - - url this test connects to the databasestrUser - - user name to connects to the databasestrPassword - - password to connects to the database
org.opensubsystems.core.error.OSSException - - an error has occured
public static void setDataSourceName(java.lang.String strDataSourceName)
throws org.opensubsystems.core.error.OSSException
strDataSourceName - - data source which will be used by this test
org.opensubsystems.core.error.OSSException - - an error has occured
public static java.lang.String getDataSourceName()
throws org.opensubsystems.core.error.OSSException
org.opensubsystems.core.error.OSSException - - an error has occured
protected void setUp()
throws java.lang.Exception
setUp in class junit.framework.TestCasejava.lang.Exception - - an error has occured while setting up test
protected void tearDown()
throws java.lang.Exception
tearDown in class junit.framework.TestCasejava.lang.Exception - - an error has occured while tearing down test
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||