You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2015/06/18 19:41:08 UTC

svn commit: r1686284 - /qpid/trunk/qpid/tests/src/py/qpid_tests/broker_0_10/exchange.py

Author: kwall
Date: Thu Jun 18 17:41:08 2015
New Revision: 1686284

URL: http://svn.apache.org/r1686284
Log:
QPID-6599: [Python Tests AMQP 0-10] Supporting test for Java Broker Defect

Verify that it is possible to declare a reserved exchange with the same type, conversely
verify that attempting to redeclare an reserved exchange with a different type causes error.

Modified:
    qpid/trunk/qpid/tests/src/py/qpid_tests/broker_0_10/exchange.py

Modified: qpid/trunk/qpid/tests/src/py/qpid_tests/broker_0_10/exchange.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/tests/src/py/qpid_tests/broker_0_10/exchange.py?rev=1686284&r1=1686283&r2=1686284&view=diff
==============================================================================
--- qpid/trunk/qpid/tests/src/py/qpid_tests/broker_0_10/exchange.py (original)
+++ qpid/trunk/qpid/tests/src/py/qpid_tests/broker_0_10/exchange.py Thu Jun 18 17:41:08 2015
@@ -96,8 +96,9 @@ class TestHelper(TestBase010):
                          auto_delete=False,
                          arguments={}):
         session = session or self.session
-        reply = session.exchange_declare(exchange=exchange, type=type, passive=passive,durable=durable, auto_delete=auto_delete, arguments=arguments)
-        self.exchanges.append((session,exchange))
+        reply = session.exchange_declare(exchange=exchange, type=type, passive=passive, durable=durable, auto_delete=auto_delete, arguments=arguments)
+        if exchange and not exchange.startswith("amq."):
+          self.exchanges.append((session,exchange))
         return reply
 
     def uniqueString(self):
@@ -482,6 +483,17 @@ class MiscellaneousErrorsTests(TestHelpe
             self.fail("Expected 530 for redeclaration of exchange with different type.")
         except SessionException, e:
             self.assertEquals(530, e.args[0].error_code)
+
+    def testReservedExchangeRedeclaredSameType(self):
+        self.exchange_declare(exchange="amq.direct", type="direct", passive=False)
+        self.exchange_declare(exchange="amq.direct", type="direct", passive=True)
+
+    def testReservedExchangeRedeclaredDifferentType(self):
+        try:
+            self.exchange_declare(exchange="amq.direct", type="topic")
+            self.fail("Expected 530 for redeclaration of exchange with different type.")
+        except SessionException, e:
+            self.assertEquals(530, e.args[0].error_code)
 
     def testDefaultAccessBind(self):
         try:



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Re: svn commit: r1686284 - /qpid/trunk/qpid/tests/src/py/qpid_tests/broker_0_10/exchange.py

Posted by Gordon Sim <gs...@redhat.com>.
On 06/18/2015 06:41 PM, kwall@apache.org wrote:
> Author: kwall
> Date: Thu Jun 18 17:41:08 2015
> New Revision: 1686284
>
> URL: http://svn.apache.org/r1686284
> Log:
> QPID-6599: [Python Tests AMQP 0-10] Supporting test for Java Broker Defect
>
> Verify that it is possible to declare a reserved exchange with the same type, conversely
> verify that attempting to redeclare an reserved exchange with a different type causes error.
>
> Modified:
>      qpid/trunk/qpid/tests/src/py/qpid_tests/broker_0_10/exchange.py
>
> Modified: qpid/trunk/qpid/tests/src/py/qpid_tests/broker_0_10/exchange.py
> URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/tests/src/py/qpid_tests/broker_0_10/exchange.py?rev=1686284&r1=1686283&r2=1686284&view=diff
> ==============================================================================
> --- qpid/trunk/qpid/tests/src/py/qpid_tests/broker_0_10/exchange.py (original)
> +++ qpid/trunk/qpid/tests/src/py/qpid_tests/broker_0_10/exchange.py Thu Jun 18 17:41:08 2015
> @@ -96,8 +96,9 @@ class TestHelper(TestBase010):
>                            auto_delete=False,
>                            arguments={}):
>           session = session or self.session
> -        reply = session.exchange_declare(exchange=exchange, type=type, passive=passive,durable=durable, auto_delete=auto_delete, arguments=arguments)
> -        self.exchanges.append((session,exchange))
> +        reply = session.exchange_declare(exchange=exchange, type=type, passive=passive, durable=durable, auto_delete=auto_delete, arguments=arguments)
> +        if exchange and not exchange.startswith("amq."):
> +          self.exchanges.append((session,exchange))
>           return reply
>
>       def uniqueString(self):
> @@ -482,6 +483,17 @@ class MiscellaneousErrorsTests(TestHelpe
>               self.fail("Expected 530 for redeclaration of exchange with different type.")
>           except SessionException, e:
>               self.assertEquals(530, e.args[0].error_code)
> +
> +    def testReservedExchangeRedeclaredSameType(self):
> +        self.exchange_declare(exchange="amq.direct", type="direct", passive=False)

I think this test is wrong. The spec states:

     Exchange names starting with "amq." are reserved for pre-declared
     and standardized exchanges. The client MUST NOT attempt to create
     an exchange starting with "amq.".

Which in my view means that a non-passive declare of any exchange with 
the 'amq.' prefix is illegal, since that is a request to create if it 
does not exist.

> +        self.exchange_declare(exchange="amq.direct", type="direct", passive=True)

This is ok, the passive declare is merely asserting that the exchange is 
there.

> +
> +    def testReservedExchangeRedeclaredDifferentType(self):
> +        try:
> +            self.exchange_declare(exchange="amq.direct", type="topic")
> +            self.fail("Expected 530 for redeclaration of exchange with different type.")
> +        except SessionException, e:
> +            self.assertEquals(530, e.args[0].error_code)
>
>       def testDefaultAccessBind(self):
>           try:
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
> For additional commands, e-mail: commits-help@qpid.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org