use of org.obeonetwork.dsl.database.util.DatabaseResourceFactoryImpl in project InformationSystem by ObeoNetwork.
the class TestReverse method loadModel.
private static DataBase loadModel(String databaseTestPluginRelativePath, String typesLibraryPathmapUri) {
URI uri = URI.createFileURI(databaseTestPluginRelativePath);
DatabaseResourceFactoryImpl databaseResourceFactory = new DatabaseResourceFactoryImpl();
Resource resourceDatabase = databaseResourceFactory.createResource(uri);
TypesLibraryResourceFactoryImpl typesLibraryresourceFactory = new TypesLibraryResourceFactoryImpl();
Resource typeResource = typesLibraryresourceFactory.createResource(URI.createURI(typesLibraryPathmapUri));
ResourceSet rs = new ResourceSetImpl();
rs.getResources().add(resourceDatabase);
rs.getResources().add(typeResource);
try {
Map options = rs.getLoadOptions();
options.put(DatabasePackage.eINSTANCE.getNsURI(), DatabasePackage.eINSTANCE);
options.put(TypesLibraryPackage.eINSTANCE.getNsURI(), TypesLibraryPackage.eINSTANCE);
resourceDatabase.load(options);
} catch (Exception ex) {
ex.printStackTrace();
}
return (DataBase) resourceDatabase.getContents().get(0);
}
use of org.obeonetwork.dsl.database.util.DatabaseResourceFactoryImpl in project InformationSystem by ObeoNetwork.
the class DatabaseCompareAbstractTestSuite method createResourceSet.
/**
* Creates a {@link ResourceSet} properly initialized for Database,
* Dbevolution, EMFCompare and XMI models.
*
* @return
*/
protected static ResourceSet createResourceSet() {
final ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getPackageRegistry().put(DatabasePackage.eNS_URI, DatabasePackage.eINSTANCE);
resourceSet.getPackageRegistry().put(DbevolutionPackage.eNS_URI, DbevolutionPackage.eINSTANCE);
resourceSet.getPackageRegistry().put(ComparePackage.eNS_URI, ComparePackage.eINSTANCE);
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl());
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("dbevolution", new XMIResourceFactoryImpl());
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("database", new DatabaseResourceFactoryImpl());
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("typeslibrary", new XMIResourceFactoryImpl());
return resourceSet;
}
use of org.obeonetwork.dsl.database.util.DatabaseResourceFactoryImpl in project InformationSystem by ObeoNetwork.
the class AbtractTest method standaloneBootStrap.
protected void standaloneBootStrap(ResourceSet resourceSet) {
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new DatabaseResourceFactoryImpl());
resourceSet.getPackageRegistry().put(DatabasePackage.eNS_URI, DatabasePackage.eINSTANCE);
resourceSet.getPackageRegistry().put(DbevolutionPackage.eNS_URI, DbevolutionPackage.eINSTANCE);
}
Aggregations