Пример #1
0
 public void testDefaultEdgePathOrientation() {
   Graph g = new PrimaryGraph();
   Node n1 = g.newNode();
   Node n2 = g.newNode();
   Edge e = g.newEdge(n1, n2);
   Path p = e.asPath();
   assertEquals(n1, p.headNode());
   assertEquals(n2, p.tailNode());
 }
Пример #2
0
 public void testNegativeIndexInSingleEdge() {
   Graph g = new PrimaryGraph();
   Edge e = g.newEdge(g.newNode(), g.newNode());
   assertSame(e.n2(), e.asPath().getNode(-1));
   assertSame(e.n1(), e.asPath().getNode(-2));
 }