Search in sources :

Example 6 with MultiDataBaseQueries

use of org.obeonetwork.dsl.database.reverse.utils.MultiDataBaseQueries 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);
}
Also used : MultiDataBaseQueries(org.obeonetwork.dsl.database.reverse.utils.MultiDataBaseQueries) DataSource(org.obeonetwork.dsl.database.reverse.source.DataSource) DataBase(org.obeonetwork.dsl.database.DataBase) Test(org.junit.Test)

Example 7 with MultiDataBaseQueries

use of org.obeonetwork.dsl.database.reverse.utils.MultiDataBaseQueries 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);
}
Also used : MultiDataBaseQueries(org.obeonetwork.dsl.database.reverse.utils.MultiDataBaseQueries) DataSource(org.obeonetwork.dsl.database.reverse.source.DataSource) DataBase(org.obeonetwork.dsl.database.DataBase) Test(org.junit.Test)

Aggregations

DataSource (org.obeonetwork.dsl.database.reverse.source.DataSource)7 MultiDataBaseQueries (org.obeonetwork.dsl.database.reverse.utils.MultiDataBaseQueries)7 Test (org.junit.Test)6 DataBase (org.obeonetwork.dsl.database.DataBase)6 IFile (org.eclipse.core.resources.IFile)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1