org.apache.commons.dbcp.datasources
Class TestSharedPoolDataSource

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.dbcp.TestConnectionPool
              extended by org.apache.commons.dbcp.datasources.TestSharedPoolDataSource
All Implemented Interfaces:
junit.framework.Test

public class TestSharedPoolDataSource
extends TestConnectionPool

Version:
$Revision: 1023401 $ $Date: 2010-10-16 21:54:24 -0400 (Sat, 16 Oct 2010) $
Author:
John McNally, Dirk Verbeeck

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.commons.dbcp.TestConnectionPool
TestConnectionPool.PoolTest
 
Field Summary
 
Fields inherited from class org.apache.commons.dbcp.TestConnectionPool
connections
 
Constructor Summary
TestSharedPoolDataSource(String testName)
           
 
Method Summary
protected  Connection getConnection()
           
 void setUp()
           
static junit.framework.Test suite()
           
 void testBackPointers()
           
 void testChangePassword()
           
 void testClosePool()
          Test pool close.
 void testClosing()
           
 void testClosingWithUserName()
           
 void testIncorrectPassword()
          Switching 'u1 -> 'u2' and 'p1' -> 'p2' will exhibit the bug detailed in http://issues.apache.org/bugzilla/show_bug.cgi?id=18905 Starting with a successful connection, then incorrect password, then correct password for same user illustrates JIRA: DBCP-245
 void testMaxActive()
           
 void testMaxWait()
           
 void testMultipleThreads1()
           
 void testMultipleThreads2()
           
 void testOpening()
           
 void testPoolPreparedStatements()
           
 void testPoolPrepareStatement()
           
 void testSimple()
           
 void testSimple2()
           
 void testSimpleWithUsername()
           
 void testTransactionIsolationBehavior()
           
 
Methods inherited from class org.apache.commons.dbcp.TestConnectionPool
assertBackPointers, getMaxActive, getMaxWait, getUsername, isClosed, isClosed, multipleThreads, newConnection, tearDown, testAutoCommitBehavior, testCanCloseCallableStatementTwice, testCanCloseConnectionTwice, testCanClosePreparedStatementTwice, testCanCloseResultSetTwice, testCanCloseStatementTwice, testClearWarnings, testConnectionsAreDistinct, testHashCode, testHashing, testIsClosed, testNoRsetClose, testPooling, testPrepareStatementOptions, testRepeatedBorrowAndReturn, testThreaded
 
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

TestSharedPoolDataSource

public TestSharedPoolDataSource(String testName)
Method Detail

suite

public static junit.framework.Test suite()

getConnection

protected Connection getConnection()
                            throws Exception
Specified by:
getConnection in class TestConnectionPool
Throws:
Exception

setUp

public void setUp()
           throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

testBackPointers

public void testBackPointers()
                      throws Exception
Overrides:
testBackPointers in class TestConnectionPool
Throws:
Exception

testIncorrectPassword

public void testIncorrectPassword()
                           throws Exception
Switching 'u1 -> 'u2' and 'p1' -> 'p2' will exhibit the bug detailed in http://issues.apache.org/bugzilla/show_bug.cgi?id=18905 Starting with a successful connection, then incorrect password, then correct password for same user illustrates JIRA: DBCP-245

Throws:
Exception

testSimple

public void testSimple()
                throws Exception
Overrides:
testSimple in class TestConnectionPool
Throws:
Exception

testSimpleWithUsername

public void testSimpleWithUsername()
                            throws Exception
Throws:
Exception

testClosingWithUserName

public void testClosingWithUserName()
                             throws Exception
Throws:
Exception

testSimple2

public void testSimple2()
                 throws Exception
Overrides:
testSimple2 in class TestConnectionPool
Throws:
Exception

testOpening

public void testOpening()
                 throws Exception
Overrides:
testOpening in class TestConnectionPool
Throws:
Exception

testClosing

public void testClosing()
                 throws Exception
Overrides:
testClosing in class TestConnectionPool
Throws:
Exception

testClosePool

public void testClosePool()
                   throws Exception
Test pool close. Illustrates BZ 37359.

Throws:
Exception

testMaxActive

public void testMaxActive()
                   throws Exception
Overrides:
testMaxActive in class TestConnectionPool
Throws:
Exception

testMaxWait

public void testMaxWait()
                 throws Exception
Throws:
Exception

testMultipleThreads1

public void testMultipleThreads1()
                          throws Exception
Throws:
Exception

testMultipleThreads2

public void testMultipleThreads2()
                          throws Exception
Throws:
Exception

testTransactionIsolationBehavior

public void testTransactionIsolationBehavior()
                                      throws Exception
Throws:
Exception

testPoolPrepareStatement

public void testPoolPrepareStatement()
                              throws Exception
Throws:
Exception

testPoolPreparedStatements

public void testPoolPreparedStatements()
                                throws Exception
Throws:
Exception

testChangePassword

public void testChangePassword()
                        throws Exception
Throws:
Exception


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.