org.umlg.sqlg.test.gremlincompile.TestGremlinCompileVertexStep Maven / Gradle / Ivy
package org.umlg.sqlg.test.gremlincompile;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.umlg.sqlg.structure.SqlgGraph;
import org.umlg.sqlg.test.BaseTest;
import java.util.List;
import java.util.Map;
/**
* Date: 2015/11/21
* Time: 2:24 PM
*/
public class TestGremlinCompileVertexStep extends BaseTest {
@BeforeClass
public static void beforeClass() {
BaseTest.beforeClass();
if (isPostgres()) {
configuration.addProperty("distributed", true);
}
}
@Test
public void testVertexStep() throws InterruptedException {
Vertex a1 = this.sqlgGraph.addVertex(T.label, "A");
Vertex b1 = this.sqlgGraph.addVertex(T.label, "B");
a1.addEdge("ab", b1);
this.sqlgGraph.tx().commit();
testVertexStep_assert(this.sqlgGraph, a1, b1);
if (this.sqlgGraph1 != null) {
Thread.sleep(SLEEP_TIME);
testVertexStep_assert(this.sqlgGraph1, a1, b1);
}
}
private void testVertexStep_assert(SqlgGraph sqlgGraph, Vertex a1, Vertex b1) {
DefaultGraphTraversal> traversal = (DefaultGraphTraversal>)sqlgGraph.traversal()
.V(a1).as("a").local(__.out().as("b")).select("a", "b");
Assert.assertEquals(3, traversal.getSteps().size());
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy