use of org.molgenis.emx2.Database in project molgenis-emx2 by molgenis.
the class TestMetaDataIsStoredForNextSessions method testArrayTypesTest.
@Test
public void testArrayTypesTest() {
Schema schema = database.dropCreateSchema(SCHEMA_NAME + "3");
ArrayTypeTestExample.createSimpleTypeTest(schema.getMetadata());
try {
CompareTools.reloadAndCompare(database, schema);
} catch (Exception e) {
fail(e.getMessage());
}
}
use of org.molgenis.emx2.Database in project molgenis-emx2 by molgenis.
the class TestMetaDataIsStoredForNextSessions method testProductComponentsPartsModel.
@Test
public void testProductComponentsPartsModel() {
Schema schema = database.dropCreateSchema(SCHEMA_NAME + "1");
ProductComponentPartsExample.create(schema.getMetadata());
try {
CompareTools.reloadAndCompare(database, schema);
} catch (Exception e) {
fail(e.getMessage());
}
}
use of org.molgenis.emx2.Database in project molgenis-emx2 by molgenis.
the class TestMetaDataIsStoredForNextSessions method testSimpleTypesTest.
@Test
public void testSimpleTypesTest() {
Schema schema = database.dropCreateSchema(SCHEMA_NAME + "2");
SimpleTypeTestExample.createSimpleTypeTest(schema.getMetadata());
try {
CompareTools.reloadAndCompare(database, schema);
} catch (Exception e) {
fail(e.getMessage());
}
}
use of org.molgenis.emx2.Database in project molgenis-emx2 by molgenis.
the class TestSettingsAndMembersLoading method testExcelTypesCast.
@Test
public void testExcelTypesCast() {
Database database = TestDatabaseFactory.getTestDatabase();
Schema schema = database.dropCreateSchema(TestSettingsAndMembersLoading.class.getSimpleName());
ClassLoader classLoader = getClass().getClassLoader();
Path path = new File(classLoader.getResource("settings_and_members.xlsx").getFile()).toPath();
new ImportExcelTask(path, schema, true).run();
assertEquals("key1", schema.getTable("table1").getMetadata().getSettings().get(0).key());
assertEquals("value1", schema.getTable("table1").getMetadata().getSettings().get(0).value());
assertEquals("key2", schema.getMetadata().getSettings().get(0).key());
assertEquals("value2", schema.getMetadata().getSettings().get(0).value());
assertEquals(1, schema.getMembers().size());
assertEquals("anonymous", schema.getMembers().get(0).getUser());
assertEquals("Viewer", schema.getMembers().get(0).getRole());
database.dropSchema(schema.getName());
}
use of org.molgenis.emx2.Database in project molgenis-emx2 by molgenis.
the class RunMolgenisEmx2 method main.
public static void main(String[] args) {
logger.info("Starting MOLGENIS EMX2 Software Version=" + Version.getVersion());
Integer port = (Integer) EnvironmentProperty.getParameter(Constants.MOLGENIS_HTTP_PORT, "8080", INT);
logger.info("with " + org.molgenis.emx2.Constants.MOLGENIS_HTTP_PORT + "=" + port + " (change either via java properties or via ENV variables)");
// setup database
Database db = new SqlDatabase(true);
if (db.getSchema("pet store") == null) {
Schema schema = db.createSchema("pet store");
PetStoreExample.create(schema.getMetadata());
PetStoreExample.populate(schema);
}
// start
MolgenisWebservice.start(port);
}
Aggregations