Class ValidateConnections


  • public class ValidateConnections
    extends java.lang.Object
    ConnectionDecoratorServiceFactory to validate all created Connection and PooledConnection instances are closed on closing OfficeFloor.
    Author:
    Daniel Sagenschneider
    • Constructor Detail

      • ValidateConnections

        public ValidateConnections()
    • 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)
        Adds Connection.
        Parameters:
        connection - Connection.
        Returns:
        Connection.
      • addConnection

        public static javax.sql.PooledConnection addConnection​(javax.sql.PooledConnection connection)
        Adds a PooledConnection.
        Parameters:
        connection - PooledConnection.
        Returns:
        PooledConnection.