Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1456 0bbf6a3ef -> 1f70b434b


added more test cases to SubgraphStrategyProcessTest and cleanedup 
SubgraphStrategy a bit.


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

Branch: refs/heads/TINKERPOP-1456
Commit: 1f70b434b459c088c4be20d1bf9b126e31eda72c
Parents: 0bbf6a3
Author: Marko A. Rodriguez <okramma...@gmail.com>
Authored: Wed Sep 21 15:18:48 2016 -0600
Committer: Marko A. Rodriguez <okramma...@gmail.com>
Committed: Wed Sep 21 15:18:48 2016 -0600

----------------------------------------------------------------------
 .../traversal/strategy/decoration/SubgraphStrategy.java      | 8 +++-----
 .../strategy/decoration/SubgraphStrategyProcessTest.java     | 6 ++++++
 2 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1f70b434/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
----------------------------------------------------------------------
diff --git 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
index 7551d14..d961209 100644
--- 
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
+++ 
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
@@ -307,13 +307,11 @@ public final class SubgraphStrategy extends 
AbstractTraversalStrategy<TraversalS
                             propertyValueStep.addLabel(label);
                         }
                         if ('v' == propertyType) {
-                            final Traversal.Admin<?, ?> temp = 
nonCheckPropertyCriterion.clone();
                             TraversalHelper.insertAfterStep(propertyValueStep, 
propertiesStep, traversal);
-                            TraversalHelper.insertTraversal(propertiesStep, 
temp, traversal);
+                            TraversalHelper.insertTraversal(propertiesStep, 
nonCheckPropertyCriterion.clone(), traversal);
                         } else {
-                            final Step filterStep = 
checkPropertyCriterion.clone();
-                            TraversalHelper.insertAfterStep(filterStep, 
propertiesStep, traversal);
-                            TraversalHelper.insertAfterStep(propertyValueStep, 
filterStep, traversal);
+                            TraversalHelper.insertAfterStep(propertyValueStep, 
propertiesStep, traversal);
+                            
TraversalHelper.insertAfterStep(checkPropertyCriterion.clone(), propertiesStep, 
traversal);
                         }
                     }
                 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1f70b434/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategyProcessTest.java
----------------------------------------------------------------------
diff --git 
a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategyProcessTest.java
 
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategyProcessTest.java
index fe50d20..f61aedb 100644
--- 
a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategyProcessTest.java
+++ 
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategyProcessTest.java
@@ -30,6 +30,7 @@ import 
org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilte
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
 import org.apache.tinkerpop.gremlin.structure.Column;
 import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -405,6 +406,11 @@ public class SubgraphStrategyProcessTest extends 
AbstractGremlinProcessTest {
         sg = 
create(SubgraphStrategy.build().edges(__.<Edge>hasLabel("uses").has("skill", 
5)).create());
         checkResults(Arrays.asList(5, 5, 5), 
sg.V().outE().valueMap().select(Column.values).unfold());
         checkResults(Arrays.asList(5, 5, 5), 
sg.V().outE().propertyMap().select(Column.values).unfold().value());
+        //
+        sg = 
create(SubgraphStrategy.build().vertexProperties(__.hasNot("skill")).create());
+        checkResults(Arrays.asList(3, 3, 3, 4, 4, 5, 5, 5), 
sg.V().outE("uses").values("skill"));
+        checkResults(Arrays.asList(3, 3, 3, 4, 4, 5, 5, 5), 
sg.V().as("a").properties().select("a").dedup().outE().values("skill"));
+        checkResults(Arrays.asList(3, 3, 3, 4, 4, 5, 5, 5), 
sg.V().as("a").properties().select("a").outE().properties("skill").as("b").dedup().select("b").by(__.value()));
     }
 
 

Reply via email to