[ 
https://issues.apache.org/jira/browse/QPID-6678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14745714#comment-14745714
 ] 

Alex Rudyy commented on QPID-6678:
----------------------------------

Keith,
I addressed your comments 1-3 in commit under revision 
[r1703250|https://svn.apache.org/r1703250].
Additionally, I executed tests from 
tests/src/py/qpid_tests/broker_0_10/alternate_exchange.py against Broker and 
found an issue with not setting "attain state future" when state transition 
fails. I addressed the problem in the same commit.
Regarding, adding tests for exercising 'if-unsed' field, I am hesitating to add 
them as Qpid cpp broker does not support 'if-unsed'. I wrote a test for 0.10 
protocol but did not commit it:
{code}
--- qpid/tests/src/py/qpid_tests/broker_0_10/exchange.py
+++ qpid/tests/src/py/qpid_tests/broker_0_10/exchange.py
@@ -556,3 +556,20 @@ class AutodeleteTests(TestHelper, 
StandardExchangeVerifier):
         self.session.exchange_declare(exchange="e", type="headers", 
auto_delete=True)
         self.verifyHeadersExchange("e", unbind=True)
         self.checkNotExists("e");
+
+
+class DeleteMethodExchangeTests(TestHelper):
+
+    """
+    If 'if-unused' set, the server will only delete the exchange if it has no 
queue bindings.
+    If the exchange has queue bindings the server does not delete it but 
raises an exception instead.
+    """
+    def testDeleteUsedExchangeWhenIfUnusedTrue(self):
+        try:
+            self.session.exchange_declare(exchange="test-exchange", 
type="direct")
+            self.session.queue_declare(queue="test-queue")
+            self.session.exchange_bind(queue="test-queue", 
exchange="test-exchange", binding_key="test-queue")
+            self.session.exchange_delete(exchange="test-exchange", 
if_unused=True)
+            self.fail("Expected 406 for deletion of exchange in use wih 
if-unused=True")
+        except SessionException, e:
+            self.assertEquals(406, e.args[0].error_code)

{code}

Could you please review the changes?

> Deleting an exchange that is referenced as alternate apparently succeeds but 
> marks the exchange as DELETED
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-6678
>                 URL: https://issues.apache.org/jira/browse/QPID-6678
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>    Affects Versions: 0.32, qpid-java-6.0
>            Reporter: Keith Wall
>            Assignee: Alex Rudyy
>         Attachments: 
> 0001-QPID-6678-Deletion-of-exchanges-set-as-alternate-exc.patch
>
>
> If I create two exchanges using the Web Management, exch1 and exch2, and make 
> *exch2* the alternate exchange of *exch1*, I expect to be prevented from 
> deleting exch2 as exch1 refers to it.   This does not happen.  If I delete 
> *exch2* using Management, the operation apparently succeeds, but the object 
> is recorded in the store as having desiredState DELETED.  If I then go on to 
> restart the Broker, the exchange is removed from the store.  If I restart the 
> Broker a second time, the VH goes into ERROR state as exch1 has a 
> non-existent alternate exchange.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to