tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkupp...@apache.org
Subject [3/3] tinkerpop git commit: Merge branch 'tp32' into tp33
Date Tue, 22 May 2018 15:45:00 GMT
Merge branch 'tp32' into tp33


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

Branch: refs/heads/tp33
Commit: d975e1917272ea12c019b77f72953345fa59036f
Parents: 3891777 7c70013
Author: Daniel Kuppitz <daniel_kuppitz@hotmail.com>
Authored: Tue May 22 08:44:12 2018 -0700
Committer: Daniel Kuppitz <daniel_kuppitz@hotmail.com>
Committed: Tue May 22 08:44:12 2018 -0700

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 gremlin-test/features/map/Select.feature        | 20 ++++++++++++++++
 .../process/traversal/step/map/SelectTest.java  | 15 ++++++++++++
 .../optimization/TinkerGraphCountStrategy.java  |  2 +-
 .../TinkerGraphCountStrategyTest.java           | 25 ++++++++++++--------
 5 files changed, 52 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d975e191/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d975e191/gremlin-test/features/map/Select.feature
----------------------------------------------------------------------
diff --cc gremlin-test/features/map/Select.feature
index 341a378,1e45a0e..788eda7
--- a/gremlin-test/features/map/Select.feature
+++ b/gremlin-test/features/map/Select.feature
@@@ -516,46 -516,22 +516,66 @@@ Feature: Step - select(
        | d[2].l |
        | d[2].l |
  
 +  Scenario: g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX
 +    Given the modern graph
 +    And the traversal of
 +      """
 +      g.V().as("a").group("m").by().by(__.bothE().count()).barrier().select("m").select(__.select("a"))
 +      """
 +    When iterated to list
 +    Then the result should be unordered
 +      | result |
 +      | d[3].l |
 +      | d[1].l |
 +      | d[3].l |
 +      | d[3].l |
 +      | d[1].l |
 +      | d[1].l |
 +
 +  Scenario: g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX_byXmathX_plus_XX
 +    Given the modern graph
 +    And the traversal of
 +      """
 +      g.V().as("a").group("m").by().by(__.bothE().count()).barrier().select("m").select(__.select("a")).by(__.math("_+_"))
 +      """
 +    When iterated to list
 +    Then the result should be unordered
 +      | result |
 +      | d[6].d |
 +      | d[2].d |
 +      | d[6].d |
 +      | d[6].d |
 +      | d[2].d |
 +      | d[2].d |
 +
 +  Scenario: g_V_asXaX_outXknowsX_asXaX_selectXall_constantXaXX
 +    Given the modern graph
 +    And the traversal of
 +      """
 +      g.V().as("a").out("knows").as("a").select(Pop.all, __.constant("a"))
 +      """
 +    When iterated to list
 +    Then the result should be unordered
 +      | result |
 +      | l[v[marko],v[vadas]] |
 +      | l[v[marko],v[josh]] |
++
+   Scenario: g_V_selectXaX
+     Given the modern graph
+     And the traversal of
+       """
+       g.V().select("a")
+       """
+     When iterated to list
+     Then the result should be empty
+ 
+   Scenario: g_V_selectXaX_count
+     Given the modern graph
+     And the traversal of
+       """
+       g.V().select("a").count()
+       """
+     When iterated to list
+     Then the result should be unordered
+       | result |
+       | d[0].l |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d975e191/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java
----------------------------------------------------------------------
diff --cc gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java
index 72a1872,3d778e4..20eee0f
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java
@@@ -83,12 -83,8 +83,14 @@@ public abstract class SelectTest extend
  
      public abstract Traversal<Vertex, Vertex> get_g_V_chooseXoutE_count_isX0X__asXaX__asXbXX_chooseXselectXaX__selectXaX__selectXbXX();
  
 +    public abstract Traversal<Vertex, Long> get_g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX();
 +
 +    public abstract Traversal<Vertex, Double> get_g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX_byXmathX_plus_XX();
 +
 +    public abstract Traversal<Vertex, List<Vertex>> get_g_V_asXaX_outXknowsX_asXaX_selectXall_constantXaXX();
 +
+     public abstract Traversal<Vertex, Long> get_g_V_selectXaX_count();
+ 
      // below are original back()-tests
  
      public abstract Traversal<Vertex, Vertex> get_g_VX1X_asXhereX_out_selectXhereX(final
Object v1Id);
@@@ -349,31 -348,12 +351,39 @@@
  
      @Test
      @LoadGraphWith(MODERN)
 +    public void g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX()
{
 +        final Traversal<Vertex, Long> traversal = get_g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX();
 +        printTraversalForm(traversal);
 +        checkResults(Arrays.asList(3L, 1L, 3L, 3L, 1L, 1L), traversal);
 +    }
 +
 +    @Test
 +    @LoadGraphWith(MODERN)
 +    public void g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX_byXmathX_plus_XX()
{
 +        final Traversal<Vertex, Double> traversal = get_g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX_byXmathX_plus_XX();
 +        printTraversalForm(traversal);
 +        checkResults(Arrays.asList(6D, 2D, 6D, 6D, 2D, 2D), traversal);
 +    }
 +
 +    @Test
 +    @LoadGraphWith(MODERN)
 +    public void g_V_asXaX_outXknowsX_asXaX_selectXall_constantXaXX() {
 +        final Vertex marko = convertToVertex(graph, "marko");
 +        final Vertex vadas = convertToVertex(graph, "vadas");
 +        final Vertex josh = convertToVertex(graph, "josh");
 +        final Traversal<Vertex, List<Vertex>> traversal = get_g_V_asXaX_outXknowsX_asXaX_selectXall_constantXaXX();
 +        printTraversalForm(traversal);
 +        checkResults(Arrays.asList(Arrays.asList(marko, vadas), Arrays.asList(marko, josh)),
traversal);
 +    }
 +
++    @Test
++    @LoadGraphWith(MODERN)
+     public void g_V_selectXaX_count() {
+         final Traversal<Vertex, Long> traversal = get_g_V_selectXaX_count();
+         printTraversalForm(traversal);
+         assertEquals(0L, traversal.next().longValue());
+     }
+ 
      // below are original back()-tests
  
      @Test
@@@ -756,20 -736,10 +766,25 @@@
          }
  
          @Override
 +        public Traversal<Vertex, Long> get_g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX()
{
 +            return g.V().as("a").group("m").by().by(__.bothE().count()).barrier().select("m").select(__.select("a"));
 +        }
 +
 +        @Override
 +        public Traversal<Vertex, Double> get_g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX_byXmathX_plus_XX()
{
 +            return g.V().as("a").group("m").by().by(__.bothE().count()).barrier().select("m").<Double>select(__.select("a")).by(__.math("_+_"));
 +        }
 +
 +        @Override
 +        public Traversal<Vertex, List<Vertex>> get_g_V_asXaX_outXknowsX_asXaX_selectXall_constantXaXX()
{
 +            return g.V().as("a").out("knows").as("a").select(Pop.all, (Traversal) __.constant("a"));
 +        }
 +
++        @Override
+         public Traversal<Vertex, Long> get_g_V_selectXaX_count() {
+             return g.V().select("a").count();
+         }
+ 
          // below are original back()-tests
  
          @Override


Mime
View raw message