tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [21/31] tinkerpop git commit: TINKERPOP-1857 Full has() test suite for GLVs
Date Wed, 14 Feb 2018 20:34:43 GMT
TINKERPOP-1857 Full has() test suite for GLVs

FeatureCoverageTest now passes for it. Added more consistency to the java test.


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

Branch: refs/heads/TINKERPOP-1857
Commit: b2c79d61c019223a94ac890980955c3b819c4bc1
Parents: 20b10c4
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Thu Dec 28 18:38:24 2017 -0500
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Wed Feb 14 15:34:09 2018 -0500

----------------------------------------------------------------------
 gremlin-test/features/filter/Has.feature        | 160 +++++++++++++++++++
 .../process/traversal/step/filter/HasTest.java  |   2 +-
 2 files changed, 161 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b2c79d61/gremlin-test/features/filter/Has.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Has.feature b/gremlin-test/features/filter/Has.feature
index f3ef5a0..17f2716 100644
--- a/gremlin-test/features/filter/Has.feature
+++ b/gremlin-test/features/filter/Has.feature
@@ -151,6 +151,45 @@ Feature: Step - has()
 
   Scenario: g_VXv2X_hasXage_gt_30X
     Given the modern graph
+    And using the parameter v4Id defined as "v[josh].id"
+    And using the parameter d30 defined as "d[30].i"
+    And the traversal of
+      """
+      g.V(g.V(v4Id).next()).has("age", P.gt(d30))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | v[josh] |
+
+  Scenario: g_VX1X_out_hasXid_lt_3X
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And using the parameter v3Id defined as "v[lop].id"
+    And the traversal of
+      """
+      g.V(v1Id).out().has(T.id, P.lt(v3Id))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | v[vadas] |
+
+  Scenario: g_VX1AsStringX_out_hasXid_2AsStringX
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].sid"
+    And using the parameter v2Id defined as "v[vadas].sid"
+    And the traversal of
+      """
+      g.V(v1Id).out().hasId(v2Id)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | v[vadas] |
+
+  Scenario: g_VX1X_out_hasXid_2X
+    Given the modern graph
     And using the parameter v2 defined as "v[josh]"
     And the traversal of
       """
@@ -174,6 +213,21 @@ Feature: Step - has()
       | result |
       | v[vadas] |
 
+  Scenario: g_VX1X_out_hasXid_2_3X
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And using the parameter v2Id defined as "v[vadas].id"
+    And using the parameter v3Id defined as "v[lop].id"
+    And the traversal of
+      """
+      g.V(v1Id).out().hasId(v2Id, v3Id)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | v[vadas] |
+      | v[lop] |
+
   Scenario: g_VX1X_out_hasXid_2AsString_3AsStringX
     Given the modern graph
     And using the parameter v1Id defined as "v[marko].sid"
@@ -354,6 +408,19 @@ Feature: Step - has()
       | v[josh] |
       | v[peter] |
 
+  Scenario: g_V_both_dedup_properties_hasKeyXageX_value
+    Given the modern graph
+    And the traversal of
+    """
+    g.V().both().properties().dedup().hasKey("age").value()
+    """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | d[29].i |
+      | d[27].i |
+      | d[32].i |
+      | d[35].i |
   Scenario: g_V_hasXage_withinX27X_count
     Given the modern graph
     And the traversal of
@@ -398,3 +465,96 @@ Feature: Step - has()
       | result |
       | d[2].l |
 
+
+  Scenario: g_V_both_dedup_properties_hasKeyXageX_hasValueXgtX30XX_value
+    Given the modern graph
+    And using the parameter d30 defined as "d[30].i"
+    And the traversal of
+    """
+    g.V().both().properties().dedup().hasKey("age").hasValue(P.gt(d30)).value()
+    """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | d[32].i |
+      | d[35].i |
+
+  Scenario: g_V_hasNotXageX_name
+    Given the modern graph
+    And the traversal of
+    """
+    g.V().hasNot("age").values("name")
+    """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | lop |
+      | ripple |
+
+  Scenario: g_V_hasIdX1X_hasIdX2X
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And using the parameter v2Id defined as "v[vadas].id"
+    And the traversal of
+    """
+    g.V().hasId(v1Id).hasId(v2Id)
+    """
+    When iterated to list
+    Then the result should be empty
+
+  Scenario: g_V_hasLabelXpersonX_hasLabelXsoftwareX
+    Given the modern graph
+    And the traversal of
+    """
+    g.V().hasLabel("person").hasLabel("software")
+    """
+    When iterated to list
+    Then the result should be empty
+
+  Scenario: g_V_hasIdXemptyX_count
+    Given the modern graph
+    And using the parameter l defined as "l[]"
+    And the traversal of
+    """
+    g.V().hasId(l).count()
+    """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | d[0].l |
+
+  Scenario: g_V_hasIdXwithinXemptyXX_count
+    Given the modern graph
+    And using the parameter l defined as "l[]"
+    And the traversal of
+    """
+    g.V().hasId(P.within(l)).count()
+    """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | d[0].l |
+
+  Scenario: g_V_hasIdXwithoutXemptyXX_count
+    Given the modern graph
+    And using the parameter l defined as "l[]"
+    And the traversal of
+    """
+    g.V().hasId(P.without(l)).count()
+    """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | d[6].l |
+
+  Scenario: g_V_notXhasIdXwithinXemptyXXX_count
+    Given the modern graph
+    And using the parameter l defined as "l[]"
+    And the traversal of
+    """
+    g.V().not(__.hasId(P.within(l))).count()
+    """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | d[6].l |
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b2c79d61/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
index 9071d7e..deff30b 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
@@ -590,7 +590,7 @@ public abstract class HasTest extends AbstractGremlinProcessTest {
 
         @Override
         public Traversal<Vertex, Vertex> get_g_VXv1X_hasXage_gt_30X(final Object v1Id)
{
-            return g.V(g.V(v1Id).next()).has("age", P.gt(30));
+            return g.V(v1Id).has("age", P.gt(30));
         }
 
         @Override


Mime
View raw message