Commits / 875bf5e
Default avatar Andy Gross committed (raw commit)

test for riak_doorbell:knock

Comments (0)

Files changed (1)

src/riak_doorbell.erl

 -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
 	 terminate/2, code_change/3]).
 -export([ring/2,knock/3]).
+
+-include_lib("eunit/include/eunit.hrl").
 	 
 -record(state, {port, sock}).
 
 %% @private
 code_change(_OldVsn, State, _Extra) ->  {ok, State}.
 
+knock_test() ->
+    application:set_env(riak, doorbell_port, 9001),
+    application:set_env(riak, riak_cookie, default_riak_cookie),
+    {ok, _Pid} = riak_doorbell:start_link(),
+    Nonce = riak_doorbell:knock("127.0.0.1", 9001, default_riak_cookie),
+    receive
+        {riak_connect, Nonce, _} ->
+            ok
+    after 1000 ->
+            throw(knock_test_timeout)
+    end.
+       
+    
+            
+    
+
+    
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.