|
|
|
@ -53,7 +53,7 @@ public class DevToolsPooledDataSourceAutoConfigurationTests
|
|
|
|
|
public void autoConfiguredInMemoryDataSourceIsShutdown() throws SQLException {
|
|
|
|
|
ConfigurableApplicationContext context = createContext(
|
|
|
|
|
DataSourceAutoConfiguration.class, DataSourceSpyConfiguration.class);
|
|
|
|
|
Statement statement = configureDataSourceBehaviour(
|
|
|
|
|
Statement statement = configureDataSourceBehavior(
|
|
|
|
|
context.getBean(DataSource.class));
|
|
|
|
|
context.close();
|
|
|
|
|
verify(statement).execute("SHUTDOWN");
|
|
|
|
@ -63,7 +63,7 @@ public class DevToolsPooledDataSourceAutoConfigurationTests
|
|
|
|
|
public void autoConfiguredExternalDataSourceIsNotShutdown() throws SQLException {
|
|
|
|
|
ConfigurableApplicationContext context = createContext("org.postgresql.Driver",
|
|
|
|
|
DataSourceAutoConfiguration.class, DataSourceSpyConfiguration.class);
|
|
|
|
|
Statement statement = configureDataSourceBehaviour(
|
|
|
|
|
Statement statement = configureDataSourceBehavior(
|
|
|
|
|
context.getBean(DataSource.class));
|
|
|
|
|
context.close();
|
|
|
|
|
verify(statement, times(0)).execute("SHUTDOWN");
|
|
|
|
@ -74,7 +74,7 @@ public class DevToolsPooledDataSourceAutoConfigurationTests
|
|
|
|
|
ConfigurableApplicationContext context = createContext("org.h2.Driver",
|
|
|
|
|
"jdbc:h2:hsql://localhost", DataSourceAutoConfiguration.class,
|
|
|
|
|
DataSourceSpyConfiguration.class);
|
|
|
|
|
Statement statement = configureDataSourceBehaviour(
|
|
|
|
|
Statement statement = configureDataSourceBehavior(
|
|
|
|
|
context.getBean(DataSource.class));
|
|
|
|
|
context.close();
|
|
|
|
|
verify(statement, times(0)).execute("SHUTDOWN");
|
|
|
|
@ -85,7 +85,7 @@ public class DevToolsPooledDataSourceAutoConfigurationTests
|
|
|
|
|
ConfigurableApplicationContext context = createContext("org.h2.Driver",
|
|
|
|
|
"jdbc:h2:mem:test", DataSourceAutoConfiguration.class,
|
|
|
|
|
DataSourceSpyConfiguration.class);
|
|
|
|
|
Statement statement = configureDataSourceBehaviour(
|
|
|
|
|
Statement statement = configureDataSourceBehavior(
|
|
|
|
|
context.getBean(DataSource.class));
|
|
|
|
|
context.close();
|
|
|
|
|
verify(statement, times(1)).execute("SHUTDOWN");
|
|
|
|
@ -96,7 +96,7 @@ public class DevToolsPooledDataSourceAutoConfigurationTests
|
|
|
|
|
ConfigurableApplicationContext context = createContext("org.hsqldb.jdbcDriver",
|
|
|
|
|
"jdbc:hsqldb:hsql://localhost", DataSourceAutoConfiguration.class,
|
|
|
|
|
DataSourceSpyConfiguration.class);
|
|
|
|
|
Statement statement = configureDataSourceBehaviour(
|
|
|
|
|
Statement statement = configureDataSourceBehavior(
|
|
|
|
|
context.getBean(DataSource.class));
|
|
|
|
|
context.close();
|
|
|
|
|
verify(statement, times(0)).execute("SHUTDOWN");
|
|
|
|
@ -107,7 +107,7 @@ public class DevToolsPooledDataSourceAutoConfigurationTests
|
|
|
|
|
ConfigurableApplicationContext context = createContext("org.hsqldb.jdbcDriver",
|
|
|
|
|
"jdbc:hsqldb:mem:test", DataSourceAutoConfiguration.class,
|
|
|
|
|
DataSourceSpyConfiguration.class);
|
|
|
|
|
Statement statement = configureDataSourceBehaviour(
|
|
|
|
|
Statement statement = configureDataSourceBehavior(
|
|
|
|
|
context.getBean(DataSource.class));
|
|
|
|
|
context.close();
|
|
|
|
|
verify(statement, times(1)).execute("SHUTDOWN");
|
|
|
|
@ -118,7 +118,7 @@ public class DevToolsPooledDataSourceAutoConfigurationTests
|
|
|
|
|
ConfigurableApplicationContext context = createContext(
|
|
|
|
|
"org.apache.derby.jdbc.ClientDriver", "jdbc:derby://localhost",
|
|
|
|
|
DataSourceAutoConfiguration.class, DataSourceSpyConfiguration.class);
|
|
|
|
|
Statement statement = configureDataSourceBehaviour(
|
|
|
|
|
Statement statement = configureDataSourceBehavior(
|
|
|
|
|
context.getBean(DataSource.class));
|
|
|
|
|
context.close();
|
|
|
|
|
verify(statement, times(0)).execute("SHUTDOWN");
|
|
|
|
@ -129,7 +129,7 @@ public class DevToolsPooledDataSourceAutoConfigurationTests
|
|
|
|
|
ConfigurableApplicationContext context = createContext(
|
|
|
|
|
"org.apache.derby.jdbc.EmbeddedDriver", "jdbc:derby:memory:test",
|
|
|
|
|
DataSourceAutoConfiguration.class, DataSourceSpyConfiguration.class);
|
|
|
|
|
Statement statement = configureDataSourceBehaviour(
|
|
|
|
|
Statement statement = configureDataSourceBehavior(
|
|
|
|
|
context.getBean(DataSource.class));
|
|
|
|
|
context.close();
|
|
|
|
|
verify(statement, times(1)).execute("SHUTDOWN");
|
|
|
|
|