App { public static void loadData(Graph graph) { final Vertex marko = graph.addVertex(T.id, 1, T.label, "person", "name", "marko", "age", 29); final Vertex vadas = graph.addVertex(T.id, 2, T.label, "person", "name", "vadas", "age", 27); final Vertex lop = graph.addVertex(T.id, 3, T.label, "software", "name", "lop", "lang", "java"); final Vertex josh = graph.addVertex(T.id, 4, T.label, "person", "name", "josh", "age", 32); final Vertex ripple = graph.addVertex(T.id, 5, T.label, "software", "name", "ripple", "lang", "java"); final Vertex peter = graph.addVertex(T.id, 6, T.label, "person", "name", "peter", "age", 35); marko.addEdge("knows", vadas, T.id, 7, "weight", 0.5d); marko.addEdge("knows", josh, T.id, 8, "weight", 1.0d); marko.addEdge("created", lop, T.id, 9, "weight", 0.4d); josh.addEdge("created", ripple, T.id, 10, "weight", 1.0d); josh.addEdge("created", lop, T.id, 11, "weight", 0.4d); peter.addEdge("created", lop, T.id, 12, "weight", 0.2d); }  static void main(String[] args); static Vertex findByName(GraphTraversalSource g, String name); static List calculateShortestPathBetween(GraphTraversalSource g, Vertex fromNode, Vertex toNode); static void loadData(Graph graph);  }
@Test public void shouldCreateGraph() { TinkerGraph graph = TinkerGraph.open(); App.loadData(graph); GraphTraversalSource g = graph.traversal(); assertEquals(6, g.V().count().next().intValue()); assertEquals(6, g.E().count().next().intValue()); }