use of org.molgenis.emx2.io.tablestore.TableStoreForCsvInMemory in project molgenis-emx2 by molgenis.
the class TestEmx2Roles method testRolesIO.
@Test
public void testRolesIO() {
// create user roles
schema.addMember("bofke", "Viewer");
TableStore store = new TableStoreForCsvInMemory();
// export
Emx2Members.outputRoles(store, schema);
// empty the database, verify
schema = schema.getDatabase().dropCreateSchema(TestEmx2Roles.class.getSimpleName());
assertEquals(0, schema.getMembers().size());
// import and see if consistent
Emx2Members.inputRoles(store, schema);
List<Member> members = schema.getMembers();
assertEquals("bofke", members.get(0).getUser());
assertEquals("Viewer", members.get(0).getRole());
}
use of org.molgenis.emx2.io.tablestore.TableStoreForCsvInMemory in project molgenis-emx2 by molgenis.
the class TestEmx2Settings method testRolesIO.
@Test
public void testRolesIO() {
// create settings
schema.getMetadata().setSetting("foo", "bar");
// export
TableStore store = new TableStoreForCsvInMemory();
Emx2Settings.outputSettings(store, schema);
// empty the database, verify
schema = schema.getDatabase().dropCreateSchema(TestEmx2Settings.class.getSimpleName());
assertEquals(0, schema.getMetadata().getSettings().size());
// import and see if consistent
Emx2Settings.inputSettings(store, schema);
List<Setting> settings = schema.getMetadata().getSettings();
assertEquals("foo", settings.get(0).key());
assertEquals("bar", settings.get(0).value());
}
Aggregations