diff options
author | David Reiss <dreiss@apache.org> | 2010-08-30 22:05:49 +0000 |
---|---|---|
committer | David Reiss <dreiss@apache.org> | 2010-08-30 22:05:49 +0000 |
commit | 01c6d61ebdc4f8206c79695ea93ae9fc90d9bbc3 (patch) | |
tree | eac800fe86dd40efce9b3ac8798d3892a1cbf04a /test/erl | |
parent | f28f23d5b7fb08743c7a88b0f79cad69f604c013 (diff) | |
download | thrift-01c6d61ebdc4f8206c79695ea93ae9fc90d9bbc3.tar.gz |
erlang: Update test_disklog to use the new API
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990994 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/erl')
-rw-r--r-- | test/erl/src/test_disklog.erl | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/test/erl/src/test_disklog.erl b/test/erl/src/test_disklog.erl index 7b0be72db..fc0dcf867 100644 --- a/test/erl/src/test_disklog.erl +++ b/test/erl/src/test_disklog.erl @@ -29,20 +29,21 @@ t() -> {size, {1024*1024, 10}}]), {ok, ProtocolFactory} = thrift_binary_protocol:new_protocol_factory( TransportFactory, []), - {ok, Client} = thrift_client:start_link(ProtocolFactory, thriftTest_thrift), + {ok, Proto} = ProtocolFactory(), + {ok, Client0} = thrift_client:new(Proto, thriftTest_thrift), io:format("Client started~n"), % We have to make oneway calls into this client only since otherwise it will try % to read from the disklog and go boom. - {ok, ok} = thrift_client:call(Client, testOneway, [16#deadbeef]), + {Client1, {ok, ok}} = thrift_client:call(Client0, testOneway, [16#deadbeef]), io:format("Call written~n"), % Use the send_call method to write a non-oneway call into the log - ok = thrift_client:send_call(Client, testString, [<<"hello world">>]), + {Client2, ok} = thrift_client:send_call(Client1, testString, [<<"hello world">>]), io:format("Non-oneway call sent~n"), - ok = thrift_client:close(Client), + {_Client3, ok} = thrift_client:close(Client2), io:format("Client closed~n"), ok. @@ -61,21 +62,22 @@ t_base64() -> thrift_buffered_transport:new_transport_factory(B64Factory), {ok, ProtocolFactory} = thrift_binary_protocol:new_protocol_factory( BufFactory, []), - {ok, Client} = thrift_client:start_link(ProtocolFactory, thriftTest_thrift), + {ok, Proto} = ProtocolFactory(), + {ok, Client0} = thrift_client:new(Proto, thriftTest_thrift), io:format("Client started~n"), % We have to make oneway calls into this client only since otherwise it will try % to read from the disklog and go boom. - {ok, ok} = thrift_client:call(Client, testOneway, [16#deadbeef]), + {Client1, {ok, ok}} = thrift_client:call(Client0, testOneway, [16#deadbeef]), io:format("Call written~n"), % Use the send_call method to write a non-oneway call into the log - ok = thrift_client:send_call(Client, testString, [<<"hello world">>]), + {Client2, ok} = thrift_client:send_call(Client1, testString, [<<"hello world">>]), io:format("Non-oneway call sent~n"), - ok = thrift_client:close(Client), + {_Client3, ok} = thrift_client:close(Client2), io:format("Client closed~n"), ok. - + |