Esempio n. 1
0
 public void testAddToResultCreateOneRelation() {
   Node mag = getCloud().getNodeManager("mags").createNode();
   mag.commit();
   Node news = getCloud().getNodeManager("news").createNode();
   news.commit();
   NodeQuery q =
       Queries.createRelatedNodesQuery(
           mag, getCloud().getNodeManager("news"), "posrel", "destination");
   NodeList result = Queries.addToResult(q, news);
   assertEquals(1, result.size());
 }
Esempio n. 2
0
 public void testAddToResultCreateTwoRelations() {
   Node mag = getCloud().getNodeManager("mags").createNode();
   mag.commit();
   Node news = getCloud().getNodeManager("news").createNode();
   news.commit();
   Node url = getCloud().getNodeManager("urls").createNode();
   url.commit();
   NodeQuery q =
       Queries.createRelatedNodesQuery(
           mag, getCloud().getNodeManager("news"), "posrel", "destination");
   Queries.addPath(q, "posrel,urls", "destination");
   Queries.addStartNodes(q, "" + url.getNumber());
   NodeList result = Queries.addToResult(q, news);
   assertEquals(2, result.size());
 }