use of com.orientechnologies.orient.console.OConsoleDatabaseApp in project orientdb by orientechnologies.
the class OGremlinConsoleTest method testGraphMLImport.
@Test
public void testGraphMLImport() {
final String INPUT_FILE = "src/test/resources/graph-example-2.xml";
String dbUrl = "memory:testGraphMLImport";
StringBuilder builder = new StringBuilder();
builder.append("create database " + dbUrl + ";\n");
builder.append("import database " + INPUT_FILE + ";\n");
OConsoleDatabaseApp console = new TestOGremlinConsole(new String[] { builder.toString() });
try {
console.run();
ODatabaseDocumentTx db = new ODatabaseDocumentTx(dbUrl);
db.open("admin", "admin");
try {
List<ODocument> result = db.query(new OSQLSynchQuery<ODocument>("select from V"));
Assert.assertFalse(result.isEmpty());
result = db.query(new OSQLSynchQuery<ODocument>("select from V where name is null"));
Assert.assertEquals(1, result.size());
} finally {
db.close();
}
} finally {
console.close();
}
}
Aggregations