Added some tests for coordinator
This commit is contained in:
parent
94d9dc6d7f
commit
654aa837dd
2 changed files with 21 additions and 2 deletions
16
tests/ggs_coordinator_test.erl
Normal file
16
tests/ggs_coordinator_test.erl
Normal file
|
@ -0,0 +1,16 @@
|
|||
-module(ggs_coordinator_test).
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
|
||||
start_link_test() ->
|
||||
{ok, Coord} = ggs_coordinator:start_link(), % Start
|
||||
PInfo = erlang:process_info(Coord), % Check process info
|
||||
ggs_coordinator:stop(""), % Clean up
|
||||
timer:sleep(100), % Wait for cleaning..
|
||||
?assert((PInfo /= undefined)). % Did the server start?
|
||||
|
||||
stop_test() ->
|
||||
ok = ggs_coordinator:stop(""), % Extra cleaning
|
||||
{ok, Coord} = ggs_coordinator:start_link(), % Start server
|
||||
ggs_coordinator:stop("Terminate now"), % Send stop message
|
||||
timer:sleep(100), % Wait for cleaning..
|
||||
?assert((erlang:process_info(Coord) == undefined)). % Did it stop?
|
Reference in a new issue