Package com.tinkerpop.blueprints.impls.tg

Examples of com.tinkerpop.blueprints.impls.tg.TinkerGraph.addVertex()


        }
    }

    public void testAddEdge() {
        Graph graph = new TinkerGraph();
        Edge edge = GraphHelper.addEdge(graph, null, graph.addVertex(null), graph.addVertex(null), "knows", "weight", 10.0f);
        assertEquals(edge.getProperty("weight"), 10.0f);
        assertEquals(edge.getLabel(), "knows");
        assertEquals(edge.getPropertyKeys().size(), 1);
        assertEquals(count(graph.getVertices()), 2);
        assertEquals(count(graph.getEdges()), 1);
View Full Code Here


        assertEquals(edge.getPropertyKeys().size(), 1);
        assertEquals(count(graph.getVertices()), 2);
        assertEquals(count(graph.getEdges()), 1);

        try {
            edge = GraphHelper.addEdge(graph, null, graph.addVertex(null), graph.addVertex(null), "knows", "weight");
            assertTrue(false);
        } catch (Exception e) {
            assertFalse(false);
            assertEquals(count(graph.getVertices()), 4);
            assertEquals(count(graph.getEdges()), 1);
View Full Code Here

        assertEquals(edge.getPropertyKeys().size(), 1);
        assertEquals(count(graph.getVertices()), 2);
        assertEquals(count(graph.getEdges()), 1);

        try {
            edge = GraphHelper.addEdge(graph, null, graph.addVertex(null), graph.addVertex(null), "knows", "weight");
            assertTrue(false);
        } catch (Exception e) {
            assertFalse(false);
            assertEquals(count(graph.getVertices()), 4);
            assertEquals(count(graph.getEdges()), 1);
View Full Code Here

*/
public class PropertyFilteredIterableTest extends BaseTest {

    public void testBasicFunctionality() {
        TinkerGraph graph = new TinkerGraph();
        Vertex a = graph.addVertex("a");
        a.setProperty("age", 29);
        Vertex b = graph.addVertex("b");
        b.setProperty("age", 29);
        Vertex c = graph.addVertex("c");
        c.setProperty("age", 30);
View Full Code Here

    public void testBasicFunctionality() {
        TinkerGraph graph = new TinkerGraph();
        Vertex a = graph.addVertex("a");
        a.setProperty("age", 29);
        Vertex b = graph.addVertex("b");
        b.setProperty("age", 29);
        Vertex c = graph.addVertex("c");
        c.setProperty("age", 30);
        Vertex d = graph.addVertex("d");
        d.setProperty("age", 31);
View Full Code Here

        TinkerGraph graph = new TinkerGraph();
        Vertex a = graph.addVertex("a");
        a.setProperty("age", 29);
        Vertex b = graph.addVertex("b");
        b.setProperty("age", 29);
        Vertex c = graph.addVertex("c");
        c.setProperty("age", 30);
        Vertex d = graph.addVertex("d");
        d.setProperty("age", 31);

        // throw a vertex without the expected key in the mix
View Full Code Here

        a.setProperty("age", 29);
        Vertex b = graph.addVertex("b");
        b.setProperty("age", 29);
        Vertex c = graph.addVertex("c");
        c.setProperty("age", 30);
        Vertex d = graph.addVertex("d");
        d.setProperty("age", 31);

        // throw a vertex without the expected key in the mix
        Vertex e = graph.addVertex("e");
        List<Vertex> list = Arrays.asList(a, b, c, d, e);
View Full Code Here

        c.setProperty("age", 30);
        Vertex d = graph.addVertex("d");
        d.setProperty("age", 31);

        // throw a vertex without the expected key in the mix
        Vertex e = graph.addVertex("e");
        List<Vertex> list = Arrays.asList(a, b, c, d, e);

        PropertyFilteredIterable<Vertex> iterable = new PropertyFilteredIterable<Vertex>("age", 29, list);
        assertEquals(count(iterable), 2);
        assertEquals(count(iterable), 2);
View Full Code Here

    // cause parse errors for GraphMLReader.
    // However, this happens uncommonly enough that is not yet known which characters those are.
    public void testEncoding() throws Exception {

        Graph g = new TinkerGraph();
        Vertex v = g.addVertex(1);
        v.setProperty("text", "\u00E9");

        GraphMLWriter w = new GraphMLWriter(g);

        File f = File.createTempFile("test", "txt");
View Full Code Here

*/
public class ElementHelperTest extends BaseTest {

    public void testCopyElementProperties() {
        Graph graph = new TinkerGraph();
        Vertex v = graph.addVertex(null);
        v.setProperty("name", "marko");
        v.setProperty("age", 31);
        Vertex u = graph.addVertex(null);
        assertEquals(u.getPropertyKeys().size(), 0);
        ElementHelper.copyProperties(v, u);
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.