Skip to content

Commit

Permalink
[GIE Compiler] add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
shirly121 committed Feb 4, 2024
1 parent 355db36 commit 3e53c18
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.junit.Assert;
import org.junit.Test;

import java.util.Map;

public abstract class PatternQueryTest extends AbstractGremlinProcessTest {
public abstract Traversal<Vertex, Long> get_pattern_1_test();

Expand Down Expand Up @@ -60,6 +62,8 @@ public abstract class PatternQueryTest extends AbstractGremlinProcessTest {

public abstract Traversal<Vertex, Long> get_pattern_17_test();

public abstract Traversal<Vertex, Map<Object, Object>> get_g_V_limit_100_group_test();

@Test
public void run_pattern_1_test() {
Traversal<Vertex, Long> traversal = this.get_pattern_1_test();
Expand Down Expand Up @@ -179,6 +183,15 @@ public void run_pattern_17_test() {
Assert.assertEquals(17367L, traversal.next().longValue());
}

@Test
public void run_g_V_limit_100_group_test() {
Traversal<Vertex, Map<Object, Object>> traversal = this.get_g_V_limit_100_group_test();
this.printTraversalForm(traversal);
Map<Object, Object> map = traversal.next();
Assert.assertEquals(100, map.size());
Assert.assertFalse(traversal.hasNext());
}

public static class Traversals extends PatternQueryTest {

// PM1
Expand Down Expand Up @@ -386,5 +399,10 @@ public Traversal<Vertex, Long> get_pattern_17_test() {
.as("b"))
.count();
}

@Override
public Traversal<Vertex, Map<Object, Object>> get_g_V_limit_100_group_test() {
return g.V().hasLabel("PERSON").limit(100).group().by("firstName").by(__.count());
}
}
}

0 comments on commit 3e53c18

Please sign in to comment.