summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2012-11-20 16:54:53 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2012-11-20 16:54:53 +0000
commit1d1bae42b0e1eba071f8893935761e8a9c02373e (patch)
tree6a694bbae984aa69bb42e106b906922f131c0135 /src
parentb8a7a8dd6af079d250d187af7341a0085a89f112 (diff)
downloadrabbitmq-server-git-1d1bae42b0e1eba071f8893935761e8a9c02373e.tar.gz
add test of vq:drop
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_tests.erl15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl
index 096f949061..444c737521 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,