use of org.janusgraph.core.schema.JanusGraphManagement in project janusgraph by JanusGraph.
the class ManagementTest method testReservedNamesRejectedForEdgeLabels.
@Test
public void testReservedNamesRejectedForEdgeLabels() {
for (String s : ILLEGAL_USER_DEFINED_NAMES) {
JanusGraphManagement tm = graph.openManagement();
try {
tm.makeEdgeLabel(s);
Assert.fail("Edge label \"" + s + "\" must be rejected");
} catch (IllegalArgumentException e) {
log.debug("Caught expected exception", e);
} finally {
tm.commit();
}
}
}
use of org.janusgraph.core.schema.JanusGraphManagement in project janusgraph by JanusGraph.
the class EdgeSerializerTest method testValueOrdering.
@Test
public void testValueOrdering() {
StandardJanusGraph graph = (StandardJanusGraph) StorageSetup.getInMemoryGraph();
JanusGraphManagement management = graph.openManagement();
management.makeEdgeLabel("father").multiplicity(Multiplicity.MANY2ONE).make();
for (int i = 1; i <= 5; i++) management.makePropertyKey("key" + i).dataType(Integer.class).make();
management.commit();
JanusGraphVertex v1 = graph.addVertex(), v2 = graph.addVertex();
JanusGraphEdge e1 = v1.addEdge("father", v2);
for (int i = 1; i <= 5; i++) e1.property("key" + i, i);
graph.tx().commit();
e1.remove();
graph.tx().commit();
}
Aggregations