tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [20/44] tinkerpop git commit: added more test cases to SubgraphStrategyProcessTest and cleanedup SubgraphStrategy a bit.
Date Wed, 28 Sep 2016 16:57:18 GMT
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/8e2c38d4
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8e2c38d4
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8e2c38d4

Branch: refs/heads/TINKERPOP-944
Commit: 8e2c38d4bf890b8c251b8ea571cb0c0c6273cf17
Parents: 548f662
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Wed Sep 21 15:18:48 2016 -0600
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Tue Sep 27 12:45:49 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/8e2c38d4/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/8e2c38d4/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()));
     }
 
 


Mime
View raw message