}
assertEquals(edges.size(), 2);
}
public void testParser4() throws IOException {
FaunusVertex vertex = FaunusGraphSONUtility.fromJSON("{\"_id\":4, \"name\":\"josh\", \"age\":32, \"_outE\":[{\"_inV\":3, \"_label\":\"created\", \"weight\":0.4}, {\"_inV\":5, \"_label\":\"created\", \"weight\":1.0}], \"_inE\":[{\"_outV\":1, \"_label\":\"knows\", \"weight\":1.0}]}");
assertEquals(vertex.getId(), 4l);
assertTrue(vertex.getEdges(OUT).iterator().hasNext());
assertTrue(vertex.getEdges(IN).iterator().hasNext());
assertEquals(vertex.getPropertyKeys().size(), 2);
assertEquals(vertex.getProperty("name"), "josh");
assertEquals(vertex.getProperty("age"), 32);
List<Edge> edges = BaseTest.asList(vertex.getEdges(OUT));
for (final Edge edge : edges) {
assertTrue(edge.getLabel().equals("created"));
}
assertEquals(edges.size(), 2);
edges = BaseTest.asList(vertex.getEdges(IN));
for (final Edge edge : edges) {
assertTrue(edge.getLabel().equals("knows"));
assertEquals(edge.getProperty("weight"), 1);
}
assertEquals(edges.size(), 1);