tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davebs...@apache.org
Subject [15/37] tinkerpop git commit: added more FilterRankStrategy tests.
Date Fri, 07 Oct 2016 14:36:43 GMT
added more FilterRankStrategy tests.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/68bbae10
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/68bbae10
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/68bbae10

Branch: refs/heads/TINKERPOP-1458
Commit: 68bbae10521350085b60f4dbf8819f06494ff6be
Parents: ff1c384
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Thu Sep 29 15:56:06 2016 -0600
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Mon Oct 3 08:24:17 2016 -0600

----------------------------------------------------------------------
 .../traversal/strategy/optimization/FilterRankingStrategy.java | 2 +-
 .../strategy/optimization/FilterRankingStrategyTest.java       | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/68bbae10/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
index dead668..06726b1 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategy.java
@@ -92,7 +92,7 @@ public final class FilterRankingStrategy extends AbstractTraversalStrategy<Trave
         while(modified) {
             modified = false;
             for (final Step<?, ?> step : traversal.getSteps()) {
-                if (!step.getLabels().isEmpty()) {
+                if (step instanceof FilterStep && !step.getLabels().isEmpty()) {
                     final Step<?, ?> nextStep = step.getNextStep();
                     if (nextStep instanceof FilterStep && !(nextStep instanceof TraversalParent))
{
                         TraversalHelper.copyLabels(step, nextStep, true);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/68bbae10/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
index 52379fd..bd12e34 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/FilterRankingStrategyTest.java
@@ -32,7 +32,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 
-import static org.apache.tinkerpop.gremlin.process.traversal.P.eq;
+import static org.apache.tinkerpop.gremlin.process.traversal.P.neq;
 import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.filter;
 import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.has;
 import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.in;
@@ -80,8 +80,10 @@ public class FilterRankingStrategyTest {
 
         return Arrays.asList(new Object[][]{
                 {__.dedup().order(), __.dedup().order(), Collections.emptyList()},
+                {__.has("name", "marko").as("a").out().as("b").has("age", 32).where("a",
neq("b")), __.has("name", "marko").as("a").out().as("b").has("age", 32).where("a", neq("b")),
Collections.emptyList()},
+                {__.has("name", "marko").as("a").out().has("age", 32).as("b").where("a",
neq("b")), __.has("name", "marko").as("a").out().has("age", 32).as("b").where("a", neq("b")),
Collections.emptyList()},
                 {__.has("name", "marko").has("age", 32).dedup().has("name", "bob").as("a"),
__.has("name", "marko").has("age", 32).dedup().has("name", "bob").as("a"), Collections.emptyList()},
-                {__.has("name", "marko").dedup().as("a").has("age", 32).has("name", "bob").as("b"),
__.has("name", "marko").has("age", 32).dedup().has("name", "bob").as("a","b"), Collections.emptyList()},
+                {__.has("name", "marko").dedup().as("a").has("age", 32).has("name", "bob").as("b"),
__.has("name", "marko").has("age", 32).dedup().has("name", "bob").as("a", "b"), Collections.emptyList()},
                 {__.order().dedup(), __.dedup().order(), Collections.emptyList()},
                 {__.order().as("a").dedup(), __.order().as("a").dedup(), Collections.emptyList()},
                 {__.identity().order().dedup(), __.dedup().order(), Collections.singletonList(IdentityRemovalStrategy.instance())},


Mime
View raw message