tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [01/50] [abbrv] tinkerpop git commit: Fixed issue for byte[] when using serializeResultToString [Forced Update!]
Date Mon, 27 Feb 2017 12:49:04 GMT
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1612 89e4968c8 -> 6da7ec95a (forced update)


Fixed issue for byte[] when using serializeResultToString


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

Branch: refs/heads/TINKERPOP-1612
Commit: c36464381101197ab92b51e725d1bf947e709e2a
Parents: 5c735d8
Author: HadoopMarc <vtslab@xs4all.nl>
Authored: Sun Jan 8 17:56:15 2017 +0100
Committer: HadoopMarc <vtslab@xs4all.nl>
Committed: Wed Jan 18 20:05:40 2017 +0100

----------------------------------------------------------------------
 .../ser/AbstractGryoMessageSerializerV1d0.java  |  3 ++
 .../AbstractGremlinServerIntegrationTest.java   |  1 -
 .../tinkerpop/gremlin/server/AuthKrb5Test.java  | 41 +++++++++-----------
 3 files changed, 22 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c3646438/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/AbstractGryoMessageSerializerV1d0.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/AbstractGryoMessageSerializerV1d0.java
b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/AbstractGryoMessageSerializerV1d0.java
index ace6bb0..4588443 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/AbstractGryoMessageSerializerV1d0.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ser/AbstractGryoMessageSerializerV1d0.java
@@ -301,9 +301,12 @@ public abstract class AbstractGryoMessageSerializerV1d0 extends AbstractMessageS
         if (msg.getResult().getData() == null) return "null";
 
         // the IteratorHandler should return a collection so keep it as such
+        // Sasl authentication needs byte[] to pass unchanged
         final Object o = msg.getResult().getData();
         if (o instanceof Collection) {
             return ((Collection) o).stream().map(d -> null == d ? "null" : d.toString()).collect(Collectors.toList());
+        } else if (o instanceof byte[]) {
+            return o;
         } else {
             return o.toString();
         }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c3646438/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
index 56a599f..12fadb6 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AbstractGremlinServerIntegrationTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.tinkerpop.gremlin.server;
 
-import org.apache.tinkerpop.gremlin.util.Log4jRecordingAppender;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c3646438/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AuthKrb5Test.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AuthKrb5Test.java
b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AuthKrb5Test.java
index 7c86bcd..11b873c 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AuthKrb5Test.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/AuthKrb5Test.java
@@ -22,6 +22,8 @@ import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.log4j.Logger;
 import org.apache.tinkerpop.gremlin.driver.Client;
 import org.apache.tinkerpop.gremlin.driver.Cluster;
+import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
+import org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0;
 import org.apache.tinkerpop.gremlin.server.auth.Krb5Authenticator;
 import org.apache.tinkerpop.gremlin.util.Log4jRecordingAppender;
 import org.ietf.jgss.GSSException;
@@ -241,26 +243,21 @@ public class AuthKrb5Test extends AbstractGremlinServerIntegrationTest
{
 //    }
 
 
-//    ToDo: make this into a test for gremlin-driver
-//    @Test
-//    public void shouldAuthenticateWithSerializeResultToString() throws Exception {
-//        server = new GremlinServerAuthKrb5Integrate(getServerPrincipal(), serviceKeytabFile);
-//        server.setUp();
-//        loginServiceUsingKeytab();
-//        loginClientUsingTicketCache();
-//        MessageSerializer serializer = new GryoMessageSerializerV1d0();
-//        Map config = new HashMap<String, Object>();
-//        config.put("serializeResultToString", true);
-//        serializer.configure(config, null);
-//        final Cluster cluster = Cluster.build().jaasEntry(TESTCONSOLE)
-//                .protocol(getServerPrincipalName()).addContactPoint(serverHostname).port(45940).enableSsl(false).serializer(serializer).create();
-//        final Client client = cluster.connect();
-//        try {
-//            assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
-//            assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
-//            assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
-//        } finally {
-//            cluster.close();
-//        }
-//    }
+    @Test
+    public void shouldAuthenticateWithSerializeResultToString() throws Exception {
+        MessageSerializer serializer = new GryoMessageSerializerV1d0();
+        Map config = new HashMap<String, Object>();
+        config.put("serializeResultToString", true);
+        serializer.configure(config, null);
+        final Cluster cluster = TestClientFactory.build().jaasEntry(TESTCONSOLE)
+                .protocol(kdcServer.serverPrincipalName).addContactPoint(kdcServer.hostname).serializer(serializer).create();
+        final Client client = cluster.connect();
+        try {
+            assertEquals(2, client.submit("1+1").all().get().get(0).getInt());
+            assertEquals(3, client.submit("1+2").all().get().get(0).getInt());
+            assertEquals(4, client.submit("1+3").all().get().get(0).getInt());
+        } finally {
+            cluster.close();
+        }
+    }
 }


Mime
View raw message