|
|||||||||
| 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
org.opensubsystems.core.persist.db.connectionpool.DatabaseConnectionFactoryBaseTest
org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImplBaseTest
public abstract class PooledDatabaseConnectionFactoryImplBaseTest
Base class containing tests for general concepts of pooled database connection factories, which every pooled database connection factory should support.
| Field Summary | |
|---|---|
protected static int |
ALL_CONNECTION_COUNT
Constant defining MAX POOL SIZE - maximal number of connections in the pool |
protected static int |
POOL_WAIT_PERIOD
Constant defining POOL WAIT PERIOD - how long the pool will be waiting when there are used all connections in the pool. |
| Fields inherited from class org.opensubsystems.core.persist.db.connectionpool.DatabaseConnectionFactoryBaseTest |
|---|
DATASOURCE_NAME_1, DATASOURCE_NAME_2, DATASOURCE_NAME_ADMIN, m_connectionFactory, USERNAME_FOR_DS_2 |
| Fields inherited from class org.opensubsystems.core.persist.db.DatabaseTest |
|---|
DEFAULT_DB_PASSWORD, DEFAULT_DB_USER, DEFAULT_PROPERTY_FILE, m_connection, m_iRequestedConnectionCount, m_transaction |
| Constructor Summary | |
|---|---|
PooledDatabaseConnectionFactoryImplBaseTest(java.lang.String strTestName)
Create new PooledDatabaseConnectionFactoryImplBaseTest. |
|
| Method Summary | |
|---|---|
protected java.lang.Object |
addItem(java.sql.Connection cActualConnection)
Method returns item that will be added to the list. |
protected abstract boolean |
containsConnection(java.util.List lstConnections,
java.sql.Connection newConnection)
Method results if new connection is contained within the list of first time requested connections. |
protected void |
setUp()
Set up environment for the test case. |
void |
testRequestOneMoreCanGrow()
Test for request X+1 connections when there is possible to grow pool (CAN GROW flag = TRUE or particular pool supports it) This method is the same as testRequestOneMoreCannotGrow() but we need to have two methods with different names because we need to set different value for CAN GROW property. |
void |
testRequestOneMoreCannotGrow()
Test for request X+1 connections when there is not possible to grow pool (CAN GROW flag = FALSE or particular pool doesn't support it). |
void |
testRequestXReturnX()
Test if I configure the factory to return at most X connections and block then I cannot retrieve more. |
| Methods inherited from class org.opensubsystems.core.persist.db.DatabaseTest |
|---|
addDataSource, addDataSource, getDataSourceName, setDataSourceName |
| 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 int ALL_CONNECTION_COUNT
protected static final int POOL_WAIT_PERIOD
| Constructor Detail |
|---|
public PooledDatabaseConnectionFactoryImplBaseTest(java.lang.String strTestName)
strTestName - - name of the test| Method Detail |
|---|
protected void setUp()
throws java.lang.Exception
setUp in class DatabaseConnectionFactoryBaseTestjava.lang.Exception - - an error has occured during setting up test
public void testRequestXReturnX()
throws java.lang.Exception
java.lang.Exception - - an error has occured during test
public void testRequestOneMoreCannotGrow()
throws java.lang.Exception
java.lang.Exception - - an error has occured during test
public void testRequestOneMoreCanGrow()
throws java.lang.Exception
java.lang.Exception - - an error has occured during test
protected abstract boolean containsConnection(java.util.List lstConnections,
java.sql.Connection newConnection)
throws org.opensubsystems.core.error.OSSException
lstConnections - - list of first time requested connectionsnewConnection - - just new requested connection (requested second time)
org.opensubsystems.core.error.OSSException - - exception occured during comparing 2 connections
protected java.lang.Object addItem(java.sql.Connection cActualConnection)
throws org.opensubsystems.core.error.OSSInternalErrorException
cActualConnection - - actual connection
org.opensubsystems.core.error.OSSInternalErrorException - - an error has occured
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||