THRIFT-2886 Integrate binary type in standard Thrift cross test
Client: C_glib, C++, D, Erlang, Go, Haskell, Lua, Java/Me, JavaScript, Node, Ocaml, Perl, PHP, Python, Ruby
Patch: Jens Geyer
This closes #341
Minimal server-side implementations and TODO stubs for various languages to let "make check" succeeed.
Not contained in this patch and still TODO:
- client side implementations, i.e. calls to testBinary() and appropriate tests
- server side hex printout missing for some languages
diff --git a/lib/c_glib/test/testthrifttestclient.cpp b/lib/c_glib/test/testthrifttestclient.cpp
index f4e3250..4241f1c 100755
--- a/lib/c_glib/test/testthrifttestclient.cpp
+++ b/lib/c_glib/test/testthrifttestclient.cpp
@@ -86,6 +86,11 @@
return thing;
}
+ void testBinary(string& out, const string &thing) {
+ printf("[C -> C++] testBinary(\"%s\")\n", thing.c_str());
+ out = thing;
+ }
+
void testStruct(Xtruct& out, const Xtruct &thing) {
printf("[C -> C++] testStruct({\"%s\", %d, %d, %lld})\n", thing.string_thing.c_str(), (int)thing.byte_thing, thing.i32_thing, thing.i64_thing);
out = thing;
diff --git a/lib/d/test/thrift_test_client.d b/lib/d/test/thrift_test_client.d
index a258b64..fd53328 100644
--- a/lib/d/test/thrift_test_client.d
+++ b/lib/d/test/thrift_test_client.d
@@ -159,6 +159,8 @@
if (trace) writefln(" = %s", dub);
enforce(dub == -5.2098523);
+ // TODO: add testBinary() call
+
Xtruct out1;
out1.string_thing = "Zero";
out1.byte_thing = 1;
diff --git a/lib/d/test/thrift_test_server.d b/lib/d/test/thrift_test_server.d
index 993c063..1608a57 100644
--- a/lib/d/test/thrift_test_server.d
+++ b/lib/d/test/thrift_test_server.d
@@ -81,6 +81,11 @@
return thing;
}
+ override string testBinary(string thing) {
+ if (trace_) writefln("testBinary(\"%s\")", thing);
+ return thing;
+ }
+
override Xtruct testStruct(ref const(Xtruct) thing) {
if (trace_) writefln("testStruct({\"%s\", %s, %s, %s})",
thing.string_thing, thing.byte_thing, thing.i32_thing, thing.i64_thing);
diff --git a/lib/erl/test/test_client.erl b/lib/erl/test/test_client.erl
index db4d2d1..4e85c47 100644
--- a/lib/erl/test/test_client.erl
+++ b/lib/erl/test/test_client.erl
@@ -83,6 +83,7 @@
{Client06, {ok, 0}} = thrift_client:call(Client05, testI32, [0]),
{Client07, {ok, -34359738368}} = thrift_client:call(Client06, testI64, [-34359738368]),
{Client08, {ok, -5.2098523}} = thrift_client:call(Client07, testDouble, [-5.2098523]),
+ %% TODO: add testBinary() call
{Client09, {ok, DemoXtruct}} = thrift_client:call(Client08, testStruct, [DemoXtruct]),
{Client10, {ok, DemoNest}} = thrift_client:call(Client09, testNest, [DemoNest]),
{Client11, {ok, DemoDict}} = thrift_client:call(Client10, testMap, [DemoDict]),
diff --git a/lib/erl/test/test_server.erl b/lib/erl/test/test_server.erl
index a4145d6..77357ff 100644
--- a/lib/erl/test/test_server.erl
+++ b/lib/erl/test/test_server.erl
@@ -81,6 +81,10 @@
io:format("testDouble: ~p~n", [Double]),
{reply, Double};
+handle_function(testBinary, {S}) when is_binary(S) ->
+ io:format("testBinary: ~p~n", [S]),
+ {reply, S};
+
handle_function(testStruct,
{Struct = #'Xtruct'{string_thing = String,
byte_thing = Byte,
diff --git a/lib/go/test/tests/thrifttest_driver.go b/lib/go/test/tests/thrifttest_driver.go
index b6188e4..915383f 100644
--- a/lib/go/test/tests/thrifttest_driver.go
+++ b/lib/go/test/tests/thrifttest_driver.go
@@ -127,6 +127,8 @@
t.Fatal("TestDouble(-7.012052175215044) failed")
}
+ // TODO: add testBinary() call
+
out := thrifttest.NewXtruct()
out.StringThing = "Zero"
out.ByteThing = 1
diff --git a/lib/go/test/tests/thrifttest_handler.go b/lib/go/test/tests/thrifttest_handler.go
index 1bbd7de..eef45d5 100644
--- a/lib/go/test/tests/thrifttest_handler.go
+++ b/lib/go/test/tests/thrifttest_handler.go
@@ -72,6 +72,10 @@
return thing, nil
}
+func (p *ThriftTestHandler) TestBinary(thing []byte) (r []byte, err error) {
+ return thing, nil
+}
+
func (p *ThriftTestHandler) TestStruct(thing *thrifttest.Xtruct) (r *thrifttest.Xtruct, err error) {
return thing, nil
}
diff --git a/lib/java/test/org/apache/thrift/server/ServerTestBase.java b/lib/java/test/org/apache/thrift/server/ServerTestBase.java
index 4cbb511..a2836aa 100755
--- a/lib/java/test/org/apache/thrift/server/ServerTestBase.java
+++ b/lib/java/test/org/apache/thrift/server/ServerTestBase.java
@@ -26,6 +26,8 @@
import java.util.Map;
import java.util.Set;
+import java.nio.ByteBuffer;
+
import junit.framework.TestCase;
import org.apache.thrift.TException;
@@ -83,7 +85,13 @@
System.out.print("testDouble(" + thing + ")\n");
return thing;
}
-
+
+ public ByteBuffer testBinary(ByteBuffer thing) {
+ String hexstr = "TODO: toHexString(thing)";
+ System.out.print("testBinary(" + hexstr + ")\n");
+ return thing;
+ }
+
public Xtruct testStruct(Xtruct thing) {
System.out.print("testStruct({" +
"\"" + thing.string_thing + "\", " +
@@ -596,6 +604,11 @@
resultHandler.onComplete(handler.testDouble(thing));
}
+ @Override
+ public void testBinary(ByteBuffer thing, AsyncMethodCallback resultHandler) throws TException {
+ resultHandler.onComplete(handler.testBinary(thing));
+ }
+
@Override
public void testStruct(Xtruct thing, AsyncMethodCallback resultHandler) throws TException {
resultHandler.onComplete(handler.testStruct(thing));
diff --git a/lib/java/test/org/apache/thrift/test/TestClient.java b/lib/java/test/org/apache/thrift/test/TestClient.java
index 4e7e507..b54461e 100644
--- a/lib/java/test/org/apache/thrift/test/TestClient.java
+++ b/lib/java/test/org/apache/thrift/test/TestClient.java
@@ -254,6 +254,11 @@
}
/**
+ * BINARY TEST
+ */
+ System.out.print("TODO: testBinary( ... )");
+
+ /**
* STRUCT TEST
*/
System.out.print("testStruct({\"Zero\", 1, -3, -5})");
diff --git a/lib/js/test/test-async.js b/lib/js/test/test-async.js
index 4935fea..336e2bc 100644
--- a/lib/js/test/test-async.js
+++ b/lib/js/test/test-async.js
@@ -97,6 +97,7 @@
QUnit.start();
});
});
+ // TODO: add testBinary()
asyncTest("Byte", function() {
expect( 2 );
QUnit.stop();
diff --git a/lib/js/test/test_handler.js b/lib/js/test/test_handler.js
index 17d22cf..50ac7ac 100644
--- a/lib/js/test/test_handler.js
+++ b/lib/js/test/test_handler.js
@@ -48,6 +48,10 @@
console.log('testDouble(' + thing + ')');
result(null, thing);
},
+ testBinary: function(thing, result) {
+ console.log('testBinary(\'' + thing + '\')');
+ result(null, thing);
+ },
testStruct: function(thing, result) {
console.log('testStruct(');
console.log(thing);
diff --git a/lib/nodejs/test/test_handler.js b/lib/nodejs/test/test_handler.js
index 3de8965..09ff39f 100644
--- a/lib/nodejs/test/test_handler.js
+++ b/lib/nodejs/test/test_handler.js
@@ -48,6 +48,10 @@
console.log('testDouble(' + thing + ')');
result(null, thing);
},
+ testBinary: function(thing, result) {
+ console.log('testBinary(\'' + thing + '\')');
+ result(null, thing);
+ },
testStruct: function(thing, result) {
console.log('testStruct(');
console.log(thing);
diff --git a/lib/nodejs/test/test_handler_promise.js b/lib/nodejs/test/test_handler_promise.js
index 385b04c..cda6558 100644
--- a/lib/nodejs/test/test_handler_promise.js
+++ b/lib/nodejs/test/test_handler_promise.js
@@ -47,6 +47,10 @@
console.log('testDouble(' + thing + ')');
return thing;
},
+ testBinary: function(thing) {
+ console.log('testBinary(\'' + thing + '\')');
+ return thing;
+ },
testStruct: function(thing) {
console.log('testStruct(');
console.log(thing);
diff --git a/lib/nodejs/test/thrift_test_driver.js b/lib/nodejs/test/thrift_test_driver.js
index b1d744b..b8c900b 100644
--- a/lib/nodejs/test/thrift_test_driver.js
+++ b/lib/nodejs/test/thrift_test_driver.js
@@ -171,6 +171,8 @@
assert.equal(7.012052175215044, response);
});
+// TODO: add testBinary()
+
var out = new ttypes.Xtruct({
string_thing: 'Zero',
byte_thing: 1,
diff --git a/lib/nodejs/test/thrift_test_driver_promise.js b/lib/nodejs/test/thrift_test_driver_promise.js
index 22175cb..f27ba4c 100644
--- a/lib/nodejs/test/thrift_test_driver_promise.js
+++ b/lib/nodejs/test/thrift_test_driver_promise.js
@@ -202,7 +202,9 @@
.fail(function() {
assert(false);
});
-
+
+// TODO: add testBinary()
+
var out = new ttypes.Xtruct({
string_thing: 'Zero',
byte_thing: 1,
diff --git a/lib/php/test/Test/Thrift/Fixtures.php b/lib/php/test/Test/Thrift/Fixtures.php
index 35fc0d9..d9d487f 100644
--- a/lib/php/test/Test/Thrift/Fixtures.php
+++ b/lib/php/test/Test/Thrift/Fixtures.php
@@ -48,6 +48,8 @@
self::$testArgs['testDouble'] = 3.1415926535898;
+ // TODO: add testBinary() call
+
self::$testArgs['testByte'] = 0x01;
self::$testArgs['testI32'] = pow( 2, 30 );
diff --git a/test/c_glib/src/test_client.c b/test/c_glib/src/test_client.c
index 59f4157..dba2daf 100644
--- a/test/c_glib/src/test_client.c
+++ b/test/c_glib/src/test_client.c
@@ -379,6 +379,8 @@
fail_count++;
}
+ // TODO: add testBinary()
+
/**
* STRUCT TEST
*/
diff --git a/test/c_glib/src/thrift_test_handler.c b/test/c_glib/src/thrift_test_handler.c
index 596e615..ae273bf 100644
--- a/test/c_glib/src/thrift_test_handler.c
+++ b/test/c_glib/src/thrift_test_handler.c
@@ -119,6 +119,21 @@
return TRUE;
}
+gboolean
+thrift_test_handler_test_binary (TTestThriftTestIf *iface,
+ GByteArray ** _return,
+ const GByteArray * thing,
+ GError **error)
+{
+ THRIFT_UNUSED_VAR (iface);
+ THRIFT_UNUSED_VAR (error);
+
+ printf ("testBinary()\n"); // TODO: hex output
+ g_byte_array_append( *_return, thing->data, thing->len);
+
+ return TRUE;
+}
+
gboolean
thrift_test_handler_test_struct (TTestThriftTestIf *iface,
TTestXtruct **_return,
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index a6069de..c496bcb 100644
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -334,6 +334,7 @@
printf(" = %" PRId64 "\n", i64);
if (i64 != -34359738368LL)
failCount++;
+
/**
* DOUBLE TEST
*/
@@ -344,6 +345,11 @@
failCount++;
/**
+ * BINARY TEST
+ */
+ // TODO: add testBinary() call
+
+ /**
* STRUCT TEST
*/
printf("testStruct({\"Zero\", 1, -3, -5})");
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index 6d2a260..2705064 100644
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -98,6 +98,13 @@
return thing;
}
+ void testBinary(std::string& _return, const std::string& thing) {
+ std::ostringstream hexstr;
+ hexstr << std::hex << thing;
+ printf("testBinary(%s)\n", hexstr.str().c_str());
+ _return = thing;
+ }
+
void testStruct(Xtruct& out, const Xtruct& thing) {
printf("testStruct({\"%s\", %d, %d, %" PRId64 "})\n",
thing.string_thing.c_str(),
@@ -411,6 +418,12 @@
cob(res);
}
+ virtual void testBinary(tcxx::function<void(std::string const& _return)> cob, const std::string& thing) {
+ std::string res;
+ _delegate->testBinary(res, thing);
+ cob(res);
+ }
+
virtual void testStruct(tcxx::function<void(Xtruct const& _return)> cob, const Xtruct& thing) {
Xtruct res;
_delegate->testStruct(res, thing);
diff --git a/test/go/src/bin/testclient/main.go b/test/go/src/bin/testclient/main.go
index 2acf6cf..c48df0e 100644
--- a/test/go/src/bin/testclient/main.go
+++ b/test/go/src/bin/testclient/main.go
@@ -107,6 +107,8 @@
t.Fatalf("Unexpected TestDouble() result expected 42.42, got %f ", d)
}
+ // TODO: add TestBinary() call
+
xs := thrifttest.NewXtruct()
xs.StringThing = "thing"
xs.ByteThing = 42
diff --git a/test/go/src/common/clientserver_test.go b/test/go/src/common/clientserver_test.go
index 8add041..3b512ad 100644
--- a/test/go/src/common/clientserver_test.go
+++ b/test/go/src/common/clientserver_test.go
@@ -92,6 +92,7 @@
handler.EXPECT().TestByte(int8(42)).Return(int8(42), nil),
handler.EXPECT().TestI32(int32(4242)).Return(int32(4242), nil),
handler.EXPECT().TestI64(int64(424242)).Return(int64(424242), nil),
+ // TODO: add TestBinary()
handler.EXPECT().TestDouble(float64(42.42)).Return(float64(42.42), nil),
handler.EXPECT().TestStruct(&thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}).Return(&thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}, nil),
handler.EXPECT().TestNest(&thrifttest.Xtruct2{StructThing: &thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}}).Return(&thrifttest.Xtruct2{StructThing: &thrifttest.Xtruct{StringThing: "thing", ByteThing: 42, I32Thing: 4242, I64Thing: 424242}}, nil),
@@ -156,6 +157,8 @@
t.Errorf("Unexpected TestDouble() result expected 42.42, got %f ", d)
}
+ // TODO: add TestBinary() call
+
xs := thrifttest.NewXtruct()
xs.StringThing = "thing"
xs.ByteThing = 42
diff --git a/test/go/src/common/mock_handler.go b/test/go/src/common/mock_handler.go
index d736ed9..8ef3b6e 100644
--- a/test/go/src/common/mock_handler.go
+++ b/test/go/src/common/mock_handler.go
@@ -70,6 +70,17 @@
return _mr.mock.ctrl.RecordCall(_mr.mock, "TestDouble", arg0)
}
+func (_m *MockThriftTest) TestBinary(_param0 []byte) ([]byte, error) {
+ ret := _m.ctrl.Call(_m, "TestBinary", _param0)
+ ret0, _ := ret[0].([]byte)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+func (_mr *_MockThriftTestRecorder) TestBinary(arg0 interface{}) *gomock.Call {
+ return _mr.mock.ctrl.RecordCall(_mr.mock, "TestBinary", arg0)
+}
+
func (_m *MockThriftTest) TestEnum(_param0 thrifttest.Numberz) (thrifttest.Numberz, error) {
ret := _m.ctrl.Call(_m, "TestEnum", _param0)
ret0, _ := ret[0].(thrifttest.Numberz)
diff --git a/test/go/src/common/printing_handler.go b/test/go/src/common/printing_handler.go
index 6cc1507..bed7086 100644
--- a/test/go/src/common/printing_handler.go
+++ b/test/go/src/common/printing_handler.go
@@ -22,6 +22,7 @@
import (
"errors"
"fmt"
+ "encoding/hex"
. "gen/thrifttest"
"time"
)
@@ -91,6 +92,17 @@
return thing, nil
}
+// Prints 'testBinary("%s")' where '%s' is a hex-formatted string of thing's data
+// @param []byte thing - the binary to print
+// @return []byte - returns the binary 'thing'
+//
+// Parameters:
+// - Thing
+func (p *printingHandler) TestBinary(thing []byte) (r []byte, err error) {
+ fmt.Printf("testBinary(%s)\n", hex.EncodeToString(thing))
+ return thing, nil
+}
+
// Prints 'testStruct("{%s}")' where thing has been formatted into a string of comma separated values
// @param Xtruct thing - the Xtruct to print
// @return Xtruct - returns the Xtruct 'thing'
diff --git a/test/go/src/common/simple_handler.go b/test/go/src/common/simple_handler.go
index 433616d..97ff52d 100644
--- a/test/go/src/common/simple_handler.go
+++ b/test/go/src/common/simple_handler.go
@@ -53,6 +53,10 @@
return thing, nil
}
+func (p *simpleHandler) TestBinary(thing []byte) (r []byte, err error) {
+ return thing, nil
+}
+
func (p *simpleHandler) TestStruct(thing *Xtruct) (r *Xtruct, err error) {
return r, err
}
diff --git a/test/hs/TestClient.hs b/test/hs/TestClient.hs
index 03314ed..6c25f5b 100644
--- a/test/hs/TestClient.hs
+++ b/test/hs/TestClient.hs
@@ -105,6 +105,8 @@
dub <- Client.testDouble prot (-5.2098523)
when (abs (dub + 5.2098523) > 0.001) exitFailure
+ -- TODO: call Client.testBinary
+
-- Struct Test
let structIn = Xtruct{ xtruct_string_thing = "Zero"
, xtruct_byte_thing = 1
diff --git a/test/hs/TestServer.hs b/test/hs/TestServer.hs
index ec3891c..d991de1 100755
--- a/test/hs/TestServer.hs
+++ b/test/hs/TestServer.hs
@@ -127,6 +127,10 @@
System.IO.putStrLn $ "testDouble(" ++ show x ++ ")"
return x
+ testBinary _ x = do
+ System.IO.putStrLn $ "testBinary(" ++ show x ++ ")"
+ return x
+
testStruct _ struct@Xtruct{..} = do
System.IO.putStrLn $ "testStruct({" ++ show xtruct_string_thing
++ ", " ++ show xtruct_byte_thing
diff --git a/test/hs/ThriftTest_Main.hs b/test/hs/ThriftTest_Main.hs
index 1139506..670023e 100755
--- a/test/hs/ThriftTest_Main.hs
+++ b/test/hs/ThriftTest_Main.hs
@@ -67,6 +67,10 @@
ThriftTestUtils.serverLog $ show x
return x
+ testBinary _ x = do
+ ThriftTestUtils.serverLog $ show x
+ return x
+
testStruct _ x = do
ThriftTestUtils.serverLog $ show x
return x
@@ -150,6 +154,8 @@
v9 <- Client.testDouble ps (-3.14)
ThriftTestUtils.clientLog $ show v9
+ -- TODO: Client.testBinary ...
+
v10 <- Client.testMap ps (Map.fromList [(1,1),(2,2),(3,3)])
ThriftTestUtils.clientLog $ show v10
diff --git a/test/lua/test_basic_client.lua b/test/lua/test_basic_client.lua
index e2e0d48..e7571f9 100644
--- a/test/lua/test_basic_client.lua
+++ b/test/lua/test_basic_client.lua
@@ -112,6 +112,8 @@
assertEqual(
client:testDouble(0.123456789), 0.123456789, 'Failed testDouble 3')
+ -- TODO testBinary() ...
+
-- Accuracy of 16 decimal digits (rounds)
local a, b = 1.12345678906666663, 1.12345678906666661
assertEqual(a, b)
diff --git a/test/lua/test_basic_server.lua b/test/lua/test_basic_server.lua
index 7c175da..96a1ae9 100644
--- a/test/lua/test_basic_server.lua
+++ b/test/lua/test_basic_server.lua
@@ -51,6 +51,10 @@
return d
end
+function TestHandler:testBinary(by)
+ return by
+end
+
function TestHandler:testStruct(thing)
return thing
end
diff --git a/test/ocaml/server/TestServer.ml b/test/ocaml/server/TestServer.ml
index 3f5c9ee..efe0f4b 100644
--- a/test/ocaml/server/TestServer.ml
+++ b/test/ocaml/server/TestServer.ml
@@ -36,6 +36,7 @@
method testI32 x = p "testI32(%d)\n" (sod x); (sod x)
method testI64 x = p "testI64(%s)\n" (Int64.to_string (sod x)); (sod x)
method testDouble x = p "testDouble(%f)\n" (sod x); (sod x)
+ method testBinary x = p "testBinary(%s)\n" (sod x); (sod x)
method testStruct x = p "testStruct(---)\n"; (sod x)
method testNest x = p "testNest(---)\n"; (sod x)
method testMap x = p "testMap(---)\n"; (sod x)
diff --git a/test/perl/TestClient.pl b/test/perl/TestClient.pl
index af80d46..ca1d47e 100644
--- a/test/perl/TestClient.pl
+++ b/test/perl/TestClient.pl
@@ -99,6 +99,11 @@
print(" = $dub\n");
#
+# BINARY TEST --- TODO
+#
+
+
+#
# STRUCT TEST
#
print("testStruct({\"Zero\", 1, -3, -5})");
diff --git a/test/php/TestClient.php b/test/php/TestClient.php
index c334aee..ea17435 100755
--- a/test/php/TestClient.php
+++ b/test/php/TestClient.php
@@ -128,6 +128,10 @@
print_r(" = $dub\n");
/**
+ * BINARY TEST -- TODO
+ */
+
+/**
* STRUCT TEST
*/
print_r("testStruct({\"Zero\", 1, -3, -5})");
diff --git a/test/py.tornado/test_suite.py b/test/py.tornado/test_suite.py
index c783962..b63ea2d 100755
--- a/test/py.tornado/test_suite.py
+++ b/test/py.tornado/test_suite.py
@@ -72,6 +72,9 @@
def testDouble(self, dub):
return dub
+ def testBinary(self, thing):
+ return thing
+
def testStruct(self, thing):
return thing
diff --git a/test/py.twisted/test_suite.py b/test/py.twisted/test_suite.py
index 6e1fee2..26c1ee2 100644
--- a/test/py.twisted/test_suite.py
+++ b/test/py.twisted/test_suite.py
@@ -59,6 +59,9 @@
def testDouble(self, dub):
return dub
+ def testBinary(self, thing):
+ return thing
+
def testStruct(self, thing):
return thing
@@ -144,6 +147,8 @@
def testDouble(self):
self.assertEquals((yield self.client.testDouble(-5.235098235)), -5.235098235)
+ # TODO: def testBinary(self) ...
+
@defer.inlineCallbacks
def testStruct(self):
x = Xtruct()
diff --git a/test/py/TestClient.py b/test/py/TestClient.py
index 87fede6..a810b3f 100755
--- a/test/py/TestClient.py
+++ b/test/py/TestClient.py
@@ -118,6 +118,8 @@
self.assertEqual(self.client.testDouble(0), 0)
self.assertEqual(self.client.testDouble(-1), -1)
+ # TODO: def testBinary(self) ...
+
def testStruct(self):
x = Xtruct()
x.string_thing = "Zero"
diff --git a/test/py/TestServer.py b/test/py/TestServer.py
index 820b816..b29eabd 100755
--- a/test/py/TestServer.py
+++ b/test/py/TestServer.py
@@ -101,6 +101,11 @@
print 'testDouble(%f)' % dub
return dub
+ def testBinary(self, thing):
+ if options.verbose > 1:
+ print 'testBinary()' # TODO: hex output
+ return thring
+
def testStruct(self, thing):
if options.verbose > 1:
print 'testStruct({%s, %d, %d, %d})' % (thing.string_thing, thing.byte_thing, thing.i32_thing, thing.i64_thing)
diff --git a/test/rb/integration/TestClient.rb b/test/rb/integration/TestClient.rb
index 41625a8..3659ccb 100755
--- a/test/rb/integration/TestClient.rb
+++ b/test/rb/integration/TestClient.rb
@@ -116,6 +116,8 @@
assert_kind_of(Float, @client.testDouble(val))
end
+ # TODO: testBinary
+
def test_map
val = {1 => 1, 2 => 2, 3 => 3}
assert_equal(@client.testMap(val), val)
diff --git a/test/rb/integration/TestServer.rb b/test/rb/integration/TestServer.rb
index 3e365ca..64949bc 100755
--- a/test/rb/integration/TestServer.rb
+++ b/test/rb/integration/TestServer.rb
@@ -26,7 +26,7 @@
require 'thrift_test'
class SimpleHandler
- [:testVoid, :testString, :testByte, :testI32, :testI64, :testDouble,
+ [:testVoid, :testString, :testByte, :testI32, :testI64, :testDouble, :testBinary,
:testStruct, :testMap, :testSet, :testList, :testNest,
:testEnum, :testTypedef, :testMultiException].each do |meth|