package com.tinkerrocks.structure;

import org.apache.commons.configuration.BaseConfiguration;
import org.apache.commons.configuration.Configuration;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.junit.Test;

import java.util.Iterator;


/**
 * Created by ashishn on 8/11/15.
 */
public class RocksTest {
    @Test
    public void addVertexTest() {
        Configuration configuration = new BaseConfiguration();
        RocksGraph graph = new RocksGraph(configuration);

        Vertex marko = graph.addVertex(T.label, "person", T.id, 1, "name", "marko", "age", 29);
        Vertex vadas = graph.addVertex(T.label, "person", T.id, 2, "name", "vadas", "age", 27);
        Vertex lop = graph.addVertex(T.label, "software", T.id, 3, "name", "lop", "lang", "java");
        Vertex josh = graph.addVertex(T.label, "person", T.id, 4, "name", "josh", "age", 32);
        Vertex ripple = graph.addVertex(T.label, "software", T.id, 5, "name", "ripple", "lang", "java");
        Vertex peter = graph.addVertex(T.label, "person", T.id, 6, "name", "peter", "age", 35);


        marko.addEdge("knows", vadas, T.id, 7, "weight", 0.5f);
        marko.addEdge("knows", josh, T.id, 8, "weight", 1.0f);
        marko.addEdge("created", lop, T.id, 9, "weight", 0.4f);


        josh.addEdge("created", ripple, T.id, 10, "weight", 1.0f);
        josh.addEdge("created", lop, T.id, 11, "weight", 0.4f);
        peter.addEdge("created", lop, T.id, 12, "weight", 0.2f);

        Iterator<Vertex> iter = graph.vertices(4);
        while (iter.hasNext()) {
            System.out.println(iter.next().edges(Direction.BOTH).hasNext());
        }
    }
}

@@ -189,25 +189,17 @@
 ructure.
-Direction
+T
 ;%0Aimport
@@ -230,33 +230,38 @@
 emlin.structure.
-T
+Vertex
 ;%0Aimport org.apa
@@ -290,32 +290,40 @@
 structure.Vertex
+Property
 ;%0Aimport org.jun
@@ -1619,17 +1619,16 @@
 ertices(
-4
 );%0A     
@@ -1667,16 +1667,284 @@
         
+Vertex test = iter.next();%0A            Iterator%3CVertexProperty%3CObject%3E%3E properties = test.properties();%0A            while (properties.hasNext()) %7B%0A                System.out.println(%22vertex:%22 + test + %22%5Ctproperties:%22 + properties.next());%0A            %7D%0A%0A            //
 System.o

fix code