You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2017/10/20 19:13:39 UTC

[1/2] tinkerpop git commit: TINKERPOP-1784 Added feature tests for or()

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1784 841bcc262 -> 028b1ccb9


TINKERPOP-1784 Added feature tests for or()


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

Branch: refs/heads/TINKERPOP-1784
Commit: 3a0a2e049e9da4d425aa11effe3888769b370ee8
Parents: 841bcc2
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Oct 20 14:06:15 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Oct 20 14:06:15 2017 -0400

----------------------------------------------------------------------
 gremlin-test/features/filter/Or.feature         | 59 ++++++++++++++++++++
 .../gremlin/process/FeatureCoverageTest.java    |  2 +
 2 files changed, 61 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3a0a2e04/gremlin-test/features/filter/Or.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Or.feature b/gremlin-test/features/filter/Or.feature
new file mode 100644
index 0000000..111315a
--- /dev/null
+++ b/gremlin-test/features/filter/Or.feature
@@ -0,0 +1,59 @@
+# 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.
+
+Feature: Step - or()
+
+  Scenario: g_V_orXhasXage_gt_27X__outE_count_gte_2X_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().or(__.has("age", P.gt(27)), __.outE().count().is(P.gte(2l))).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | marko |
+      | josh  |
+      | peter |
+
+  Scenario: g_V_orXoutEXknowsX__hasXlabel_softwareX_or_hasXage_gte_35XX_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().or(__.outE("knows"), __.has(T.label, "software").or().has("age", P.gte(35))).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | marko |
+      | ripple |
+      | lop  |
+      | peter |
+
+  Scenario: g_V_asXaX_orXselectXaX_selectXaXX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").or(__.select("a"), __.select("a"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[marko] |
+      | v[vadas] |
+      | v[lop] |
+      | v[josh] |
+      | v[ripple] |
+      | v[peter]  |
+

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3a0a2e04/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index 97f1fd6..282d8a8 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -24,6 +24,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.branch.OptionalTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CoinTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DropTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.OrTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.PathTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProjectTest;
@@ -75,6 +76,7 @@ public class FeatureCoverageTest {
                 CoinTest.class,
                 DropTest.class,
                 IsTest.class,
+                OrTest.class,
                 // map
                 CountTest.class,
                 PathTest.class,


[2/2] tinkerpop git commit: TINKERPOP-1784 Added feature tests for filter()

Posted by sp...@apache.org.
TINKERPOP-1784 Added feature tests for filter()


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

Branch: refs/heads/TINKERPOP-1784
Commit: 028b1ccb9d177853c54e48319bbc12a98d0c19a5
Parents: 3a0a2e0
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Oct 20 15:13:06 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Oct 20 15:13:06 2017 -0400

----------------------------------------------------------------------
 gremlin-test/features/filter/Filter.feature     | 106 +++++++++++++++++++
 .../gremlin/process/FeatureCoverageTest.java    |   2 +
 2 files changed, 108 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/028b1ccb/gremlin-test/features/filter/Filter.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Filter.feature b/gremlin-test/features/filter/Filter.feature
new file mode 100644
index 0000000..05e7cea
--- /dev/null
+++ b/gremlin-test/features/filter/Filter.feature
@@ -0,0 +1,106 @@
+# 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.
+
+Feature: Step - filter()
+
+  Scenario: g_V_filterXfalseX
+    Given the modern graph
+    And using the parameter l1 defined as "c[false]"
+    And the traversal of
+      """
+      g.V().filter(l1)
+      """
+    When iterated to list
+    Then the result should be empty
+
+  Scenario: g_V_filterXtrueX
+    Given the modern graph
+    And using the parameter l1 defined as "c[true]"
+    And the traversal of
+      """
+      g.V().filter(l1)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[marko] |
+      | v[vadas] |
+      | v[lop] |
+      | v[josh] |
+      | v[ripple] |
+      | v[peter]  |
+
+  Scenario: g_V_filterXlang_eq_javaX
+    Given the modern graph
+    And using the parameter l1 defined as "c[it.get().property('lang').orElse('none').equals('java')]"
+    And the traversal of
+      """
+      g.V().filter(l1)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[ripple] |
+      | v[lop]  |
+
+  Scenario: g_VX1X_out_filterXage_gt_30X
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And using the parameter l1 defined as "c[it.get().property('age').orElse(0) > 30]"
+    And the traversal of
+      """
+      g.V(v1Id).out().filter(l1)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[josh] |
+
+  Scenario: g_V_filterXname_startsWith_m_OR_name_startsWith_pX
+    Given the modern graph
+    And using the parameter l1 defined as "c[{name = it.get().value('name'); name.startsWith('m') || name.startsWith('p')}]"
+    And the traversal of
+      """
+      g.V().filter(l1)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[marko] |
+      | v[peter]  |
+
+  Scenario: g_E_filterXfalseX
+    Given the modern graph
+    And using the parameter l1 defined as "c[false]"
+    And the traversal of
+      """
+      g.E().filter(l1)
+      """
+    When iterated to list
+    Then the result should be empty
+
+  Scenario: g_E_filterXtrueX
+    Given the modern graph
+    And using the parameter l1 defined as "c[true]"
+    And the traversal of
+      """
+      g.E().filter(l1)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | e[marko-created->lop] |
+      | e[marko-knows->josh] |
+      | e[marko-knows->vadas] |
+      | e[peter-created->lop] |
+      | e[josh-created->lop] |
+      | e[josh-created->ripple] |
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/028b1ccb/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index 282d8a8..dba865b 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -23,6 +23,7 @@ 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.filter.CoinTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DropTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.OrTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest;
@@ -75,6 +76,7 @@ public class FeatureCoverageTest {
                 // filter
                 CoinTest.class,
                 DropTest.class,
+                FilterTest.class,
                 IsTest.class,
                 OrTest.class,
                 // map