diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2012-11-20 16:54:53 +0000 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2012-11-20 16:54:53 +0000 |
commit | a7cd61e79c5ab447f1c02530096610f0021ceef6 (patch) | |
tree | 6a694bbae984aa69bb42e106b906922f131c0135 | |
parent | 17d021928a1bdfcff280fe1e6c44d5556cbf3bf1 (diff) | |
download | rabbitmq-server-a7cd61e79c5ab447f1c02530096610f0021ceef6.tar.gz |
add test of vq:drop
-rw-r--r-- | src/rabbit_tests.erl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl index 096f9490..444c7375 100644 --- a/src/rabbit_tests.erl +++ b/src/rabbit_tests.erl @@ -2300,6 +2300,7 @@ test_variable_queue() -> fun test_variable_queue_partial_segments_delta_thing/1, fun test_variable_queue_all_the_bits_not_covered_elsewhere1/1, fun test_variable_queue_all_the_bits_not_covered_elsewhere2/1, + fun test_drop/1, fun test_dropwhile/1, fun test_dropwhile_varying_ram_duration/1, fun test_variable_queue_ack_limiting/1, @@ -2361,6 +2362,20 @@ test_variable_queue_ack_limiting(VQ0) -> VQ6. +test_drop(VQ0) -> + %% start by sending a messages + VQ1 = variable_queue_publish(false, 1, VQ0), + %% drop message with AckRequired = true + {{MsgId, AckTag, 0}, VQ2} = rabbit_variable_queue:drop(true, VQ1), + true = AckTag =/= undefinded, + %% drop again -> empty + {empty, VQ3} = rabbit_variable_queue:drop(false, VQ2), + %% requeue + {[MsgId], VQ4} = rabbit_variable_queue:requeue([AckTag], VQ3), + %% drop message with AckRequired = false + {{MsgId, undefined, 0}, VQ5} = rabbit_variable_queue:drop(false, VQ4), + VQ5. + test_dropwhile(VQ0) -> Count = 10, |