/** * Create a connection for testing purpose. * * @return a connection * @throws Exception to JUnit. */ public static Connection createConnection() throws Exception { if (dbfactory == null) { dbfactory = new DBConnectionFactoryImpl(CONNECTION_FACTORY_NAMESPACE); } Connection connection = dbfactory.createConnection(CONNECTION_NAME); connections.add(connection); return connection; }