use of io.bootique.BQRuntime in project bootique-jdbc by bootique.
the class TableMatcherIT method setupDB.
@BeforeClass
public static void setupDB() {
BQRuntime runtime = TEST_FACTORY.app("-c", "classpath:io/bootique/jdbc/test/matcher/TableMatcherIT.yml").autoLoadModules().createRuntime();
DatabaseChannel channel = DatabaseChannel.get(runtime);
channel.execStatement().exec("CREATE TABLE \"t1\" (\"c1\" INT, \"c2\" VARCHAR(10), \"c3\" VARCHAR(10))");
channel.execStatement().exec("CREATE TABLE \"t2\" (\"c1\" INT, \"c2\" INT, \"c3\" DATE, \"c4\" TIMESTAMP)");
channel.execStatement().exec("CREATE TABLE \"t3\" (\"c1\" INT, \"c2\" VARCHAR (10) FOR BIT DATA)");
T1 = channel.newTable("t1").columnNames("c1", "c2", "c3").initColumnTypesFromDBMetadata().build();
T2 = channel.newTable("t2").columnNames("c1", "c2", "c3", "c4").initColumnTypesFromDBMetadata().build();
T3 = channel.newTable("t3").columnNames("c1", "c2").initColumnTypesFromDBMetadata().build();
}
use of io.bootique.BQRuntime in project bootique-jdbc by bootique.
the class TomcatInstrumentedJdbcModuleIT method testMetrics.
@Test
public void testMetrics() {
BQRuntime runtime = TEST_FACTORY.app("-c", "classpath:io/bootique/jdbc/instrumented/dummy-ds.yml").autoLoadModules().createRuntime();
DataSourceFactory factory = runtime.getInstance(DataSourceFactory.class);
DataSource dataSource = factory.forName("DerbyDatabaseIT");
assertNotNull(dataSource);
MetricRegistry metricRegistry = runtime.getInstance(MetricRegistry.class);
assertNotEquals(metricRegistry.getGauges().size(), 0);
}
use of io.bootique.BQRuntime in project bootique-jdbc by bootique.
the class InstrumentedJdbcModuleProviderTest method testModuleDeclaresDependencies.
@Test
public void testModuleDeclaresDependencies() {
final BQRuntime bqRuntime = testFactory.app().module(new InstrumentedJdbcModuleProvider()).createRuntime();
BQRuntimeChecker.testModulesLoaded(bqRuntime, JdbcModule.class, HealthCheckModule.class);
}
use of io.bootique.BQRuntime in project bootique-jdbc by bootique.
the class TomcatJdbcModuleIT method testDataSource.
@Test
public void testDataSource() {
BQRuntime runtime = testFactory.app("-c", "classpath:TomcatJdbcModuleIT_full.yml").autoLoadModules().createRuntime();
DataSource ds = runtime.getInstance(DataSourceFactory.class).forName("derby1");
assertNotNull(ds);
assertTrue(ds instanceof org.apache.tomcat.jdbc.pool.DataSource);
org.apache.tomcat.jdbc.pool.DataSource tomcatDS = (org.apache.tomcat.jdbc.pool.DataSource) ds;
assertEquals("jdbc:derby:target/derby1;create=true", tomcatDS.getUrl());
assertEquals("sa", tomcatDS.getUsername());
assertEquals(0, tomcatDS.getInitialSize());
assertEquals(1, tomcatDS.getMinIdle());
assertEquals(3, tomcatDS.getMaxIdle());
assertEquals(6, tomcatDS.getMaxActive());
}
use of io.bootique.BQRuntime in project bootique-jdbc by bootique.
the class TomcatJdbcModuleProviderIT method testModuleDeclaresDependencies.
@Test
public void testModuleDeclaresDependencies() {
final BQRuntime bqRuntime = testFactory.app().module(new TomcatJdbcModuleProvider()).createRuntime();
BQRuntimeChecker.testModulesLoaded(bqRuntime, TomcatJdbcModule.class, JdbcModule.class);
}
Aggregations