Package com.tinkerpop.blueprints

Examples of com.tinkerpop.blueprints.Graph.addVertex()


  public void testGetEdgesWithTargetVertex() throws Exception {
    Graph graph = graphTest.generateGraph();

    OrientVertex v1 = (OrientVertex) graph.addVertex(null);
    OrientVertex v2 = (OrientVertex) graph.addVertex(null);
    OrientVertex v3 = (OrientVertex) graph.addVertex(null);
    v1.addEdge("targets", v2);
    v1.addEdge("targets", v3);

    Assert.assertEquals(1, count(v1.getEdges(v2, Direction.OUT, "targets")));
    Assert.assertEquals(0, count(v1.getEdges(v2, Direction.IN, "targets")));
View Full Code Here


    shipping.put("name", "Posten MyPack");
    shipping.put("code", "postenmypack");
    shipping.put("templateName", "POSTENMYPACK");
    shipping.put("rates", new ArrayList());

    final Vertex v = graph.addVertex(null);
    v.setProperty("weight", 20);
    v.setProperty("height", 20);
    v.setProperty("consigneeAddress", consignee);
    v.setProperty("width", 10);
    v.setProperty("sum", 400);
View Full Code Here

    public void testSparkseeVertexLabel() throws Exception {
        Graph graph = graphTest.generateGraph();
        ((SparkseeGraph) graph).typeScope.set(true);
        this.stopWatch();

        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals(SparkseeGraph.DEFAULT_SPARKSEE_VERTEX_LABEL));
        ((SparkseeGraph) graph).label.set("people");
        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals("people"));
        ((SparkseeGraph) graph).label.set("thing");
        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals("thing"));
        assertTrue(graph.addVertex("whatever").getProperty(StringFactory.LABEL).equals("thing"));
View Full Code Here

        ((SparkseeGraph) graph).typeScope.set(true);
        this.stopWatch();

        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals(SparkseeGraph.DEFAULT_SPARKSEE_VERTEX_LABEL));
        ((SparkseeGraph) graph).label.set("people");
        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals("people"));
        ((SparkseeGraph) graph).label.set("thing");
        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals("thing"));
        assertTrue(graph.addVertex("whatever").getProperty(StringFactory.LABEL).equals("thing"));
        ((SparkseeGraph) graph).label.set(null);
        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals(SparkseeGraph.DEFAULT_SPARKSEE_VERTEX_LABEL));
View Full Code Here

        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals(SparkseeGraph.DEFAULT_SPARKSEE_VERTEX_LABEL));
        ((SparkseeGraph) graph).label.set("people");
        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals("people"));
        ((SparkseeGraph) graph).label.set("thing");
        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals("thing"));
        assertTrue(graph.addVertex("whatever").getProperty(StringFactory.LABEL).equals("thing"));
        ((SparkseeGraph) graph).label.set(null);
        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals(SparkseeGraph.DEFAULT_SPARKSEE_VERTEX_LABEL));

        ((SparkseeGraph) graph).label.set("mylabel");
View Full Code Here

        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals(SparkseeGraph.DEFAULT_SPARKSEE_VERTEX_LABEL));
        ((SparkseeGraph) graph).label.set("people");
        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals("people"));
        ((SparkseeGraph) graph).label.set("thing");
        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals("thing"));
        assertTrue(graph.addVertex("whatever").getProperty(StringFactory.LABEL).equals("thing"));
        ((SparkseeGraph) graph).label.set(null);
        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals(SparkseeGraph.DEFAULT_SPARKSEE_VERTEX_LABEL));

        ((SparkseeGraph) graph).label.set("mylabel");
        Vertex v1 = graph.addVertex("mylabel");
View Full Code Here

        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals("people"));
        ((SparkseeGraph) graph).label.set("thing");
        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals("thing"));
        assertTrue(graph.addVertex("whatever").getProperty(StringFactory.LABEL).equals("thing"));
        ((SparkseeGraph) graph).label.set(null);
        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals(SparkseeGraph.DEFAULT_SPARKSEE_VERTEX_LABEL));

        ((SparkseeGraph) graph).label.set("mylabel");
        Vertex v1 = graph.addVertex("mylabel");
        boolean excep = false;
        try {
View Full Code Here

        assertTrue(graph.addVertex("whatever").getProperty(StringFactory.LABEL).equals("thing"));
        ((SparkseeGraph) graph).label.set(null);
        assertTrue(graph.addVertex(null).getProperty(StringFactory.LABEL).equals(SparkseeGraph.DEFAULT_SPARKSEE_VERTEX_LABEL));

        ((SparkseeGraph) graph).label.set("mylabel");
        Vertex v1 = graph.addVertex("mylabel");
        boolean excep = false;
        try {
            v1.setProperty(StringFactory.LABEL, "otherlabel");
        } catch (IllegalArgumentException e) {
            excep = true;
View Full Code Here

        final String doTest = System.getProperty("testRexsterGraph", "true");
        if (doTest.equals("true")) {
            final Graph g = graphTest.generateGraph();
            ((RexsterGraphTest) graphTest).resetGraph();

            final Vertex v = g.addVertex(null);
            v.setProperty("test", "déja-vu");

            Assert.assertEquals("déja-vu", g.getVertex(v.getId()).getProperty("test"));
        }
    }
View Full Code Here

        final String doTest = System.getProperty("testRexsterGraph", "true");
        if (doTest.equals("true")) {
            final Graph g = graphTest.generateGraph();
            ((RexsterGraphTest) graphTest).resetGraph();

            final Vertex v = g.addVertex(null);
            v.setProperty("test", "(sometext)");

            Assert.assertEquals("(sometext)", g.getVertex(v.getId()).getProperty("test"));
        }
    }
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.