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 2019/08/13 12:58:58 UTC
[tinkerpop] branch TINKERPOP-2280 created (now fb2b488)
This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a change to branch TINKERPOP-2280
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git.
at fb2b488 TINKERPOP-2280 Changed toString of T
This branch includes the following new commits:
new d92f33e Removed graphson 2.0 radish testing
new fb2b488 TINKERPOP-2280 Changed toString of T
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[tinkerpop] 02/02: TINKERPOP-2280 Changed toString of T
Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch TINKERPOP-2280
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit fb2b48845a7d6b7549d04a11af875126c03252db
Author: Stephen Mallette <sp...@genoprime.com>
AuthorDate: Tue Aug 13 08:56:39 2019 -0400
TINKERPOP-2280 Changed toString of T
Reduce confusion when T is in a Map and users overload property keys that match T instance names like "label" and "id".
---
.../src/main/java/org/apache/tinkerpop/gremlin/structure/T.java | 5 +++++
.../org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java | 3 +++
2 files changed, 8 insertions(+)
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/T.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/T.java
index a836840..0f1a985 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/T.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/T.java
@@ -95,6 +95,11 @@ public enum T implements Function<Element, Object> {
@Override
public abstract Object apply(final Element element);
+ @Override
+ public String toString() {
+ return "T." + name();
+ }
+
public static T fromString(final String accessor) {
if (accessor.equals(LABEL))
return label;
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
index 717e1bc..632a054 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
@@ -33,6 +33,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP;
import org.apache.tinkerpop.gremlin.process.traversal.util.OrP;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Element;
+import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
@@ -182,6 +183,8 @@ public final class GroovyTranslator implements Translator.ScriptTranslator {
return "VertexProperty.Cardinality." + object.toString();
else if (object instanceof TraversalOptionParent.Pick)
return "TraversalOptionParent.Pick." + object.toString();
+ else if (object instanceof T)
+ return "T." + ((T) object).name();
else if (object instanceof Enum)
return ((Enum) object).getDeclaringClass().getSimpleName() + "." + object.toString();
else if (object instanceof Element) {
[tinkerpop] 01/02: Removed graphson 2.0 radish testing
Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch TINKERPOP-2280
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit d92f33e1e21c57401fb4dfbaf63d6f5b2af7f8e5
Author: Stephen Mallette <sp...@genoprime.com>
AuthorDate: Tue Aug 13 08:03:41 2019 -0400
Removed graphson 2.0 radish testing
Realized that we weren't even really testing GraphSON 2.0. It was hardcoded to graphson 3.0 for the vast majority of the tests. When I enabled GraphSON 2.0 tests i started getting test failures. I don't think they were failures in the sense that 2.0 doesn't work but more like the test semantics weren't properly setup for 2.0 serialization expectations. Anyway, disabling these tests for now until the issue can be resolved. CTR
---
gremlin-python/pom.xml | 9 +--------
gremlin-python/src/main/jython/radish/terrain.py | 22 ++++++++++------------
2 files changed, 11 insertions(+), 20 deletions(-)
diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml
index 8c5922d..b08a42d 100644
--- a/gremlin-python/pom.xml
+++ b/gremlin-python/pom.xml
@@ -424,14 +424,7 @@ limitations under the License.
failonerror="true">
<env key="PYTHONPATH" value=""/>
<env key="PYTHONIOENCODING" value="utf-8:surrogateescape"/>
- <arg line="-f dots -e -t -b ${project.build.directory}/python2/radish ${project.basedir}/../gremlin-test/features/ --user-data="graphson=v2""/> <!-- -no-line-jump -->
- </exec>
- <!-- run for graphson 3.0 -->
- <exec executable="env/bin/radish" dir="${project.build.directory}/python2"
- failonerror="true">
- <env key="PYTHONPATH" value=""/>
- <env key="PYTHONIOENCODING" value="utf-8:surrogateescape"/>
- <arg line="-f dots -e -t -b ${project.build.directory}/python2/radish ${project.basedir}/../gremlin-test/features/ --user-data="graphson=v3""/> <!-- -no-line-jump -->
+ <arg line="-f dots -e -t -b ${project.build.directory}/python2/radish ${project.basedir}/../gremlin-test/features/ --user-data="serializer=application/vnd.gremlin-v3.0+json""/> <!-- -no-line-jump -->
</exec>
</target>
</configuration>
diff --git a/gremlin-python/src/main/jython/radish/terrain.py b/gremlin-python/src/main/jython/radish/terrain.py
index ccff6d6..9122eac 100644
--- a/gremlin-python/src/main/jython/radish/terrain.py
+++ b/gremlin-python/src/main/jython/radish/terrain.py
@@ -66,17 +66,7 @@ def prepare_static_traversal_source(features, marker):
@before.each_scenario
def prepare_traversal_source(scenario):
# some tests create data - create a fresh remote to the empty graph and clear that graph prior to each test
- if not("graphson" in world.config.user_data):
- raise ValueError('test configuration requires setting of --user-data="graphson=*" to one of [v2,v3]')
-
- if world.config.user_data["graphson"] == "v3":
- s = serializer.GraphSONSerializersV3d0()
- elif world.config.user_data["graphson"] == "v2":
- s = serializer.GraphSONSerializersV2d0()
- else:
- raise ValueError('serializer set with --user-data="graphson=v2" must be one of [v2,v3]')
-
- remote = DriverRemoteConnection('ws://localhost:45940/gremlin', "ggraph", message_serializer=s)
+ remote = __create_remote("ggraph")
scenario.context.remote_conn["empty"] = remote
g = traversal().withRemote(remote)
g.V().drop().iterate()
@@ -94,7 +84,15 @@ def close_static_traversal_source(features, marker):
def __create_remote(server_graph_name):
- return DriverRemoteConnection('ws://localhost:45940/gremlin', server_graph_name, message_serializer=serializer.GraphSONSerializersV3d0())
+ if not("serializer" in world.config.user_data):
+ raise ValueError('test configuration requires setting of --user-data="serializer={mime-type}"')
+
+ if world.config.user_data["serializer"] == "application/vnd.gremlin-v3.0+json":
+ s = serializer.GraphSONSerializersV3d0()
+ else:
+ raise ValueError('serializer not found - ' + world.config.user_data["serializer"])
+
+ return DriverRemoteConnection('ws://localhost:45940/gremlin', server_graph_name, message_serializer=s)
def __create_lookup_v(remote):