Search in sources :

Example 26 with DataBase

use of org.obeonetwork.dsl.database.DataBase 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

DataBase (org.obeonetwork.dsl.database.DataBase)26 Schema (org.obeonetwork.dsl.database.Schema)8 Resource (org.eclipse.emf.ecore.resource.Resource)6 Test (org.junit.Test)6 DataSource (org.obeonetwork.dsl.database.reverse.source.DataSource)6 MultiDataBaseQueries (org.obeonetwork.dsl.database.reverse.utils.MultiDataBaseQueries)6 EObject (org.eclipse.emf.ecore.EObject)5 URI (org.eclipse.emf.common.util.URI)3 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)3 ResourceSetImpl (org.eclipse.emf.ecore.resource.impl.ResourceSetImpl)3 TypesLibrary (org.obeonetwork.dsl.typeslibrary.TypesLibrary)3 ArrayList (java.util.ArrayList)2 IResource (org.eclipse.core.resources.IResource)2 Comparison (org.eclipse.emf.compare.Comparison)2 ISelection (org.eclipse.jface.viewers.ISelection)2 DAnalysisSessionEObject (org.eclipse.sirius.viewpoint.DAnalysisSessionEObject)2 AbstractTable (org.obeonetwork.dsl.database.AbstractTable)2 Table (org.obeonetwork.dsl.database.Table)2 File (java.io.File)1 IOException (java.io.IOException)1