org.opensubsystems.core.persist.db.connectionpool
Class C3P0DatabaseConnectionFactoryTest.C3P0DatabaseConnectionFactoryTestInternal

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.opensubsystems.core.persist.db.DatabaseTest
              extended by org.opensubsystems.core.persist.db.connectionpool.DatabaseConnectionFactoryBaseTest
                  extended by org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImplBaseTest
                      extended by org.opensubsystems.core.persist.db.connectionpool.C3P0DatabaseConnectionFactoryTest.C3P0DatabaseConnectionFactoryTestInternal
All Implemented Interfaces:
junit.framework.Test
Enclosing class:
C3P0DatabaseConnectionFactoryTest

public static class C3P0DatabaseConnectionFactoryTest.C3P0DatabaseConnectionFactoryTestInternal
extends PooledDatabaseConnectionFactoryImplBaseTest

Internal class which can be included in other test suites directly without including the above suite. This allows us to group multiple tests together and the execute the DatabaseTestSetup only once


Field Summary
 
Fields inherited from class org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImplBaseTest
ALL_CONNECTION_COUNT, POOL_WAIT_PERIOD
 
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
C3P0DatabaseConnectionFactoryTest.C3P0DatabaseConnectionFactoryTestInternal(java.lang.String strTestName)
          Create new C3P0DatabaseConnectionFactoryTest.
 
Method Summary
protected  java.lang.Object addItem(java.sql.Connection newConnection)
          Method returns item that will be added to the list.
protected  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.
 
Methods inherited from class org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImplBaseTest
testRequestOneMoreCanGrow, testRequestOneMoreCannotGrow, testRequestXReturnX
 
Methods inherited from class org.opensubsystems.core.persist.db.connectionpool.DatabaseConnectionFactoryBaseTest
tearDown, testAddDataSourceWithTheSameName, testConnectionCountForTwoDataSources, testCreatingDefaultDataSource, testRequestConnectionByUserAndPassword, testRequestConnectionCount, testRequestConnectionCountByDataSource, testRequestConnectionCountByDataSourceWithUserAndPasswd, testRequestConnectionCountForSpecifiedDataSource, testRequestConnectionFromTwoDataSources, testRequestConnectionFromTwoDataSourcesByUserAndPassword, testReturnConnectionCount
 
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
 

Constructor Detail

C3P0DatabaseConnectionFactoryTest.C3P0DatabaseConnectionFactoryTestInternal

public C3P0DatabaseConnectionFactoryTest.C3P0DatabaseConnectionFactoryTestInternal(java.lang.String strTestName)
Create new C3P0DatabaseConnectionFactoryTest.

Parameters:
strTestName - - name of the test
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Set up environment for the test case.

Overrides:
setUp in class PooledDatabaseConnectionFactoryImplBaseTest
Throws:
java.lang.Exception - - an error has occured during setting up test

addItem

protected java.lang.Object addItem(java.sql.Connection newConnection)
                            throws org.opensubsystems.core.error.OSSInternalErrorException
Method returns item that will be added to the list. The item should uniquely represent the connection or the underlying connection so that it can be compared with different connections.

Overrides:
addItem in class PooledDatabaseConnectionFactoryImplBaseTest
Parameters:
newConnection - - actual connection
Returns:
Object - object that will be added to the list
Throws:
org.opensubsystems.core.error.OSSInternalErrorException - - an error has occured

containsConnection

protected boolean containsConnection(java.util.List lstConnections,
                                     java.sql.Connection newConnection)
                              throws org.opensubsystems.core.error.OSSInternalErrorException
Method results if new connection is contained within the list of first time requested connections.

Specified by:
containsConnection in class PooledDatabaseConnectionFactoryImplBaseTest
Parameters:
lstConnections - - list of first time requested connections
newConnection - - just new requested connection (requested second time)
Returns:
true - if newConnection is contained in the list false - if newConnection is not contained in the list
Throws:
org.opensubsystems.core.error.OSSInternalErrorException


Copyright © 2003 - 2006 OpenSubsystems s.r.o.