Package net.officefloor.jdbc.test
Class ValidateConnections
- java.lang.Object
-
- net.officefloor.jdbc.test.ValidateConnections
-
public class ValidateConnections extends java.lang.ObjectConnectionDecoratorServiceFactoryto validate all createdConnectionandPooledConnectioninstances are closed on closingOfficeFloor.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceValidateConnections.PooledConnectionClosedIndicates if thePooledConnectionis closed.
-
Constructor Summary
Constructors Constructor Description ValidateConnections()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.sql.ConnectionaddConnection(java.sql.Connection connection)AddsConnection.static javax.sql.PooledConnectionaddConnection(javax.sql.PooledConnection connection)Adds aPooledConnection.static voidassertAllConnectionsClosed()Ensures all connections are closed.static voidassertNoPreviousTestConnections()Ensure that the previous test has not leaked connections into this test.static intgetConnectionsRegisteredCount()Obtains the number of connections registered.
-
-
-
Method Detail
-
getConnectionsRegisteredCount
public static int getConnectionsRegisteredCount()
Obtains the number of connections registered.- Returns:
- Number of connections registered.
-
assertNoPreviousTestConnections
public static void assertNoPreviousTestConnections()
Ensure that the previous test has not leaked connections into this test.
-
assertAllConnectionsClosed
public static void assertAllConnectionsClosed()
Ensures all connections are closed.
-
addConnection
public static java.sql.Connection addConnection(java.sql.Connection connection)
AddsConnection.- Parameters:
connection-Connection.- Returns:
Connection.
-
addConnection
public static javax.sql.PooledConnection addConnection(javax.sql.PooledConnection connection)
Adds aPooledConnection.- Parameters:
connection-PooledConnection.- Returns:
PooledConnection.
-
-