Search in sources :

Example 1 with DatabaseChannel

use of io.bootique.jdbc.test.DatabaseChannel in project bootique-jdbc by bootique.

the class CsvDataSetBuilderIT method setupDB.

@BeforeClass
public static void setupDB() {
    BQRuntime runtime = TEST_FACTORY.app("--config=classpath:io/bootique/jdbc/test/dataset/CsvDataSetBuilderIT.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)");
    channel.execStatement().exec("CREATE TABLE \"t4\" (\"c1\" INT, \"c2\" BOOLEAN)");
    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();
    T4 = channel.newTable("t4").columnNames("c1", "c2").initColumnTypesFromDBMetadata().build();
}
Also used : DatabaseChannel(io.bootique.jdbc.test.DatabaseChannel) BQRuntime(io.bootique.BQRuntime) BeforeClass(org.junit.BeforeClass)

Example 2 with DatabaseChannel

use of io.bootique.jdbc.test.DatabaseChannel in project bootique-jdbc by bootique.

the class CsvDataSetBuilderTest method before.

@Before
public void before() {
    DatabaseChannel mockChannel = mock(DatabaseChannel.class);
    table = Table.builder(mockChannel, "t_t").columns(new Column("c1", Types.VARCHAR), new Column("c2", Types.INTEGER), new Column("c3", Types.VARBINARY)).build();
}
Also used : DatabaseChannel(io.bootique.jdbc.test.DatabaseChannel) Column(io.bootique.jdbc.test.Column) Before(org.junit.Before)

Example 3 with DatabaseChannel

use of io.bootique.jdbc.test.DatabaseChannel 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();
}
Also used : DatabaseChannel(io.bootique.jdbc.test.DatabaseChannel) BQRuntime(io.bootique.BQRuntime) BeforeClass(org.junit.BeforeClass)

Aggregations

DatabaseChannel (io.bootique.jdbc.test.DatabaseChannel)3 BQRuntime (io.bootique.BQRuntime)2 BeforeClass (org.junit.BeforeClass)2 Column (io.bootique.jdbc.test.Column)1 Before (org.junit.Before)1