@Test void testCloseDataSource() throws Exception { TomcatJdbcDataSourceFactory tomcatJdbcDataSourceFactory = new TomcatJdbcDataSourceFactory(); tomcatJdbcDataSourceFactory.setInitialSize(0); DataSourceInformation dataSourceInformation = new DataSourceInformation( DatabaseType.MYSQL, "localhost", 3306, "test", "user", "password"); DataSource dataSource = tomcatJdbcDataSourceFactory .createDataSource(dataSourceInformation); assertThat(dataSource).isNotNull(); ConnectionPool pool = dataSource.createPool(); assertThat(pool.isClosed()).isFalse(); tomcatJdbcDataSourceFactory.closeDataSource(dataSource); assertThat(pool.isClosed()).isTrue(); }
@Override public void closeDataSource(DataSource dataSource) { if (dataSource instanceof org.apache.tomcat.jdbc.pool.DataSource) { ((org.apache.tomcat.jdbc.pool.DataSource) dataSource).close(); } }
TomcatJdbcDataSourceFactory extends PoolProperties implements DataSourceFactory { @Override public void closeDataSource(DataSource dataSource) { if (dataSource instanceof org.apache.tomcat.jdbc.pool.DataSource) { ((org.apache.tomcat.jdbc.pool.DataSource) dataSource).close(); } } }
TomcatJdbcDataSourceFactory extends PoolProperties implements DataSourceFactory { @Override public void closeDataSource(DataSource dataSource) { if (dataSource instanceof org.apache.tomcat.jdbc.pool.DataSource) { ((org.apache.tomcat.jdbc.pool.DataSource) dataSource).close(); } }  }
TomcatJdbcDataSourceFactory extends PoolProperties implements DataSourceFactory { @Override public void closeDataSource(DataSource dataSource) { if (dataSource instanceof org.apache.tomcat.jdbc.pool.DataSource) { ((org.apache.tomcat.jdbc.pool.DataSource) dataSource).close(); } }  @Override void setUsername(String username); @Override void setPassword(String password); @Override void setDriverClassName(String driverClassName); @Override void setUrl(String url); void setDefaultTransactionIsolationName(String constantName); void setDatabasePlatformSupport(
			DatabasePlatformSupport databasePlatformSupport); @Override org.apache.tomcat.jdbc.pool.DataSource createDataSource(
			DataSourceInformation dataSourceInformation); @Override void closeDataSource(DataSource dataSource); }
TomcatJdbcDataSourceFactory extends PoolProperties implements DataSourceFactory { @Override public void closeDataSource(DataSource dataSource) { if (dataSource instanceof org.apache.tomcat.jdbc.pool.DataSource) { ((org.apache.tomcat.jdbc.pool.DataSource) dataSource).close(); } }  @Override void setUsername(String username); @Override void setPassword(String password); @Override void setDriverClassName(String driverClassName); @Override void setUrl(String url); void setDefaultTransactionIsolationName(String constantName); void setDatabasePlatformSupport(
			DatabasePlatformSupport databasePlatformSupport); @Override org.apache.tomcat.jdbc.pool.DataSource createDataSource(
			DataSourceInformation dataSourceInformation); @Override void closeDataSource(DataSource dataSource);  }