* @author Joshua Shinavier (http://fortytwo.net)
*/
public class IdGraphTest extends GraphTest {
public void testElementClasses() throws Exception {
Graph graph = this.generateGraph();
Vertex v1 = graph.addVertex(null);
Vertex v2 = graph.addVertex(null);
Edge e = graph.addEdge(null, v1, v2, "knows");
assertTrue(v1 instanceof IdVertex);
assertTrue(e instanceof IdEdge);
Iterator<Edge> outE = v1.getEdges(Direction.OUT).iterator();
assertTrue(outE.hasNext());
e = outE.next();
assertTrue(e instanceof IdEdge);
assertTrue(e.getVertex(Direction.IN) instanceof IdVertex);
assertTrue(e.getVertex(Direction.OUT) instanceof IdVertex);
Iterator<Vertex> vertices = graph.getVertices().iterator();
assertTrue(vertices.hasNext());
while (vertices.hasNext()) {
assertTrue(vertices.next() instanceof IdVertex);
}
Iterator<Edge> edges = graph.getEdges().iterator();
assertTrue(edges.hasNext());
while (edges.hasNext()) {
assertTrue(edges.next() instanceof IdEdge);
}
graph.shutdown();
}