Package net.officefloor.jdbc.test
Class ValidateConnections
- java.lang.Object
-
- net.officefloor.jdbc.test.ValidateConnections
-
public class ValidateConnections extends java.lang.Object
ConnectionDecoratorServiceFactory
to validate all createdConnection
andPooledConnection
instances are closed on closingOfficeFloor
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ValidateConnections.PooledConnectionClosed
Indicates if thePooledConnection
is closed.
-
Constructor Summary
Constructors Constructor Description ValidateConnections()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.sql.Connection
addConnection(java.sql.Connection connection)
AddsConnection
.static javax.sql.PooledConnection
addConnection(javax.sql.PooledConnection connection)
Adds aPooledConnection
.static void
assertAllConnectionsClosed()
Ensures all connections are closed.static void
assertNoPreviousTestConnections()
Ensure that the previous test has not leaked connections into this test.static int
getConnectionsRegisteredCount()
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
.
-
-