org.logicalcobwebs.proxool
Class WrapperTest

java.lang.Object
  extended by TestCase
      extended by org.logicalcobwebs.proxool.AbstractProxoolTest
          extended by org.logicalcobwebs.proxool.WrapperTest

public class WrapperTest
extends AbstractProxoolTest

Tests whether we are wrapping up connections correctly. There disposable wrappers stop the user doing nasty things to the connection after it has been closed.

Since:
Proxool 0.9
Version:
$Revision: 1.3 $, $Date: 2004/06/02 21:11:24 $
Author:
bill, $Author: billhorsman $ (current maintainer)

Field Summary
private static Log LOG
           
 
Constructor Summary
WrapperTest(java.lang.String alias)
           
 
Method Summary
 void testAlias()
          Check whether ProxoolFacade.getAlias(java.sql.Connection) returns sensible values
 void testCreateStatementAfterClose()
          Check that calling createStatement after a connection has been closed throws an exception
 void testDoubleClose()
          Check that nothing bad happens if you close a connection twice
 void testDoubleConnection()
          Check that closing a connection twice can't close the same connection for the next user
 void testEquals()
          Check tha equals() works right
 void testHashCode()
          Check that isClosed() returns true after we have closed a connection
 void testId()
          Check whether ProxoolFacade.getId(java.sql.Connection) returns sensible values
 void testIsClosedAfterClose()
          Check that isClosed() returns true after we have closed a connection
 
Methods inherited from class org.logicalcobwebs.proxool.AbstractProxoolTest
setUp, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG
Constructor Detail

WrapperTest

public WrapperTest(java.lang.String alias)
See Also:
AbstractProxoolTest
Method Detail

testDoubleConnection

public void testDoubleConnection()
                          throws java.lang.Exception
Check that closing a connection twice can't close the same connection for the next user

Throws:
java.lang.Exception

testDoubleClose

public void testDoubleClose()
                     throws java.sql.SQLException,
                            ProxoolException
Check that nothing bad happens if you close a connection twice

Throws:
java.sql.SQLException - if anything goes wrong
ProxoolException - if anything goes wrong

testCreateStatementAfterClose

public void testCreateStatementAfterClose()
                                   throws java.sql.SQLException,
                                          ProxoolException
Check that calling createStatement after a connection has been closed throws an exception

Throws:
java.sql.SQLException - if anything goes wrong
ProxoolException - if anything goes wrong

testIsClosedAfterClose

public void testIsClosedAfterClose()
                            throws java.sql.SQLException,
                                   ProxoolException
Check that isClosed() returns true after we have closed a connection

Throws:
java.sql.SQLException - if anything goes wrong
ProxoolException - if anything goes wrong

testHashCode

public void testHashCode()
                  throws java.sql.SQLException,
                         ProxoolException
Check that isClosed() returns true after we have closed a connection

Throws:
java.sql.SQLException - if anything goes wrong
ProxoolException - if anything goes wrong

testEquals

public void testEquals()
                throws java.sql.SQLException,
                       ProxoolException
Check tha equals() works right

Throws:
java.sql.SQLException - if anything goes wrong
ProxoolException - if anything goes wrong

testId

public void testId()
            throws ProxoolException,
                   java.sql.SQLException
Check whether ProxoolFacade.getId(java.sql.Connection) returns sensible values

Throws:
ProxoolException - if anything goes wrong
java.sql.SQLException - if anything goes wrong

testAlias

public void testAlias()
               throws ProxoolException,
                      java.sql.SQLException
Check whether ProxoolFacade.getAlias(java.sql.Connection) returns sensible values

Throws:
ProxoolException - if anything goes wrong
java.sql.SQLException - if anything goes wrong