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/ef3eceed Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ef3eceed Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ef3eceed Branch: refs/heads/TINKERPOP-1784 Commit: ef3eceed25ce440575d595c0ce93cef2f6be5a1b Parents: be24724 Author: Stephen Mallette <sp...@genoprime.com> Authored: Fri Oct 20 15:13:06 2017 -0400 Committer: Stephen Mallette <sp...@genoprime.com> Committed: Thu Oct 26 13:14:37 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/ef3eceed/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/ef3eceed/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