tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davebs...@apache.org
Subject [18/37] tinkerpop git commit: merged NotStep fix and tests from tp31. CTR.
Date Fri, 07 Oct 2016 14:36:46 GMT
merged NotStep fix and tests from tp31. CTR.


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

Branch: refs/heads/TINKERPOP-1458
Commit: 8ab682fef3e3da12904cb0d825abf4cc1ba8235a
Parents: bc00bb3 c7f42d8
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Mon Oct 3 10:55:41 2016 -0600
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Mon Oct 3 10:55:41 2016 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                 |  1 +
 .../process/traversal/step/filter/NotStep.java     |  7 +++++++
 .../traversal/step/map/GroovyMatchTest.groovy      | 10 ++++++++++
 .../process/traversal/step/map/MatchTest.java      | 17 +++++++++++++++++
 4 files changed, 35 insertions(+)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ab682fe/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/NotStep.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ab682fe/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMatchTest.groovy
----------------------------------------------------------------------
diff --cc gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMatchTest.groovy
index b35b763,b3d8ea9..f953e91
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMatchTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMatchTest.groovy
@@@ -336,27 -336,17 +336,37 @@@ public abstract class GroovyMatchTest 
               g.V.match(
                      __.as('a').both.as('b'),
                      __.as('b').both.as('c')).dedup('a','b').by(label)
 -            """, g)
 +            """)
 +        }
 +
 +        @Override
 +        public Traversal<Vertex, Long> get_g_V_hasLabelXsongsX_matchXa_name_b__a_performances_cX_selectXb_cX_count()
{
 +            new ScriptTraversal<>(g, "gremlin-groovy", """
 +             g.V.hasLabel('song').match(
 +                    __.as('a').values('name').as('b'),
 +                    __.as('a').values('performances').as('c')
 +            ).select('b', 'c').count();
 +            """)
 +        }
 +
 +        @Override
 +        public Traversal<Vertex, Long> get_g_V_matchXa_knows_count_bX_selectXbX()
{
 +            new ScriptTraversal<>(g, "gremlin-groovy", "g.V.match(__.as('a').out('knows').count.as('b')).select('b')")
 +        }
 +
 +        @Override
 +        public Traversal<Vertex, String> get_g_V_matchXa_knows_b__b_created_c__a_created_cX_dedupXa_b_cX_selectXaX_byXnameX()
{
 +            new ScriptTraversal<>(g, "gremlin-groovy", "g.V.match(__.as('a').out('knows').as('b'),
__.as('b').out('created').as('c'), __.as('a').out('created').as('c')).dedup('a', 'b', 'c').select('a').by('name')")
          }
+ 
+         @Override
+         public Traversal<Vertex, String> get_g_V_notXmatchXa_age_b__a_name_cX_whereXb_eqXcXX_selectXaXX_name()
{
 -            TraversalScriptHelper.compute("""
++            new ScriptTraversal<>(g, "gremlin-groovy", """
+                 g.V.not(match(
+                             __.as('a').age.as('b'),
+                             __.as('a').name.as('c')).
+                         where('b', eq('c')).select('a')).name
+             """, g)
+         }
      }
  }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ab682fe/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchTest.java
----------------------------------------------------------------------
diff --cc gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchTest.java
index 508968a,46b8e59..ce60734
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchTest.java
@@@ -146,16 -143,11 +147,20 @@@ public abstract class MatchTest extend
      // distinct values with by()-modulation
      public abstract Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_both_b__b_both_cX_dedupXa_bX_byXlabelX();
  
 +    public abstract Traversal<Vertex, Long> get_g_V_hasLabelXsongsX_matchXa_name_b__a_performances_cX_selectXb_cX_count();
 +
 +    // reducing barrier on lazy standard shouldn't yield an empty barrier
 +    public abstract Traversal<Vertex, Long> get_g_V_matchXa_knows_count_bX_selectXbX();
 +
 +    // verifying keep labels and dedup labels interactions
 +    public abstract Traversal<Vertex, String> get_g_V_matchXa_knows_b__b_created_c__a_created_cX_dedupXa_b_cX_selectXaX_byXnameX();
 +
+     // test not(match)
+     public abstract Traversal<Vertex, String> get_g_V_notXmatchXa_age_b__a_name_cX_whereXb_eqXcXX_selectXaXX_name();
+ 
      @Test
      @LoadGraphWith(MODERN)
++
      public void g_V_valueMap_matchXa_selectXnameX_bX() {
          final Traversal<Vertex, Map<String, Object>> traversal = get_g_V_valueMap_matchXa_selectXnameX_bX();
          printTraversalForm(traversal);
@@@ -519,33 -496,13 +524,40 @@@
      }
  
      @Test
 +    @LoadGraphWith(GRATEFUL)
 +    public void g_V_hasLabelXsongsX_matchXa_name_b__a_performances_cX_selectXb_cX_count()
{
 +        final Traversal<Vertex, Long> traversal = get_g_V_hasLabelXsongsX_matchXa_name_b__a_performances_cX_selectXb_cX_count();
 +        printTraversalForm(traversal);
 +        assertEquals(584, traversal.next().longValue());
 +        assertFalse(traversal.hasNext());
 +    }
 +
 +    @Test
 +    @LoadGraphWith(MODERN)
 +    public void g_V_matchXa_knows_count_bX_selectXbX() {
 +        final Traversal<Vertex, Long> traversal = get_g_V_matchXa_knows_count_bX_selectXbX();
 +        printTraversalForm(traversal);
 +        checkResults(Arrays.asList(0L, 0L, 0L, 0L, 0L, 2L), traversal);
 +        assertFalse(traversal.hasNext());
 +    }
 +
 +    @Test
 +    @LoadGraphWith(MODERN)
 +    public void g_V_matchXa_knows_b__b_created_c__a_created_cX_dedupXa_b_cX_selectXaX_byXnameX()
{
 +        final Traversal<Vertex, String> traversal = get_g_V_matchXa_knows_b__b_created_c__a_created_cX_dedupXa_b_cX_selectXaX_byXnameX();
 +        printTraversalForm(traversal);
 +        assertEquals("marko", traversal.next());
 +        assertFalse(traversal.hasNext());
 +    }
 +
 +
+     @LoadGraphWith(MODERN)
+     public void g_V_notXmatchXa_age_b__a_name_cX_whereXb_eqXcXX_selectXaXX_name() {
+         final Traversal<Vertex, String> traversal = get_g_V_notXmatchXa_age_b__a_name_cX_whereXb_eqXcXX_selectXaXX_name();
+         printTraversalForm(traversal);
+         checkResults(Arrays.asList("marko", "peter", "josh", "vadas", "lop", "ripple"),
traversal);
+     }
+ 
      public static class GreedyMatchTraversals extends Traversals {
          @Before
          public void setupTest() {
@@@ -804,24 -761,8 +816,29 @@@
          }
  
          @Override
 +        public Traversal<Vertex, Long> get_g_V_hasLabelXsongsX_matchXa_name_b__a_performances_cX_selectXb_cX_count()
{
 +            return g.V().hasLabel("song").match(
 +                    __.as("a").values("name").as("b"),
 +                    __.as("a").values("performances").as("c")
 +            ).select("b", "c").count();
 +        }
 +
 +        @Override
 +        public Traversal<Vertex, Long> get_g_V_matchXa_knows_count_bX_selectXbX()
{
 +            return g.V().match(as("a").out("knows").count().as("b")).select("b");
 +        }
 +
 +        @Override
 +        public Traversal<Vertex, String> get_g_V_matchXa_knows_b__b_created_c__a_created_cX_dedupXa_b_cX_selectXaX_byXnameX()
{
 +            return g.V().match(
 +                    as("a").out("knows").as("b"),
 +                    as("b").out("created").as("c"),
 +                    as("a").out("created").as("c")).dedup("a", "b", "c").<String>select("a").by("name");
 +        }
++
++        @Override
+         public Traversal<Vertex, String> get_g_V_notXmatchXa_age_b__a_name_cX_whereXb_eqXcXX_selectXaXX_name()
{
+             return g.V().not(match(__.as("a").values("age").as("b"), __.as("a").values("name").as("c")).where("b",
eq("c")).select("a")).values("name");
+         }
      }
  }


Mime
View raw message