org.objectweb.cjdbc.scenario.standalone.connection
Class VariablePoolConnectionManagerTest

java.lang.Object
  extended byTestCase
      extended byorg.objectweb.cjdbc.scenario.templates.NoTemplate
          extended byorg.objectweb.cjdbc.scenario.standalone.connection.VariablePoolConnectionManagerTest

public class VariablePoolConnectionManagerTest
extends NoTemplate

VariablePoolConnectionManager test class.

Author:
Mathieu Peltier
See Also:
RandomWaitPoolConnectionManager, Serialized Form

Field Summary
private  MockDriver mockDriver
          Fake driver.
private  VariablePoolConnectionManager pool
          Variable pool connection manager pool to test.
 
Fields inherited from class org.objectweb.cjdbc.scenario.templates.NoTemplate
logger, TEXT_DIR
 
Constructor Summary
VariablePoolConnectionManagerTest()
           
 
Method Summary
private  void initializePool(int initPoolSize, int minPoolSize, int maxPoolSize, int idleTimeout, int waitTimeout)
          Creates and initializes a VariablePoolConnectionManager.
static void main(java.lang.String[] args)
          Starts a new test
protected  void setUp()
           
static Test suite()
          Builds a new TestSuite
protected  void tearDown()
           
 void testGetAndReleaseConnection()
           
 void testRemoveIdleConnectionsThread()
           
 void testWaitTimeoutFeature()
          Test of the wait timeout feature.
 
Methods inherited from class org.objectweb.cjdbc.scenario.templates.NoTemplate
getTextPath, getUserDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mockDriver

private MockDriver mockDriver
Fake driver.


pool

private VariablePoolConnectionManager pool
Variable pool connection manager pool to test.

Constructor Detail

VariablePoolConnectionManagerTest

public VariablePoolConnectionManagerTest()
Method Detail

suite

public static Test suite()
Builds a new TestSuite

Returns:
the TestSuite

main

public static void main(java.lang.String[] args)
Starts a new test

Parameters:
args - test parameters

setUp

protected void setUp()
See Also:
junit.framework.TestCase#setUp()

tearDown

protected void tearDown()
See Also:
junit.framework.TestCase#tearDown()

initializePool

private void initializePool(int initPoolSize,
                            int minPoolSize,
                            int maxPoolSize,
                            int idleTimeout,
                            int waitTimeout)
Creates and initializes a VariablePoolConnectionManager.

Parameters:
initPoolSize - init pool size.
minPoolSize - min pool size.
maxPoolSize - max pool size.
idleTimeout - idle timeout
waitTimeout - wait timeout.

testWaitTimeoutFeature

public void testWaitTimeoutFeature()
                            throws java.lang.Exception
Test of the wait timeout feature.

Throws:
java.lang.Exception - if an error occurs

testGetAndReleaseConnection

public void testGetAndReleaseConnection()
                                 throws java.lang.Exception
Throws:
java.lang.Exception - if an error occurs
See Also:
VariablePoolConnectionManager.releaseConnection(Connection), VariablePoolConnectionManager.getConnection()

testRemoveIdleConnectionsThread

public void testRemoveIdleConnectionsThread()
                                     throws java.lang.Exception
Throws:
java.lang.Exception
See Also:
VariablePoolConnectionManager.RemoveIdleConnectionsThread


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.