use of org.obeonetwork.dsl.database.reverse.source.DataSource in project InformationSystem by ObeoNetwork.
the class DatabaseInfos method getDataSource.
public DataSource getDataSource() {
DataSource dataSource = new DataSource(getDatabase(), getSchema());
dataSource.setJdbcUrl(getUrl());
dataSource.setJdbcUsername(getUser());
dataSource.setJdbcPassword(getPassword());
dataSource.setVendor(getVendor());
return dataSource;
}
use of org.obeonetwork.dsl.database.reverse.source.DataSource in project InformationSystem by ObeoNetwork.
the class TestReverse method testOracle.
@Test
public void testOracle() {
DataSource dataSource = new DataSource("XE", "NORTHWIND");
dataSource.setJdbcUrl("jdbc:oracle:thin:northwind/northwind@//localhost:1521/XE");
dataSource.setJdbcUsername("northwind");
dataSource.setJdbcPassword("northwind");
dataSource.setVendor("Oracle-11g");
DataBase database = DatabaseReverser.reverse(dataSource, new MultiDataBaseQueries(), null);
DataBase databaseRef = loadModel("resources/oracle/outputRef.database", "pathmap://NativeDBTypes/Oracle-11g");
checkEquality(database, databaseRef);
}
use of org.obeonetwork.dsl.database.reverse.source.DataSource in project InformationSystem by ObeoNetwork.
the class TestReverse method testH2Server.
@Test
public void testH2Server() {
String databaseLocation = getH2DatabaseLocation(this.getClass(), "input");
DataSource dataSource = new DataSource("appli1", "PUBLIC");
dataSource.setJdbcUrl("jdbc:h2:tcp://localhost/" + databaseLocation);
dataSource.setJdbcUsername("sa");
dataSource.setVendor("H2-1.3");
DataBase database = DatabaseReverser.reverse(dataSource, new MultiDataBaseQueries(), null);
DataBase databaseRef = loadModel("resources/h2/outputRef.database", "pathmap://NativeDBTypes/H2-1.3");
checkEquality(database, databaseRef);
}
use of org.obeonetwork.dsl.database.reverse.source.DataSource in project InformationSystem by ObeoNetwork.
the class TestReverse method testPostgres.
@Test
public void testPostgres() {
DataSource dataSource = new DataSource("postgres", "public");
dataSource.setJdbcUrl("jdbc:postgresql://localhost:5432/postgres");
dataSource.setJdbcUsername("postgres");
dataSource.setJdbcPassword("admin");
dataSource.setVendor("Postgres-9");
DataBase database = DatabaseReverser.reverse(dataSource, new MultiDataBaseQueries(), null);
DataBase databaseRef = loadModel("resources/postgres/outputRef.database", "pathmap://NativeDBTypes/Postgres-9");
checkEquality(database, databaseRef);
}
Aggregations