summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2009-09-29 20:20:35 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2009-09-29 20:20:35 +0000
commite7f62aaba09da4fb4c95d67a347db528fae9082f (patch)
tree848b04a83badcffa1f5b3c40c9205a0f7259d470 /cpp/src
parent67a08b32db58b940bb54fba7f76254f11c608907 (diff)
downloadqpid-python-e7f62aaba09da4fb4c95d67a347db528fae9082f.tar.gz
This is related to QPID-2108
I was initially setting the qpid.max_count and qpid.max_size as strings instead of ints as expected by the API. I also incorrectly fetched them as strings on the broker side. This commit fixes acl.py test script to use int values for the above properties and then fetches them appropriately from the broker side. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@820082 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/broker/SessionAdapter.cpp4
-rwxr-xr-xcpp/src/tests/acl.py16
2 files changed, 10 insertions, 10 deletions
diff --git a/cpp/src/qpid/broker/SessionAdapter.cpp b/cpp/src/qpid/broker/SessionAdapter.cpp
index 4ee3a97357..2ac6d66e62 100644
--- a/cpp/src/qpid/broker/SessionAdapter.cpp
+++ b/cpp/src/qpid/broker/SessionAdapter.cpp
@@ -338,8 +338,8 @@ void SessionAdapter::QueueHandlerImpl::declare(const string& name, const string&
params.insert(make_pair(acl::PROP_EXCLUSIVE, std::string(exclusive ? _TRUE : _FALSE)));
params.insert(make_pair(acl::PROP_AUTODELETE, std::string(autoDelete ? _TRUE : _FALSE)));
params.insert(make_pair(acl::PROP_POLICYTYPE, arguments.getAsString("qpid.policy_type")));
- params.insert(make_pair(acl::PROP_MAXQUEUECOUNT, arguments.getAsString("qpid.max_count")));
- params.insert(make_pair(acl::PROP_MAXQUEUESIZE, arguments.getAsString("qpid.max_size")));
+ params.insert(make_pair(acl::PROP_MAXQUEUECOUNT, boost::lexical_cast<string>(arguments.getAsInt("qpid.max_count"))));
+ params.insert(make_pair(acl::PROP_MAXQUEUESIZE, boost::lexical_cast<string>(arguments.getAsInt64("qpid.max_size"))));
if (!acl->authorise(getConnection().getUserId(),acl::ACT_CREATE,acl::OBJ_QUEUE,name,&params) )
throw NotAllowedException(QPID_MSG("ACL denied queue create request from " << getConnection().getUserId()));
diff --git a/cpp/src/tests/acl.py b/cpp/src/tests/acl.py
index e6cfdb56d3..2d776e9941 100755
--- a/cpp/src/tests/acl.py
+++ b/cpp/src/tests/acl.py
@@ -260,8 +260,8 @@ class ACLTests(TestBase010):
try:
queue_options = {}
- queue_options["qpid.max_count"] = "200"
- queue_options["qpid.max_size"] = "500"
+ queue_options["qpid.max_count"] = 200
+ queue_options["qpid.max_size"] = 500
session.queue_declare(queue="q5", exclusive=True, arguments=queue_options)
self.fail("ACL should deny queue create request with name=q2, qpid.max_size=500 and qpid.max_count=200");
except qpid.session.SessionException, e:
@@ -270,8 +270,8 @@ class ACLTests(TestBase010):
try:
queue_options = {}
- queue_options["qpid.max_count"] = "200"
- queue_options["qpid.max_size"] = "100"
+ queue_options["qpid.max_count"] = 200
+ queue_options["qpid.max_size"] = 100
session.queue_declare(queue="q2", exclusive=True, arguments=queue_options)
except qpid.session.SessionException, e:
if (530 == e.args[0].error_code):
@@ -362,8 +362,8 @@ class ACLTests(TestBase010):
try:
queue_options = {}
- queue_options["qpid.max_count"] = "200"
- queue_options["qpid.max_size"] = "500"
+ queue_options["qpid.max_count"] = 200
+ queue_options["qpid.max_size"] = 500
session.queue_declare(queue="q5", arguments=queue_options)
self.fail("ACL should deny queue create request with name=q2 maxqueuesize=500 maxqueuecount=200");
except qpid.session.SessionException, e:
@@ -372,8 +372,8 @@ class ACLTests(TestBase010):
try:
queue_options = {}
- queue_options["qpid.max_count"] = "100"
- queue_options["qpid.max_size"] = "500"
+ queue_options["qpid.max_count"] = 100
+ queue_options["qpid.max_size"] = 500
session.queue_declare(queue="q5", arguments=queue_options)
except qpid.session.SessionException, e:
if (530 == e.args[0].error_code):