Examples of endNode()


Examples of org.neo4j.graphdb.Path.endNode()

        System.out.println("pathData = " + pathData);
        Path path = RestPathParser.parse(pathData, restApi);
        assertEquals(0,path.length());
        assertEquals(null,path.lastRelationship());
        assertEquals(0,path.startNode().getId());
        assertEquals(0,path.endNode().getId());
    }
    @Test
    public void testParsePath() throws Exception {
        RestAPI restApi = new RestAPIImpl(URI);
        Map<String,Object> node = node(0);
View Full Code Here

Examples of org.neo4j.graphdb.Path.endNode()

        System.out.println("pathData = " + pathData);
        Path path = RestPathParser.parse(pathData, restApi);
        assertEquals(1,path.length());
        assertEquals(1,path.lastRelationship().getId());
        assertEquals(0,path.startNode().getId());
        assertEquals(1,path.endNode().getId());
    }

    private Map<String, Object> node(int id) {
        return MapUtil.map("data", Collections.EMPTY_MAP, "self", nodeUrl(id));
    }
View Full Code Here

Examples of org.neo4j.graphdb.Path.endNode()

        path.put("end", node2);
        Path result = (Path)converter.convertToResultType(path, new TypeInformation(Path.class));

        assertEquals(SimplePath.class, result.getClass());
        assertEquals(1, result.startNode().getId());
        assertEquals(2, result.endNode().getId());
        assertEquals(1, result.lastRelationship().getId());
    }


    @Test
View Full Code Here

Examples of org.neo4j.graphdb.Path.endNode()

        if ( !visitor.hasNext() )
        {
            return null;
        }
        Path position = visitor.next();
        Visit visit = visits.get( position.endNode() );
        if ( visit != null )
        {
            if ( visitor != visit.visitor )
            {
                return new Path[] { visit.position, position };
View Full Code Here

Examples of org.neo4j.graphdb.Path.endNode()

                return new Path[] { visit.position, position };
            }
        }
        else
        {
            visits.put( position.endNode(), new Visit( position, visitor ) );
        }
        return null;
    }

    private static class Visit
View Full Code Here

Examples of org.neo4j.graphdb.Path.endNode()

        Iterable<Path> paths = finder.findAllPaths( startNode, endNode );
        // END SNIPPET: shortestPathUsage
        Path path = paths.iterator().next();
        assertEquals( 2, path.length() );
        assertEquals( startNode, path.startNode() );
        assertEquals( endNode, path.endNode() );
        Iterator<Node> iterator = path.nodes().iterator();
        iterator.next();
        assertEquals( middleNode1, iterator.next() );
    }
View Full Code Here

Examples of org.springframework.data.neo4j.support.path.NodePath.endNode()

        EntityPath<Person, Person> entityPath = new ConvertingEntityPath<Person, Person>(path, neo4jTemplate);

        Assert.assertEquals("start entity",michael, entityPath.startEntity());
        Assert.assertEquals("start node",node, path.startNode());
        Assert.assertEquals("end entity",michael, entityPath.endEntity());
        Assert.assertEquals("end node",node, path.endNode());
        Assert.assertNull("no relationship", entityPath.lastRelationshipEntity());
        Assert.assertNull("no relationship", path.lastRelationship());

        // todo all 6 iterators
    }
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.