summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlongzhiri <persistentsnail@gmail.com>2020-08-04 22:01:09 +0800
committerJens Geyer <jensg@apache.org>2020-09-12 19:01:36 +0200
commit03715899d280c834f8cccbb0435fdedcc456c0e1 (patch)
tree5972cd2316bb19f45969b205a6ac90c48fe07bf8 /test
parent47d4a00f51de56d409fe016c5aa78d763128cbca (diff)
downloadthrift-03715899d280c834f8cccbb0435fdedcc456c0e1.tar.gz
THRIFT-5260 Fix the thrift compiler generate problematic lua code for the oneway method
Client: lua Patch: longzhiri <persistentsnail@gmail.com> This closes #2212 The oneway method's processor has no need to write the result to client, but it is necessary to return values of each handler's return.
Diffstat (limited to 'test')
-rw-r--r--test/lua/test_basic_client.lua3
-rw-r--r--test/lua/test_basic_server.lua5
2 files changed, 8 insertions, 0 deletions
diff --git a/test/lua/test_basic_client.lua b/test/lua/test_basic_client.lua
index 77d8d078a..11567d906 100644
--- a/test/lua/test_basic_client.lua
+++ b/test/lua/test_basic_client.lua
@@ -172,6 +172,9 @@ function testBasicClient(rawArgs)
assertEqual(o.i32_thing, r.i32_thing, 'Failed testStruct 3')
assertEqual(o.i64_thing, r.i64_thing, 'Failed testStruct 4')
+ -- oneway
+ client:testOneway(3)
+
-- TODO add list map set exception etc etc
end
diff --git a/test/lua/test_basic_server.lua b/test/lua/test_basic_server.lua
index acd2d79b8..20ac407c8 100644
--- a/test/lua/test_basic_server.lua
+++ b/test/lua/test_basic_server.lua
@@ -66,6 +66,10 @@ function TestHandler:testStruct(thing)
return thing
end
+function TestHandler:testOneway(secondsToSleep)
+ print("testOneway secondsToSleep:", secondsToSleep)
+end
+
--------------------------------------------------------------------------------
-- Test
local server
@@ -132,6 +136,7 @@ function testBasicServer(rawArgs)
protocolFactory = prot_factory
}
assert(server, 'Failed to create server')
+ server:setExceptionHandler(function (err) error(err) end)
-- Serve
server:serve()