Skip to content

Commit

Permalink
refine pattern related ci tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BingqingLyu committed Sep 26, 2023
1 parent a077b0d commit 9f60719
Showing 1 changed file with 20 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,21 @@ public abstract class PatternQueryTest extends AbstractGremlinProcessTest {
public void run_pattern_1_test() {
Traversal<Vertex, Long> traversal = this.get_pattern_1_test();
this.printTraversalForm(traversal);
Assert.assertEquals(155633L, traversal.next().longValue());
Assert.assertEquals(240390L, traversal.next().longValue());
}

@Test
public void run_pattern_2_test() {
Traversal<Vertex, Long> traversal = this.get_pattern_2_test();
this.printTraversalForm(traversal);
Assert.assertEquals(55488L, traversal.next().longValue());
Assert.assertEquals(118209L, traversal.next().longValue());
}

@Test
public void run_pattern_3_test() {
Traversal<Vertex, Long> traversal = this.get_pattern_3_test();
this.printTraversalForm(traversal);
Assert.assertEquals(568408L, traversal.next().longValue());
Assert.assertEquals(1247146L, traversal.next().longValue());
}

@Test
Expand All @@ -91,7 +91,7 @@ public void run_pattern_4_test() {
public void run_pattern_5_test() {
Traversal<Vertex, Long> traversal = this.get_pattern_5_test();
this.printTraversalForm(traversal);
Assert.assertEquals(16291L, traversal.next().longValue());
Assert.assertEquals(5596L, traversal.next().longValue());
}

@Test
Expand All @@ -105,14 +105,14 @@ public void run_pattern_6_test() {
public void run_pattern_7_test() {
Traversal<Vertex, Long> traversal = this.get_pattern_7_test();
this.printTraversalForm(traversal);
Assert.assertEquals(2944L, traversal.next().longValue());
Assert.assertEquals(20858L, traversal.next().longValue());
}

@Test
public void run_pattern_8_test() {
Traversal<Vertex, Long> traversal = this.get_pattern_8_test();
this.printTraversalForm(traversal);
Assert.assertEquals(782347L, traversal.next().longValue());
Assert.assertEquals(1247146L, traversal.next().longValue());
}

@Test
Expand All @@ -126,7 +126,7 @@ public void run_pattern_9_test() {
public void run_pattern_10_test() {
Traversal<Vertex, Long> traversal = this.get_pattern_10_test();
this.printTraversalForm(traversal);
Assert.assertEquals(3019L, traversal.next().longValue());
Assert.assertEquals(11547L, traversal.next().longValue());
}

@Test
Expand Down Expand Up @@ -154,7 +154,7 @@ public void run_pattern_13_test() {
public void run_pattern_14_test() {
Traversal<Vertex, Long> traversal = this.get_pattern_14_test();
this.printTraversalForm(traversal);
Assert.assertEquals(55488L, traversal.next().longValue());
Assert.assertEquals(118209L, traversal.next().longValue());
}

@Test
Expand All @@ -180,7 +180,6 @@ public Traversal<Vertex, Long> get_pattern_1_test() {
__.as("a").out("KNOWS").as("b"),
__.as("b")
.outE("KNOWS")
.has("creationDate", P.gt(20120101000000000L))
.inV()
.as("c"))
.count();
Expand All @@ -193,7 +192,7 @@ public Traversal<Vertex, Long> get_pattern_2_test() {
__.as("a").out("KNOWS").as("b"),
__.as("b")
.hasLabel("PERSON")
.has("creationDate", P.gt(20120101000000000L))
.has("gender", "male")
.out("KNOWS")
.as("c"))
.count();
Expand All @@ -207,9 +206,8 @@ public Traversal<Vertex, Long> get_pattern_3_test() {
__.as("b").out("KNOWS").as("c"),
__.as("c")
.hasLabel("PERSON")
.has("creationDate", P.gt(20120101000000000L))
.has("gender", "male")
.outE("KNOWS")
.has("creationDate", P.gt(20120601000000000L))
.inV()
.as("d"))
.count();
Expand All @@ -230,19 +228,15 @@ public Traversal<Vertex, Long> get_pattern_4_test() {
public Traversal<Vertex, Long> get_pattern_5_test() {
return g.V().match(
__.as("a")
.outE("KNOWS")
.has("creationDate", P.gt(20110101000000000L))
.inV()
.has("gender", "male")
.out("KNOWS")
.as("b"),
__.as("b")
.outE("KNOWS")
.has("creationDate", P.gt(20110101000000000L))
.inV()
.has("gender", "female")
.out("KNOWS")
.as("c"),
__.as("a")
.outE("KNOWS")
.has("creationDate", P.gt(20110101000000000L))
.inV()
.out("KNOWS")
.as("c"))
.count();
}
Expand All @@ -265,16 +259,14 @@ public Traversal<Vertex, Long> get_pattern_7_test() {
return g.V().match(
__.as("a").out("KNOWS").as("b"),
__.as("b")
.has("creationDate", P.gt(20120101000000000L))
.has("gender", "male")
.outE("KNOWS")
.has("creationDate", P.gt(20120201000000000L))
.inV()
.as("c"),
__.as("a").out("KNOWS").as("c"),
__.as("c").out("KNOWS").as("d"),
__.as("b")
.outE("KNOWS")
.has("creationDate", P.gt(20120301000000000L))
.inV()
.as("d"))
.count();
Expand All @@ -290,7 +282,7 @@ public Traversal<Vertex, Long> get_pattern_8_test() {
((IrCustomizedTraversal)
__.as("c")
.hasLabel("PERSON")
.has("creationDate", P.gt(20120101000000000L))
.has("gender", "male")
.out("1..2", "KNOWS"))
.endV()
.as("d"))
Expand All @@ -317,9 +309,8 @@ public Traversal<Vertex, Long> get_pattern_10_test() {
.as("b"),
((IrCustomizedTraversal)
__.as("b")
.has("creationDate", P.gt(20120101000000000L))
.outE("KNOWS")
.has("creationDate", P.gt(20120601000000000L)))
.has("gender", "female")
.outE("KNOWS"))
.inV()
.as("c"),
((IrCustomizedTraversal) __.as("a").out("1..2", "KNOWS"))
Expand Down Expand Up @@ -359,7 +350,7 @@ public Traversal<Vertex, Long> get_pattern_14_test() {
__.as("a").out("KNOWS").as("b"),
__.as("b")
.hasLabel("PERSON")
.has("creationDate", P.gt(20120101000000000L))
.has("gender", "male")
.as("b"),
__.as("b").out("KNOWS").as("c"))
.count();
Expand Down

0 comments on commit 9f60719

Please sign in to comment.