Esempio n. 1
0
 @Test
 public void testIdPropsToYuml() throws Exception {
   gdb.beginTx();
   gdb.getReferenceNode().setProperty("name", "root");
   final String res = new YumlExport().toYuml(SubGraph.from(gdb), "name");
   System.out.println("res = " + res);
   assertEquals("[root],", res);
 }
Esempio n. 2
0
 @Test
 public void testGraphToYuml() throws Exception {
   gdb.beginTx();
   final Node n1 = gdb.createNode();
   gdb.getReferenceNode().createRelationshipTo(n1, DynamicRelationshipType.withName("REL"));
   final String res = new YumlExport().toYuml(SubGraph.from(gdb));
   assertEquals("[0],[1],[0]REL->[1],", res);
 }
Esempio n. 3
0
 @Test
 public void testNamedGraphToYuml() throws Exception {
   gdb.beginTx();
   gdb.getReferenceNode().setProperty("name", "root");
   final Node n1 = gdb.createNode();
   n1.setProperty("name", "Peter");
   gdb.getReferenceNode().createRelationshipTo(n1, DynamicRelationshipType.withName("PERSON"));
   final Node n2 = gdb.createNode();
   n2.setProperty("name", "Andreas");
   gdb.getReferenceNode().createRelationshipTo(n2, DynamicRelationshipType.withName("PERSON"));
   final Node n3 = gdb.createNode();
   n3.setProperty("name", "Michael");
   gdb.getReferenceNode().createRelationshipTo(n3, DynamicRelationshipType.withName("PERSON"));
   n1.createRelationshipTo(n2, DynamicRelationshipType.withName("FRIEND"));
   n3.createRelationshipTo(n1, DynamicRelationshipType.withName("FRIEND"));
   final String res = new YumlExport().toYuml(SubGraph.from(gdb), "name");
   System.out.println("res = " + res);
   assertEquals(true, res.contains("[Peter]FRIEND->[Andreas],"));
   assertEquals(true, res.contains("[root],[Peter],[Andreas],[Michael],"));
 }