Skip to content

Commit

Permalink
refactor tests to not hard code the path tinkerpop-modern.kryo
Browse files Browse the repository at this point in the history
  • Loading branch information
pieter committed Sep 21, 2016
1 parent af54aae commit c99589d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ release.properties
/.idea
*.iml
src/test/db/
/sqlg-hsqldb/src/test/db/
/sqlg-hsqldb-parent/sqlg-hsqldb/src/test/db/
/sqlg-benchmark-hsqldb/src/test/db/
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
import org.junit.Test;
import org.umlg.sqlg.test.BaseTest;

Expand Down Expand Up @@ -735,8 +734,8 @@ public void testRepeatWithEmitLastWithTimesFirst() {
@Test
public void g_V_repeatXoutX_timesX2X() throws IOException {
final List<Traversal<Vertex, Vertex>> traversals = new ArrayList<>();
loadModern();
Graph graph = this.sqlgGraph;
graph.io(GryoIo.build()).readGraph("../sqlg-test/src/main/resources/tinkerpop-modern.kryo");
assertModernGraph(graph, true, false);

Traversal t = graph.traversal().V().repeat(out()).times(2);
Expand All @@ -756,8 +755,8 @@ public void g_V_repeatXoutX_timesX2X() throws IOException {

@Test
public void g_V_repeatXoutX_timesX2X_path_byXitX_byXnameX_byXlangX() throws IOException {
loadModern();
Graph graph = this.sqlgGraph;
graph.io(GryoIo.build()).readGraph("../sqlg-test/src/main/resources/tinkerpop-modern.kryo");
assertModernGraph(graph, true, false);
final Traversal<Vertex, Path> traversal = graph.traversal().V().repeat(out()).times(2).path().by().by("name").by("lang");
printTraversalForm(traversal);
Expand All @@ -775,8 +774,8 @@ public void g_V_repeatXoutX_timesX2X_path_byXitX_byXnameX_byXlangX() throws IOEx

@Test
public void g_V_repeatXoutX_timesX2X_emit_path() throws IOException {
loadModern();
Graph graph = this.sqlgGraph;
graph.io(GryoIo.build()).readGraph("../sqlg-test/src/main/resources/tinkerpop-modern.kryo");
assertModernGraph(graph, true, false);
GraphTraversalSource g = graph.traversal();
final List<Traversal<Vertex, Path>> traversals = new ArrayList<>();
Expand Down Expand Up @@ -900,8 +899,8 @@ public void testTimesAfterEmitBeforeToSelf() {

@Test
public void g_V_emit_timesX2X_repeatXoutX_path() throws IOException {
loadModern();
Graph graph = this.sqlgGraph;
graph.io(GryoIo.build()).readGraph("../sqlg-test/src/main/resources/tinkerpop-modern.kryo");
GraphTraversalSource g = graph.traversal();
final List<Traversal<Vertex, Path>> traversals = Arrays.asList(
g.V().emit().times(2).repeat(out()).path(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
import org.junit.Test;
import org.umlg.sqlg.test.BaseTest;

Expand Down Expand Up @@ -649,11 +648,11 @@ public void testRepeatWithEmitLastWithTimesFirst() {
@Test
public void g_V_repeatXoutX_timesX2X() throws IOException {
final List<Traversal<Vertex, Vertex>> traversals = new ArrayList<>();
loadModern();
Graph graph = this.sqlgGraph;
graph.io(GryoIo.build()).readGraph("../sqlg-test/src/main/resources/tinkerpop-modern.kryo");
assertModernGraph(graph, true, false);

Traversal t = graph.traversal().V().local(repeat(__.out()).times(2));
Traversal<Vertex, Vertex> t = graph.traversal().V().local(repeat(__.out()).times(2));
traversals.add(t);
traversals.forEach(traversal -> {
printTraversalForm(traversal);
Expand All @@ -670,8 +669,8 @@ public void g_V_repeatXoutX_timesX2X() throws IOException {

@Test
public void g_V_repeatXoutX_timesX2X_path_byXitX_byXnameX_byXlangX() throws IOException {
loadModern();
Graph graph = this.sqlgGraph;
graph.io(GryoIo.build()).readGraph("../sqlg-test/src/main/resources/tinkerpop-modern.kryo");
assertModernGraph(graph, true, false);
final Traversal<Vertex, Path> traversal = graph.traversal().V().local(repeat(__.out()).times(2).path().by().by("name").by("lang"));
printTraversalForm(traversal);
Expand All @@ -689,8 +688,8 @@ public void g_V_repeatXoutX_timesX2X_path_byXitX_byXnameX_byXlangX() throws IOEx

@Test
public void g_V_repeatXoutX_timesX2X_emit_path() throws IOException {
loadModern();
Graph graph = this.sqlgGraph;
graph.io(GryoIo.build()).readGraph("../sqlg-test/src/main/resources/tinkerpop-modern.kryo");
assertModernGraph(graph, true, false);
GraphTraversalSource g = graph.traversal();
final List<Traversal<Vertex, Path>> traversals = new ArrayList<>();
Expand Down Expand Up @@ -814,8 +813,8 @@ public void testTimesAfterEmitBeforeToSelf() {

@Test
public void g_V_emit_timesX2X_repeatXoutX_path() throws IOException {
loadModern();
Graph graph = this.sqlgGraph;
graph.io(GryoIo.build()).readGraph("../sqlg-test/src/main/resources/tinkerpop-modern.kryo");
GraphTraversalSource g = graph.traversal();
final List<Traversal<Vertex, Path>> traversals = Arrays.asList(
g.V().local(__.<Vertex>emit().times(2).repeat(out()).path()),
Expand Down

0 comments on commit c99589d

Please sign in to comment.