You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by dr...@apache.org on 2010/08/31 00:05:49 UTC

svn commit: r990994 - /incubator/thrift/trunk/test/erl/src/test_disklog.erl

Author: dreiss
Date: Mon Aug 30 22:05:49 2010
New Revision: 990994

URL: http://svn.apache.org/viewvc?rev=990994&view=rev
Log:
erlang: Update test_disklog to use the new API

Modified:
    incubator/thrift/trunk/test/erl/src/test_disklog.erl

Modified: incubator/thrift/trunk/test/erl/src/test_disklog.erl
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/test/erl/src/test_disklog.erl?rev=990994&r1=990993&r2=990994&view=diff
==============================================================================
--- incubator/thrift/trunk/test/erl/src/test_disklog.erl (original)
+++ incubator/thrift/trunk/test/erl/src/test_disklog.erl Mon Aug 30 22:05:49 2010
@@ -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.
-    
+