summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlvaro Videla <videlalvaro@gmail.com>2015-10-20 11:56:02 +0200
committerAlvaro Videla <videlalvaro@gmail.com>2015-10-20 11:56:02 +0200
commit5a110fd1cb88ccd59cbe334bbde48aa5d0f9705a (patch)
tree23d03a5571591bf900e81c57dbc38e5880716fb7 /test
parent8cc4229802161d0ce4c30114a605f9e2539f413d (diff)
downloadrabbitmq-server-git-5a110fd1cb88ccd59cbe334bbde48aa5d0f9705a.tar.gz
adds policy validator tests
Diffstat (limited to 'test')
-rw-r--r--test/src/rabbit_tests.erl15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/src/rabbit_tests.erl b/test/src/rabbit_tests.erl
index 0c4b869fb0..3343c3567c 100644
--- a/test/src/rabbit_tests.erl
+++ b/test/src/rabbit_tests.erl
@@ -75,6 +75,7 @@ all_tests0() ->
passed = test_policy_opts_validation(),
passed = test_ha_policy_validation(),
passed = test_queue_master_location_policy_validation(),
+ passed = test_queue_modes_policy_validation(),
passed = test_server_status(),
passed = test_amqp_connection_refusal(),
passed = test_confirms(),
@@ -1189,6 +1190,20 @@ test_queue_master_location_policy_validation() ->
ok = control_action(clear_policy, ["name"]),
passed.
+test_queue_modes_policy_validation() ->
+ Set = fun (JSON) ->
+ control_action_opts( ["set_policy", "name", ".*", JSON] )
+ end,
+ OK = fun (JSON) -> ok = Set(JSON) end,
+ Fail = fun (JSON) -> error = Set(JSON) end,
+
+ OK ("{\"queue-mode\":\"lazy\"}"),
+ OK ("{\"queue-mode\":\"default\"}"),
+ FAIL("{\"queue-mode\":\"wrong\"}"),
+
+ ok = control_action(clear_policy, ["name"]),
+ passed.
+
test_server_status() ->
%% create a few things so there is some useful information to list
{_Writer, Limiter, Ch} = test_channel(),