Examples of Traverser


Examples of org.neo4j.graphdb.traversal.Traverser

       * get the number of all heroes that are connected to the heroes collection node
       * @throws Exception
       */
      @Test
      public void checkNumberOfHeroes() throws Exception {                        
          Traverser heroesTraverser = getHeroesViaRest();
          int numberOfHeroes = 0;             
          for ( Path heroPath : heroesTraverser ) {         
            numberOfHeroes++;                
          }
        
View Full Code Here

Examples of org.neo4j.graphdb.traversal.Traverser

       * check if different REST Traversals for all heroes return the same
       * @throws Exception
       */
      @Test
      public void checkTraverseByPropertiesRest() throws Exception {       
          Traverser heroesTraverserRest = getHeroesViaRest();
          Traverser heroesTraverserByPropertiesRest = getHeroesByNodePropertiesViaRest();
          assertEquals( heroesTraverserRest.nodes().iterator().next(), heroesTraverserByPropertiesRest.nodes().iterator().next() );
      }
View Full Code Here

Examples of org.neo4j.graphdb.traversal.Traverser

       * check if rest traversal and traversal via the collection node return the same result
       * @throws Exception
       */
      @Test
      public void checkTraverseByCollectionNode() throws Exception {       
          Traverser heroesTraverserRest = getHeroesViaRest();
          Traverser heroesTraverserByCollection = getHeroesByCollectionNodeViaRest();
          assertEquals( heroesTraverserRest.nodes().iterator().next(), heroesTraverserByCollection.nodes().iterator().next() );
      }     
View Full Code Here

Examples of org.neo4j.graphdb.traversal.Traverser

            * @throws Exception
            */
           @Test
           public void getNeoFriends() throws Exception {
               Node neoNode = mdg.getNeoNode();            
               Traverser friendsTraverser = getFriends( neoNode );
               int numberOfFriends = 0;             
               for ( Path friendPath : friendsTraverser ) {              
                   numberOfFriends++;                
               }
             
View Full Code Here

Examples of org.neo4j.graphdb.traversal.Traverser

            * get the number of all heroes that are connected to the heroes collection node
            * @throws Exception
            */
           @Test
           public void checkNumberOfHeroes() throws Exception {                        
               Traverser heroesTraverser = getHeroes();
               int numberOfHeroes = 0;             
               for ( Path heroPath : heroesTraverser ) {              
                 numberOfHeroes++;                
               }
             
View Full Code Here

Examples of org.neo4j.graphdb.traversal.Traverser

           @Test
           public void compareIndexAndTraversal() throws Exception {
             IndexManager index = graphDb.index();            
             Index<Node> goodGuys = index.forNodes("heroes");
             IndexHits<Node> hits = goodGuys.query( "name", "*" );           
             Traverser heroesTraverser = getHeroes();              
               assertEquals( heroesTraverser.nodes().iterator().next().getId(), hits.iterator().next().getId() );
           }
View Full Code Here

Examples of org.neo4j.graphdb.traversal.Traverser

           }
          
          
           @Test
           public void checkTraverseByProperties() throws Exception {       
               Traverser heroesTraverser = getHeroes();
               Traverser heroesTraverserByProperties = getHeroesByNodeProperties();
               assertEquals( heroesTraverser.nodes().iterator().next(), heroesTraverserByProperties.nodes().iterator().next() );
           }
View Full Code Here

Examples of org.neo4j.graphdb.traversal.Traverser

            * @throws Exception
            */
           @Test
           public void findCypher() throws Exception{
             Node neoNode = mdg.getNeoNode();             
               Traverser friendsTraverser = getFriends( neoNode );
               boolean foundCypher = false;
               for ( Path friendPath : friendsTraverser ) {               
                 if (friendPath.endNode().getProperty("name").equals("Cypher")){
                   foundCypher = true;
                   break;
View Full Code Here

Examples of org.neo4j.graphdb.traversal.Traverser

            */
           @Test
           public void getMatrixHackers() throws Exception
           {

                   Traverser traverser = findHackers( mdg.getNeoNode() );
                   int numberOfHackers = 0;
                   for ( Path hackerPath : traverser ) {
                       numberOfHackers++;
                   }
                   assertEquals( 1, numberOfHackers );
View Full Code Here

Examples of org.neo4j.graphdb.traversal.Traverser

    @Test
    public void testTraverseToNeighbour() {
        final Relationship rel = relationship();
        final TraversalDescription traversalDescription = RestTraversal.description().maxDepth(1).breadthFirst();
        System.out.println("traversalDescription = " + traversalDescription);
        final Traverser traverser = traversalDescription.traverse(rel.getStartNode());
        final Iterable<Node> nodes = traverser.nodes();
        Assert.assertEquals(rel.getEndNode(), nodes.iterator().next());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.