@Test public void setupConnection() throws SQLException { final RealEmbeddedDatabaseCreatorImpl databaseCreator = new RealEmbeddedDatabaseCreatorImpl(false, "name", Collections .emptyMap(), Collections .emptyList(), new H2JdbcUrlFactory(), CompatibilityMode.DB2); databaseCreator.setupConnection("name"); assertNotNull(databaseCreator.getConnection()); databaseCreator.takeDownConnection(); }
protected void setupConnection(final String name) throws SQLException { testName = name; final String url = generateJdbcUrl(); try { connection = DriverManager.getConnection(url); } catch (JdbcSQLException e) { if (url.contains("RUNSCRIPT")) { LOGGER.error("Failed to initialize the H2 database. Please check your init script for errors", e); } throw e; } connection.setAutoCommit(isAutoCommit()); for (InitializationPlugin entry : initializationPlugins) { entry.connectionMade(name, getConnection()); } }
EmbeddedDatabaseCreatorImpl implements EmbeddedDatabaseCreator { protected void setupConnection(final String name) throws SQLException { testName = name; final String url = generateJdbcUrl(); try { connection = DriverManager.getConnection(url); } catch (JdbcSQLException e) { if (url.contains("RUNSCRIPT")) { LOGGER.error("Failed to initialize the H2 database. Please check your init script for errors", e); } throw e; } connection.setAutoCommit(isAutoCommit()); for (InitializationPlugin entry : initializationPlugins) { entry.connectionMade(name, getConnection()); } } }
EmbeddedDatabaseCreatorImpl implements EmbeddedDatabaseCreator { protected void setupConnection(final String name) throws SQLException { testName = name; final String url = generateJdbcUrl(); try { connection = DriverManager.getConnection(url); } catch (JdbcSQLException e) { if (url.contains("RUNSCRIPT")) { LOGGER.error("Failed to initialize the H2 database. Please check your init script for errors", e); } throw e; } connection.setAutoCommit(isAutoCommit()); for (InitializationPlugin entry : initializationPlugins) { entry.connectionMade(name, getConnection()); } } protected  EmbeddedDatabaseCreatorImpl(final boolean autoCommit,
                                        final String name,
                                        final Map<String, String> jdbcUrlProperties,
                                        final List<InitializationPlugin> initializationPlugins,
                                        final JdbcUrlFactory jdbcUrlFactory,
                                        final CompatibilityMode compatibilityMode); }
EmbeddedDatabaseCreatorImpl implements EmbeddedDatabaseCreator { protected void setupConnection(final String name) throws SQLException { testName = name; final String url = generateJdbcUrl(); try { connection = DriverManager.getConnection(url); } catch (JdbcSQLException e) { if (url.contains("RUNSCRIPT")) { LOGGER.error("Failed to initialize the H2 database. Please check your init script for errors", e); } throw e; } connection.setAutoCommit(isAutoCommit()); for (InitializationPlugin entry : initializationPlugins) { entry.connectionMade(name, getConnection()); } } protected  EmbeddedDatabaseCreatorImpl(final boolean autoCommit,
                                        final String name,
                                        final Map<String, String> jdbcUrlProperties,
                                        final List<InitializationPlugin> initializationPlugins,
                                        final JdbcUrlFactory jdbcUrlFactory,
                                        final CompatibilityMode compatibilityMode); @Override Connection getConnection(); @Override DataSource getDataSource(); @Override boolean isAutoCommit(); @Override String getConnectionJdbcUrl(); }
EmbeddedDatabaseCreatorImpl implements EmbeddedDatabaseCreator { protected void setupConnection(final String name) throws SQLException { testName = name; final String url = generateJdbcUrl(); try { connection = DriverManager.getConnection(url); } catch (JdbcSQLException e) { if (url.contains("RUNSCRIPT")) { LOGGER.error("Failed to initialize the H2 database. Please check your init script for errors", e); } throw e; } connection.setAutoCommit(isAutoCommit()); for (InitializationPlugin entry : initializationPlugins) { entry.connectionMade(name, getConnection()); } } protected  EmbeddedDatabaseCreatorImpl(final boolean autoCommit,
                                        final String name,
                                        final Map<String, String> jdbcUrlProperties,
                                        final List<InitializationPlugin> initializationPlugins,
                                        final JdbcUrlFactory jdbcUrlFactory,
                                        final CompatibilityMode compatibilityMode); @Override Connection getConnection(); @Override DataSource getDataSource(); @Override boolean isAutoCommit(); @Override String getConnectionJdbcUrl();  }