You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ra...@apache.org on 2009/09/29 22:20:35 UTC

svn commit: r820082 - in /qpid/trunk/qpid/cpp/src: qpid/broker/SessionAdapter.cpp tests/acl.py

Author: rajith
Date: Tue Sep 29 20:20:35 2009
New Revision: 820082

URL: http://svn.apache.org/viewvc?rev=820082&view=rev
Log:
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.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp
    qpid/trunk/qpid/cpp/src/tests/acl.py

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp?rev=820082&r1=820081&r2=820082&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp Tue Sep 29 20:20:35 2009
@@ -338,8 +338,8 @@
         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()));

Modified: qpid/trunk/qpid/cpp/src/tests/acl.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/acl.py?rev=820082&r1=820081&r2=820082&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/acl.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/acl.py Tue Sep 29 20:20:35 2009
@@ -260,8 +260,8 @@
 
         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 @@
 
         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 @@
         
         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 @@
 
         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):



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org