You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ns...@apache.org on 2016/02/27 08:57:17 UTC

[7/7] thrift git commit: THRIFT-3679 Add stdout log to testBinary in Java test server Client: Test (Java) Patch: Nobuaki Sukegawa

THRIFT-3679 Add stdout log to testBinary in Java test server
Client: Test (Java)
Patch: Nobuaki Sukegawa

This closes #899


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

Branch: refs/heads/master
Commit: ce283d56647ed3ec7f0c574be86be2959dc5c04c
Parents: 3b4c5fa
Author: Nobuaki Sukegawa <ns...@apache.org>
Authored: Sat Feb 27 03:11:00 2016 +0900
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Sat Feb 27 16:55:55 2016 +0900

----------------------------------------------------------------------
 lib/java/test/org/apache/thrift/server/ServerTestBase.java | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/ce283d56/lib/java/test/org/apache/thrift/server/ServerTestBase.java
----------------------------------------------------------------------
diff --git a/lib/java/test/org/apache/thrift/server/ServerTestBase.java b/lib/java/test/org/apache/thrift/server/ServerTestBase.java
index bc1fb96..8cbb934 100755
--- a/lib/java/test/org/apache/thrift/server/ServerTestBase.java
+++ b/lib/java/test/org/apache/thrift/server/ServerTestBase.java
@@ -92,8 +92,13 @@ public abstract class ServerTestBase extends TestCase {
     }
 
     public ByteBuffer testBinary(ByteBuffer thing) {
-      String hexstr = "TODO: toHexString(thing)";
-	  System.out.print("testBinary(" + hexstr + ")\n");
+      StringBuilder sb = new StringBuilder(thing.remaining() * 3);
+      thing.mark();
+      while (thing.remaining() > 0) {
+        sb.append(String.format("%02X ", thing.get()));
+      }
+      System.out.print("testBinary(" + sb.toString() + ")\n");
+      thing.reset();
       return thing;
     }