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 2015/11/05 22:31:09 UTC

[04/12] incubator-tinkerpop git commit: added two tests to cover some driver failure situations. The issue at hand is related to a combination of gremlin-server secure configuration and session requests with variables.

added two tests to cover some driver failure situations. The issue at hand is related to a combination of gremlin-server secure configuration and session requests with variables.


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

Branch: refs/heads/TINKERPOP3-923
Commit: 4cb087d039990f643494146e48ab95264cc99805
Parents: 151f64b
Author: Dylan Millikin <dm...@apache.org>
Authored: Wed Nov 4 22:12:37 2015 +0100
Committer: Dylan Millikin <dm...@apache.org>
Committed: Wed Nov 4 22:12:37 2015 +0100

----------------------------------------------------------------------
 .../server/GremlinServerAuthIntegrateTest.java  | 35 ++++++++++++++++++++
 1 file changed, 35 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4cb087d0/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
index 2cfa2fe..c4743dd 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerAuthIntegrateTest.java
@@ -28,6 +28,7 @@ import org.ietf.jgss.GSSException;
 import org.junit.Test;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeoutException;
 
@@ -196,4 +197,38 @@ public class GremlinServerAuthIntegrateTest extends AbstractGremlinServerIntegra
             cluster.close();
         }
     }
+    
+    @Test
+    public void shouldAuthenticateAndWorkWithVariablesOverJsonSerialization() throws Exception {
+        final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON).credentials("stephen", "password").create();
+        final Client client = cluster.connect(name.getMethodName());
+
+        try {
+            Map vertex = (Map) client.submit("v=graph.addVertex(\"name\", \"stephen\")").all().get().get(0).getObject();
+            Map<String, List<Map>> properties = (Map) vertex.get("properties");
+            assertEquals("stephen", properties.get("name").get(0).get("value"));
+            
+            final Map vpName = (Map)client.submit("v.property('name')").all().get().get(0).getObject();
+            assertEquals("stephen", vpName.get("value"));
+        } finally {
+            cluster.close();
+        }
+    }
+    
+    @Test
+    public void shouldAuthenticateAndWorkWithVariablesOverGraphSONSerialization() throws Exception {
+        final Cluster cluster = Cluster.build().serializer(Serializers.GRAPHSON_V1D0).credentials("stephen", "password").create();
+        final Client client = cluster.connect(name.getMethodName());
+
+        try {
+            Map vertex = (Map) client.submit("v=graph.addVertex('name', 'stephen')").all().get().get(0).getObject();
+            Map<String, List<Map>> properties = (Map) vertex.get("properties");
+            assertEquals("stephen", properties.get("name").get(0).get("value"));
+            
+            final Map vpName = (Map)client.submit("v.property('name')").all().get().get(0).getObject();
+            assertEquals("stephen", vpName.get("value"));
+        } finally {
+            cluster.close();
+        }
+    }
 }