use of org.janusgraph.core.schema.JanusGraphManagement in project aai-aai-common by onap.
the class AAIGraphTest method janusGraphOpenNameTest.
@Test
public void janusGraphOpenNameTest() throws Exception {
JanusGraph graph = JanusGraphFactory.open(new AAIGraphConfig.Builder(AAIConstants.REALTIME_DB_CONFIG).forService(SERVICE_NAME).withGraphType("graphType").buildConfiguration());
JanusGraphManagement graphMgt = graph.openManagement();
String connectionInstanceName = graphMgt.getOpenInstances().stream().filter(c -> c.contains("current")).findFirst().get();
assertThat(connectionInstanceName, matchesPattern("^\\d+_[\\w\\-\\d]+_" + SERVICE_NAME + "_graphType_\\d+\\(current\\)$"));
graphMgt.rollback();
graph.close();
}
use of org.janusgraph.core.schema.JanusGraphManagement in project aai-aai-common by onap.
the class AAIGraphTest method janusGraphOpenNameWithInvalidFilePathTest.
@Test(expected = FileNotFoundException.class)
public void janusGraphOpenNameWithInvalidFilePathTest() throws Exception {
JanusGraph graph = JanusGraphFactory.open(new AAIGraphConfig.Builder("invalid").forService(SERVICE_NAME).withGraphType("graphType").buildConfiguration());
JanusGraphManagement graphMgt = graph.openManagement();
String connectionInstanceName = graphMgt.getOpenInstances().stream().filter(c -> c.contains("current")).findFirst().get();
assertThat(connectionInstanceName, matchesPattern("^\\d+_[\\w\\-\\d]+_" + SERVICE_NAME + "_graphType_\\d+\\(current\\)$"));
graphMgt.rollback();
graph.close();
}
Aggregations