tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [26/50] tinkerpop git commit: Got ComplexTest setup for @dkuppitz to go to town on. I don't think we need to include a GroovyComplexTest because @spmallette is doing the work for master/ that gets rid of the need for gremlin-groovy-test and thus, no need
Date Wed, 07 Dec 2016 20:02:49 GMT
Got ComplexTest setup for @dkuppitz to go to town on. I don't think we need to include a GroovyComplexTest
because @spmallette is doing the work for master/ that gets rid of the need for gremlin-groovy-test
and thus, no need to waste the energy/time on GroovyComplexTest.


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

Branch: refs/heads/TINKERPOP-1490
Commit: e01aa721fd13e6cb6591aa3f54314071e118a087
Parents: 9e82b4d
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Mon Nov 28 15:49:08 2016 -0700
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Mon Nov 28 15:49:08 2016 -0700

----------------------------------------------------------------------
 .../gremlin/process/ProcessComputerSuite.java   |   6 +-
 .../gremlin/process/ProcessStandardSuite.java   |   4 +-
 .../process/traversal/step/ComplexTest.java     | 104 +++++++++++++++++++
 3 files changed, 111 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e01aa721/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
index 63c6e68..1d69a76 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
@@ -27,10 +27,11 @@ import org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.Pee
 import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankVertexProgramTest;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionComputerTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.ComplexTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.ChooseTest;
-import org.apache.tinkerpop.gremlin.process.traversal.step.branch.OptionalTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.LocalTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.branch.OptionalTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.RepeatTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.UnionTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.AndTest;
@@ -86,8 +87,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffect
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.StoreTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SubgraphTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.TreeTest;
-import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategyProcessTest;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
@@ -185,6 +186,7 @@ public class ProcessComputerSuite extends AbstractGremlinSuite {
             TreeTest.Traversals.class,
 
             // compliance
+            ComplexTest.Traversals.class,
             TraversalInterruptionComputerTest.class,
 
             // algorithms

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e01aa721/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
index c574601..5f469e0 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java
@@ -22,6 +22,7 @@ import org.apache.tinkerpop.gremlin.AbstractGremlinSuite;
 import org.apache.tinkerpop.gremlin.process.traversal.CoreTraversalTest;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.ComplexTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.ChooseTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.LocalTest;
@@ -80,11 +81,11 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffect
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.StoreTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SubgraphTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.TreeTest;
-import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategyProcessTest;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite;
@@ -174,6 +175,7 @@ public class ProcessStandardSuite extends AbstractGremlinSuite {
             TreeTest.Traversals.class,
 
             // compliance
+            ComplexTest.Traversals.class,
             CoreTraversalTest.class,
             TraversalInterruptionTest.class,
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e01aa721/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java
new file mode 100644
index 0000000..a33276f
--- /dev/null
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java
@@ -0,0 +1,104 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.tinkerpop.gremlin.process.traversal.step;
+
+import org.apache.tinkerpop.gremlin.LoadGraphWith;
+import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
+import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner;
+import org.apache.tinkerpop.gremlin.process.traversal.Order;
+import org.apache.tinkerpop.gremlin.process.traversal.P;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet;
+import org.apache.tinkerpop.gremlin.structure.Column;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.select;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+@RunWith(GremlinProcessRunner.class)
+public abstract class ComplexTest extends AbstractGremlinProcessTest {
+
+    public abstract Traversal<Vertex, String> getClassicRecommendation();
+
+    @Test
+    @LoadGraphWith(LoadGraphWith.GraphData.GRATEFUL)
+    public void classicRecommendation() {
+        final Traversal<Vertex, String> traversal = getClassicRecommendation();
+        printTraversalForm(traversal);
+        checkResults(Arrays.asList("LET IT GROW", "UNCLE JOHNS BAND", "I KNOW YOU RIDER",
"SHIP OF FOOLS", "GOOD LOVING"), traversal);
+        final List<Map<String, Object>> list = new ArrayList<>(traversal.asAdmin().getSideEffects().<BulkSet<Map<String,
Object>>>get("m"));
+        assertEquals(5, list.size());
+        assertFalse(traversal.hasNext());
+        assertEquals("LET IT GROW", list.get(0).get("x"));
+        assertEquals(276, list.get(0).get("y"));
+        assertEquals(21L, list.get(0).get("z"));
+        //
+        assertEquals("UNCLE JOHNS BAND", list.get(1).get("x"));
+        assertEquals(332, list.get(1).get("y"));
+        assertEquals(20L, list.get(1).get("z"));
+        //
+        assertEquals("I KNOW YOU RIDER", list.get(2).get("x"));
+        assertEquals(550, list.get(2).get("y"));
+        assertEquals(20L, list.get(2).get("z"));
+        //
+        assertEquals("SHIP OF FOOLS", list.get(3).get("x"));
+        assertEquals(225, list.get(3).get("y"));
+        assertEquals(18L, list.get(3).get("z"));
+        //
+        assertEquals("GOOD LOVING", list.get(4).get("x"));
+        assertEquals(428, list.get(4).get("y"));
+        assertEquals(18L, list.get(4).get("z"));
+        //
+        checkSideEffects(traversal.asAdmin().getSideEffects(), "m", BulkSet.class, "stash",
BulkSet.class);
+
+    }
+
+    public static class Traversals extends ComplexTest {
+
+        @Override
+        public Traversal<Vertex, String> getClassicRecommendation() {
+            return g.V().has("name", "DARK STAR").as("a").out("followedBy").aggregate("stash").
+                    in("followedBy").where(P.neq("a").and(P.not(P.within("stash")))).
+                    groupCount().
+                    unfold().
+                    project("x", "y", "z").
+                    by(select(Column.keys).values("name")).
+                    by(select(Column.keys).values("performances")).
+                    by(select(Column.values)).
+                    order().
+                    by(select("z"), Order.decr).
+                    by(select("y"), Order.incr).
+                    limit(5).store("m").select("x");
+        }
+
+    }
+}
+


Mime
View raw message