You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2015/05/28 18:45:22 UTC

[1/4] incubator-tinkerpop git commit: Applied convertId in IoTest to the expected id. TINKERPOP3-695

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/neo4j-gremlin-apache 9f05bd7af -> 8116e3b24


Applied convertId in IoTest to the expected id. TINKERPOP3-695

Added more javadoc around convertId and its expected implementation approach.


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

Branch: refs/heads/neo4j-gremlin-apache
Commit: d68fa629a3830270e7d872139cb4b833778d01c8
Parents: 66cde14
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu May 28 12:27:12 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu May 28 12:28:34 2015 -0400

----------------------------------------------------------------------
 .../apache/tinkerpop/gremlin/GraphProvider.java | 23 ++++++++++++++++++--
 .../tinkerpop/gremlin/structure/io/IoTest.java  |  9 ++++++--
 2 files changed, 28 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d68fa629/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
index e58c1c4..4c9b27d 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
@@ -153,10 +153,29 @@ public interface GraphProvider {
     public void clear(final Graph graph, final Configuration configuration) throws Exception;
 
     /**
-     * Converts an identifier from a test to an identifier accepted by the Graph instance.  Test that try to
+     * Converts an identifier from a test to an identifier accepted by the {@link Graph} instance.  Test that try to
      * utilize an Element identifier will pass it to this method before usage.  This method should be sure to
-     * consistent in the return value such that calling it with "x" should always return the same transformed
+     * be consistent in the return value such that calling it with "x" should always return the same transformed
      * value.
+     * <p/>
+     * For {@link Graph} implementations that return {@code true} for
+     * {@link Graph.Features.ElementFeatures#supportsUserSuppliedIds()} this method requires some additional thought.
+     * That feature has some interesting ramifications when it comes to certain parts of the test suite.  If that
+     * feature is supported and {@link Graph.Features.ElementFeatures#supportsNumericIds()} is not supported (in
+     * favor of some other data type), then test cases supported in the suite will be reduced.  In such a case,
+     * there are two options to consider.
+     * <ol>
+     *     <li>Make it so that your graph can work with
+     *         {@link Graph.Features.ElementFeatures#supportsUserSuppliedIds()} returning {@link false}. Have it be a
+     *         configuration. Then, create one set of tests to run the suite with that configuration and a different
+     *         set of tests that run the suite in the other configuration.</li>
+     *     <li>Make it so that {@link Graph.Features.ElementFeatures#supportsNumericIds()}  is possible. Convert
+     *         the {@link Number} to {@link String} inside {@link Graph#addVertex(Object...)}.</li>
+     * </ol>
+     * If considering the second option, then this method should be implemented such that it not only returns
+     * consistent values as described above, but that it also apply "meaning" during conversion.  In other words,
+     * if {@code convertId(1, Vertex.class)} is called then this method should ensure that {@code 1} be converted to
+     * the exact same value that it would be converted to if one had called {@code graph.addVertex(T.id, 1)}.
      */
     default public Object convertId(final Object id, final Class<? extends Element> c) {
         return id;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d68fa629/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
index 8be63e9..b641127 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
@@ -30,6 +30,7 @@ import com.fasterxml.jackson.databind.ser.std.StdSerializer;
 import org.apache.commons.configuration.Configuration;
 import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
 import org.apache.tinkerpop.gremlin.FeatureRequirement;
+import org.apache.tinkerpop.gremlin.GraphManager;
 import org.apache.tinkerpop.gremlin.LoadGraphWith;
 import org.apache.tinkerpop.gremlin.TestHelper;
 import org.apache.tinkerpop.gremlin.structure.Direction;
@@ -2357,8 +2358,12 @@ public class IoTest extends AbstractGremlinTest {
         if (g.features().edge().supportsUserSuppliedIds()) {
             if (lossyForId)
                 assertEquals(expected.toString(), e.id().toString());
-            else
-                assertEquals(expected, e.id());
+            else {
+                // we convert the "expected" id via GraphProvider because it is possible that a Graph
+                // (e.g. elastic-gremlin) can supportUserSuppliedIds but internally represent them as a
+                // value other than Numeric (which is what's in all of the test/toy data).
+                assertEquals(GraphManager.getGraphProvider().convertId(expected, Edge.class), e.id());
+            }
         }
     }
 


[4/4] incubator-tinkerpop git commit: Merge branch 'master' into neo4j-gremlin-apache

Posted by ok...@apache.org.
Merge branch 'master' into neo4j-gremlin-apache


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

Branch: refs/heads/neo4j-gremlin-apache
Commit: 8116e3b24219457da968b2023d83490656f89b3d
Parents: 9f05bd7 d68fa62
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu May 28 10:45:29 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu May 28 10:45:29 2015 -0600

----------------------------------------------------------------------
 docs/src/implementations.asciidoc               |  4 ++--
 .../gremlin/console/GremlinGroovysh.groovy      |  2 ++
 .../apache/tinkerpop/gremlin/GraphProvider.java | 23 ++++++++++++++++++--
 .../tinkerpop/gremlin/structure/io/IoTest.java  |  9 ++++++--
 4 files changed, 32 insertions(+), 6 deletions(-)
----------------------------------------------------------------------



[2/4] incubator-tinkerpop git commit: Minor point added to docs about testing implementations.

Posted by ok...@apache.org.
Minor point added to docs about testing implementations.


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

Branch: refs/heads/neo4j-gremlin-apache
Commit: 66cde14bc86c3bd2f40ade561edc9a7397a082dc
Parents: 649de76
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu May 28 12:26:51 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu May 28 12:28:34 2015 -0400

----------------------------------------------------------------------
 docs/src/implementations.asciidoc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/66cde14b/docs/src/implementations.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/implementations.asciidoc b/docs/src/implementations.asciidoc
index eb643e3..e61fefb 100644
--- a/docs/src/implementations.asciidoc
+++ b/docs/src/implementations.asciidoc
@@ -319,7 +319,7 @@ public class XXXGroovyProcessComputerTest {}
 
 The above set of tests represent the minimum test suite set to implement.  There are other "integration" and "performance" tests that should be considered optional.  Implementing those tests requires the same pattern as shown above.
 
-IMPORTANT: It is as important to look at "ignored" tests as it is to look at ones that fail.  The `gremlin-test` suite utilizes the `Feature` implementation exposed by the `Graph` to determine which tests to execute.  If a test utilizes features that are not supported by the graph, it will ignore them.  While that may be fine, implementers should validate that the ignored tests are appropriately bypassed and that there are no mistakes in their feature definitions.
+IMPORTANT: It is as important to look at "ignored" tests as it is to look at ones that fail.  The `gremlin-test` suite utilizes the `Feature` implementation exposed by the `Graph` to determine which tests to execute.  If a test utilizes features that are not supported by the graph, it will ignore them.  While that may be fine, implementers should validate that the ignored tests are appropriately bypassed and that there are no mistakes in their feature definitions.  Moreover, implementers should consider filling gaps in their own test suites, especially when IO-related tests are being ignored.
 
 The only test-class that requires any code investment is the `GraphProvider` implementation class. This class is a used by the test suite to construct `Graph` configurations and instances and provides information about the vendor's implementation itself.  In most cases, it is best to simply extend `AbstractGraphProvider` as it provides many default implementations of the `GraphProvider` interface.
 
@@ -377,7 +377,7 @@ The annotation above shows that the name of each parameterized test will be pref
 
 These annotations help provide users a level of transparency into test suite compliance (via the xref:describe-graph[describeGraph()] utility function). It also allows implementers to have a lot of flexibility in terms of how they wish to support TinkerPop.  For example, maybe there is a single test case that prevents an implementer from claiming support of a `Feature`.  The implementer could choose to either not support the `Feature` or to support it but "opt-out" of the test with a "reason" as to why so that users understand the limitation.
 
-IMPORTANT: Before using `OptOut` be sure that the reason for using it is sound and it is more of a last resort.  It is possible that a test from the suite is doesn't properly represent the expectations of a feature, is too broad or narrow for the semantics it is trying to enforce or simply contains a bug.  Please consider raising issues in the developer mailing list with such concerns before assuming `OptOut` is the only answer.
+IMPORTANT: Before using `OptOut` be sure that the reason for using it is sound and it is more of a last resort.  It is possible that a test from the suite doesn't properly represent the expectations of a feature, is too broad or narrow for the semantics it is trying to enforce or simply contains a bug.  Please consider raising issues in the developer mailing list with such concerns before assuming `OptOut` is the only answer.
 
 IMPORTANT: There are no tests that specifically validate complete compliance with Gremlin Server.  Generally speaking, a `Graph` that passes the full Test Suite, should be compliant with Gremlin Server.  The one area where problems can occur is in serialization.  Always ensure that IO is properly implemented, that custom serializers are tested fully and ultimately integration test the `Graph` with an actual Gremlin Server instance.
 


[3/4] incubator-tinkerpop git commit: Add some javadoc on GremlinGroovysh.

Posted by ok...@apache.org.
Add some javadoc on GremlinGroovysh.


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

Branch: refs/heads/neo4j-gremlin-apache
Commit: 649de7660ff50417269cb2448aef686fdbd4aac9
Parents: 19bc349
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu May 28 09:46:49 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu May 28 12:28:34 2015 -0400

----------------------------------------------------------------------
 .../org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy    | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/649de766/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy
index 0a37d8c..de3911a 100644
--- a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy
+++ b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/GremlinGroovysh.groovy
@@ -22,6 +22,8 @@ import org.codehaus.groovy.tools.shell.Command
 import org.codehaus.groovy.tools.shell.Groovysh
 
 /**
+ * Overrides the posix style parsing of Groovysh allowing for commands to parse prior to Groovy 2.4.x.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 class GremlinGroovysh extends Groovysh {