summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@lshift.net>2010-02-04 18:07:24 +0000
committerMatthias Radestock <matthias@lshift.net>2010-02-04 18:07:24 +0000
commit60fad080c4d98bbadeae1d02b9ee7397bacfd834 (patch)
tree2cfe19267556179881f50a3b3a945a41e12ab704
parentc84b88f5ab255b801af90b1cfc7b329bf3180615 (diff)
downloadrabbitmq-server-60fad080c4d98bbadeae1d02b9ee7397bacfd834.tar.gz
test for list_consumers
-rw-r--r--src/rabbit_tests.erl18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl
index d4eb3ade..2a580b98 100644
--- a/src/rabbit_tests.erl
+++ b/src/rabbit_tests.erl
@@ -712,10 +712,15 @@ test_user_management() ->
test_server_status() ->
- %% create a queue so we have something to list
+ %% create a few things so there is some useful information to list
+ Writer = spawn(fun () -> receive shutdown -> ok end end),
+ Ch = rabbit_channel:start_link(1, self(), Writer, <<"user">>, <<"/">>),
Q = #amqqueue{} = rabbit_amqqueue:declare(
rabbit_misc:r(<<"/">>, queue, <<"foo">>),
false, false, []),
+ ok = rabbit_amqqueue:claim_queue(Q, self()),
+ ok = rabbit_amqqueue:basic_consume(Q, true, self(), Ch, undefined,
+ <<"ctag">>, true, undefined),
%% list queues
ok = info_action(list_queues, rabbit_amqqueue:info_keys(), true),
@@ -726,9 +731,6 @@ test_server_status() ->
%% list bindings
ok = control_action(list_bindings, []),
- %% cleanup
- {ok, _} = rabbit_amqqueue:delete(Q, false, false),
-
%% list connections
[#listener{host = H, port = P} | _] =
[L || L = #listener{node = N} <- rabbit_networking:active_listeners(),
@@ -741,9 +743,13 @@ test_server_status() ->
ok = gen_tcp:close(C),
%% list channels
- Writer = spawn(fun () -> receive shutdown -> ok end end),
- Ch = rabbit_channel:start_link(1, self(), Writer, <<"user">>, <<"/">>),
ok = info_action(list_channels, rabbit_channel:info_keys(), false),
+
+ %% list consumers
+ ok = control_action(list_consumers, []),
+
+ %% cleanup
+ {ok, _} = rabbit_amqqueue:delete(Q, false, false),
ok = rabbit_channel:shutdown(Ch),
passed.