Revert "THRIFT-3834 Erlang namespacing and exception metadata"
This reverts commit c8deed8cba62dce0ce816afef38f708ce49d0a61.
diff --git a/test/erl/src/test_client.erl b/test/erl/src/test_client.erl
index 50ffc64..f97bc8a 100644
--- a/test/erl/src/test_client.erl
+++ b/test/erl/src/test_client.erl
@@ -68,13 +68,13 @@
{ok, Client0} = thrift_client_util:new(
"127.0.0.1", Port, thrift_test_thrift, ClientOpts),
- DemoXtruct = #'thrift.test.Xtruct'{
- string_thing = <<"Zero">>,
- byte_thing = 1,
- i32_thing = 9128361,
- i64_thing = 9223372036854775807},
+ DemoXtruct = #'Xtruct'{
+ string_thing = <<"Zero">>,
+ byte_thing = 1,
+ i32_thing = 9128361,
+ i64_thing = 9223372036854775807},
- DemoNest = #'thrift.test.Xtruct2'{
+ DemoNest = #'Xtruct2'{
byte_thing = 7,
struct_thing = DemoXtruct,
% Note that we don't set i32_thing, it will come back as undefined
@@ -86,9 +86,9 @@
DemoDict = dict:from_list([ {Key, Key-10} || Key <- lists:seq(0,10) ]),
DemoSet = sets:from_list([ Key || Key <- lists:seq(-3,3) ]),
- DemoInsane = #'thrift.test.Insanity'{
+ DemoInsane = #'Insanity'{
userMap = dict:from_list([{?THRIFT_TEST_NUMBERZ_FIVE, 5000}]),
- xtructs = [#'thrift.test.Xtruct'{ string_thing = <<"Truck">>, byte_thing = 8, i32_thing = 8, i64_thing = 8}]},
+ xtructs = [#'Xtruct'{ string_thing = <<"Truck">>, byte_thing = 8, i32_thing = 8, i64_thing = 8}]},
error_logger:info_msg("testVoid"),
{Client01, {ok, ok}} = thrift_client:call(Client0, testVoid, []),
@@ -126,7 +126,7 @@
{Client16, {ok, InsaneResult}} = thrift_client:call(Client15, testInsanity, [DemoInsane]),
io:format("~p~n", [InsaneResult]),
- {Client17, {ok, #'thrift.test.Xtruct'{string_thing = <<"Message">>}}} =
+ {Client17, {ok, #'Xtruct'{string_thing = <<"Message">>}}} =
thrift_client:call(Client16, testMultiException, ["Safe", "Message"]),
Client18 =
@@ -135,10 +135,10 @@
io:format("Unexpected return! ~p~n", [Result1]),
ClientS1
catch
- throw:{ClientS2, {exception, ExnS1 = #'thrift.test.Xception'{}}} ->
- #'thrift.test.Xception'{errorCode = 1001, message = <<"This is an Xception">>} = ExnS1,
+ throw:{ClientS2, {exception, ExnS1 = #'Xception'{}}} ->
+ #'Xception'{errorCode = 1001, message = <<"This is an Xception">>} = ExnS1,
ClientS2;
- throw:{ClientS2, {exception, _ExnS1 = #'thrift.test.Xception2'{}}} ->
+ throw:{ClientS2, {exception, _ExnS1 = #'Xception2'{}}} ->
io:format("Wrong exception type!~n", []),
ClientS2
end,
@@ -149,12 +149,12 @@
io:format("Unexpected return! ~p~n", [Result2]),
ClientS3
catch
- throw:{ClientS4, {exception, _ExnS2 = #'thrift.test.Xception'{}}} ->
+ throw:{ClientS4, {exception, _ExnS2 = #'Xception'{}}} ->
io:format("Wrong exception type!~n", []),
ClientS4;
- throw:{ClientS4, {exception, ExnS2 = #'thrift.test.Xception2'{}}} ->
- #'thrift.test.Xception2'{errorCode = 2002,
- struct_thing = #'thrift.test.Xtruct'{
+ throw:{ClientS4, {exception, ExnS2 = #'Xception2'{}}} ->
+ #'Xception2'{errorCode = 2002,
+ struct_thing = #'Xtruct'{
string_thing = <<"This is an Xception2">>}} = ExnS2,
ClientS4
end,
diff --git a/test/erl/src/test_thrift_server.erl b/test/erl/src/test_thrift_server.erl
index f3ed2f7..f504c73 100644
--- a/test/erl/src/test_thrift_server.erl
+++ b/test/erl/src/test_thrift_server.erl
@@ -107,10 +107,10 @@
{reply, S};
handle_function(testStruct,
- {Struct = #'thrift.test.Xtruct'{string_thing = String,
- byte_thing = Byte,
- i32_thing = I32,
- i64_thing = I64}})
+ {Struct = #'Xtruct'{string_thing = String,
+ byte_thing = Byte,
+ i32_thing = I32,
+ i64_thing = I64}})
when is_binary(String),
is_integer(Byte),
is_integer(I32),
@@ -119,8 +119,8 @@
{reply, Struct};
handle_function(testNest,
- {Nest}) when is_record(Nest, 'thrift.test.Xtruct2'),
- is_record(Nest#'thrift.test.Xtruct2'.struct_thing, 'thrift.test.Xtruct') ->
+ {Nest}) when is_record(Nest, 'Xtruct2'),
+ is_record(Nest#'Xtruct2'.struct_thing, 'Xtruct') ->
io:format("testNest: ~p~n", [Nest]),
{reply, Nest};
@@ -159,22 +159,22 @@
{-4, dict:from_list(NegList)}]),
{reply, MapMap};
-handle_function(testInsanity, {Insanity}) when is_record(Insanity, 'thrift.test.Insanity') ->
- Hello = #'thrift.test.Xtruct'{string_thing = <<"Hello2">>,
- byte_thing = 2,
- i32_thing = 2,
- i64_thing = 2},
+handle_function(testInsanity, {Insanity}) when is_record(Insanity, 'Insanity') ->
+ Hello = #'Xtruct'{string_thing = <<"Hello2">>,
+ byte_thing = 2,
+ i32_thing = 2,
+ i64_thing = 2},
- Goodbye = #'thrift.test.Xtruct'{string_thing = <<"Goodbye4">>,
- byte_thing = 4,
- i32_thing = 4,
- i64_thing = 4},
- Crazy = #'thrift.test.Insanity'{
- userMap = dict:from_list([{?THRIFT_TEST_NUMBERZ_EIGHT, 8}]),
- xtructs = [Goodbye]
- },
+ Goodbye = #'Xtruct'{string_thing = <<"Goodbye4">>,
+ byte_thing = 4,
+ i32_thing = 4,
+ i64_thing = 4},
+ Crazy = #'Insanity'{
+ userMap = dict:from_list([{?THRIFT_TEST_NUMBERZ_EIGHT, 8}]),
+ xtructs = [Goodbye]
+ },
- Looney = #'thrift.test.Insanity'{},
+ Looney = #'Insanity'{},
FirstMap = dict:from_list([{?THRIFT_TEST_NUMBERZ_TWO, Insanity},
{?THRIFT_TEST_NUMBERZ_THREE, Insanity}]),
@@ -196,16 +196,16 @@
is_integer(Arg5) ->
io:format("testMulti(~p)~n", [Args]),
- {reply, #'thrift.test.Xtruct'{string_thing = <<"Hello2">>,
- byte_thing = Arg0,
- i32_thing = Arg1,
- i64_thing = Arg2}};
+ {reply, #'Xtruct'{string_thing = <<"Hello2">>,
+ byte_thing = Arg0,
+ i32_thing = Arg1,
+ i64_thing = Arg2}};
handle_function(testException, {String}) when is_binary(String) ->
io:format("testException(~p)~n", [String]),
case String of
<<"Xception">> ->
- throw(#'thrift.test.Xception'{errorCode = 1001,
+ throw(#'Xception'{errorCode = 1001,
message = String});
<<"TException">> ->
throw({?TApplicationException_Structure});
@@ -217,14 +217,14 @@
io:format("testMultiException(~p, ~p)~n", [Arg0, Arg1]),
case Arg0 of
<<"Xception">> ->
- throw(#'thrift.test.Xception'{errorCode = 1001,
+ throw(#'Xception'{errorCode = 1001,
message = <<"This is an Xception">>});
<<"Xception2">> ->
- throw(#'thrift.test.Xception2'{errorCode = 2002,
+ throw(#'Xception2'{errorCode = 2002,
struct_thing =
- #'thrift.test.Xtruct'{string_thing = <<"This is an Xception2">>}});
+ #'Xtruct'{string_thing = <<"This is an Xception2">>}});
_ ->
- {reply, #'thrift.test.Xtruct'{string_thing = Arg1}}
+ {reply, #'Xtruct'{string_thing = Arg1}}
end;
handle_function(testOneway, {Seconds}) ->