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/11/02 17:38:32 UTC

[35/50] tinkerpop git commit: TINKERPOP-1784 Added sample() feature tests

TINKERPOP-1784 Added sample() feature tests


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

Branch: refs/heads/TINKERPOP-1784
Commit: 6bb26bb05e753bab8ee01baa9093642d9bb095d6
Parents: ca7f4d7
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 24 12:35:59 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Nov 2 13:37:24 2017 -0400

----------------------------------------------------------------------
 gremlin-test/features/filter/Sample.feature | 75 ++++++++++++++++++++++++
 1 file changed, 75 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6bb26bb0/gremlin-test/features/filter/Sample.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Sample.feature b/gremlin-test/features/filter/Sample.feature
new file mode 100644
index 0000000..0f30527
--- /dev/null
+++ b/gremlin-test/features/filter/Sample.feature
@@ -0,0 +1,75 @@
+# 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 - sample()
+
+  Scenario: g_E_sampleX1X
+    Given the modern graph
+    And the traversal of
+      """
+      g.E().sample(1)
+      """
+    When iterated to list
+    Then should have a result count of 1
+
+  Scenario: g_E_sampleX2X_byXweightX
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.E().sample(2).by("weight")
+      """
+    When iterated to list
+    Then should have a result count of 2
+
+  Scenario: g_V_localXoutE_sampleX1X_byXweightXX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().local(__.outE().sample(1).by("weight"))
+      """
+    When iterated to list
+    Then should have a result count of 3
+
+  Scenario: g_V_group_byXlabelX_byXbothE_weight_sampleX2X_foldX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().group().by(T.label).by(__.bothE().values("weight").sample(2).fold())
+      """
+    When iterated to list
+    Then nothing should happen because
+      """
+      The return value of this traversal is a map of samples weights in a list for each key which makes it
+      especially hard to assert with the current test language established and the non-deterministic outcomes
+      of sample().
+      """
+
+  Scenario: g_V_group_byXlabelX_byXbothE_weight_fold_sampleXlocal_5XX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().group().by(T.label).by(__.bothE().values("weight").fold().sample(Scope.local, 5))
+      """
+    When iterated to list
+    Then nothing should happen because
+      """
+      The return value of this traversal is a map of samples weights in a list for each key which makes it
+      especially hard to assert with the current test language established and the non-deterministic outcomes
+      of sample().
+      """
+