Package com.tinkerpop.blueprints.impls.tg

Examples of com.tinkerpop.blueprints.impls.tg.TinkerGraph$TinkerKeyIndex


        assertEquals(vertex.getProperty("name"), "marko");
    }

    public void testSetProperties() {
        Graph graph = new TinkerGraph();
        Vertex vertex = graph.addVertex(null);
        Map map = new HashMap();
        map.put("name", "pierre");
        ElementHelper.setProperties(vertex, map);
        assertEquals(vertex.getPropertyKeys().size(), 1);
        assertEquals(vertex.getProperty("name"), "pierre");
View Full Code Here



    }

    public void testSetPropertiesVarArgs() {
        Graph graph = new TinkerGraph();
        Vertex vertex = graph.addVertex(null);
        ElementHelper.setProperties(vertex, "name", "pierre");
        assertEquals(vertex.getPropertyKeys().size(), 1);
        assertEquals(vertex.getProperty("name"), "pierre");

        ElementHelper.setProperties(vertex, "name", "dewilde", "country", "belgium", "age", 50);
View Full Code Here

        }

    }

  public void testAreEqualNullFirstArg() {
    Graph graph = new TinkerGraph();
    Vertex vertex = graph.addVertex(null);

    ElementHelper.areEqual(null, vertex);
  }
View Full Code Here

    ElementHelper.areEqual(null, vertex);
  }

  public void testAreEqualNullSecondArg() {
    Graph graph = new TinkerGraph();
    Vertex vertex = graph.addVertex(null);

    ElementHelper.areEqual(vertex, null);
  }
View Full Code Here

    ElementHelper.areEqual(vertex, null);
  }

  public void testAreEqualValid() {
    Graph graph = new TinkerGraph();
    Vertex vertex = graph.addVertex(null);

    ElementHelper.areEqual(vertex, vertex);
  }
View Full Code Here

    ElementHelper.areEqual(vertex, vertex);
  }

  public void testAreEqualInvalid() {
    Graph graph = new TinkerGraph();
    Vertex vertex1 = graph.addVertex(null);
    Vertex vertex2 = graph.addVertex(null);

    ElementHelper.areEqual(vertex2, vertex1);
  }
View Full Code Here

* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
public class IndexableGraphHelperTest extends BaseTest {

    public void testAddUniqueVertex() {
        IndexableGraph graph = new TinkerGraph();
        Vertex marko = graph.addVertex(0);
        marko.setProperty("name", "marko");
        Index<Vertex> index = graph.createIndex("txIdx", Vertex.class);
        index.put("name", "marko", marko);
        Vertex vertex = IndexableGraphHelper.addUniqueVertex(graph, null, index, "name", "marko");
        assertEquals(vertex.getProperty("name"), "marko");
        assertEquals(vertex, graph.getVertex(0));
        assertEquals(count(graph.getVertices()), 1);
        assertEquals(count(graph.getEdges()), 0);

        vertex = IndexableGraphHelper.addUniqueVertex(graph, null, index, "name", "darrick");
        assertEquals(vertex.getProperty("name"), "darrick");
        assertEquals(count(graph.getVertices()), 2);
        assertEquals(vertex.getId(), "1");
    }
View Full Code Here

    public Graph generateGraph() {
        return generateGraph("");
    }

    public Graph generateGraph(final String graphDirectoryName) {
        return new EventIndexableGraph<TinkerGraph>(new TinkerGraph());
    }
View Full Code Here

        Vertex v = graph.addVertex(null);
        assertEquals("vertex1", v.getId());
    }

    public void testUnsupportCustomVertexOrEdgeIds() throws Exception {
        TinkerGraph baseGraph = new TinkerGraph();
        IdGraph<TinkerGraph> graph = new IdGraph<TinkerGraph>(baseGraph, true, false);

        IdGraph.IdFactory vFactory = new IdGraph.IdFactory() {
            private int count = 0;
View Full Code Here

    public Graph generateGraph() {
        return generateGraph("");
    }

    public Graph generateGraph(final String graphDirectoryName) {
        return new IdGraph<TinkerGraph>(new TinkerGraph());
    }
View Full Code Here

TOP

Related Classes of com.tinkerpop.blueprints.impls.tg.TinkerGraph$TinkerKeyIndex

Copyright © 2018 www.massapicom. 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.