diff options
author | Gordon Sim <gsim@apache.org> | 2009-11-19 22:07:43 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2009-11-19 22:07:43 +0000 |
commit | 4e7097e788097ffa50ff0a13ba13ee2d137f70ca (patch) | |
tree | 0205275c1f431256505e87df33d3ca216ae46e3f | |
parent | 9d53c2a6e04e436f19388a18a8481b2822dd4595 (diff) | |
download | qpid-python-4e7097e788097ffa50ff0a13ba13ee2d137f70ca.tar.gz |
In exchange-bound, set queue-not-found correctly even if exchange is not found.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@882322 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | cpp/src/qpid/broker/SessionAdapter.cpp | 2 | ||||
-rw-r--r-- | python/tests_0-10/query.py | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/SessionAdapter.cpp b/cpp/src/qpid/broker/SessionAdapter.cpp index 5e5d79343a..a7743d95ab 100644 --- a/cpp/src/qpid/broker/SessionAdapter.cpp +++ b/cpp/src/qpid/broker/SessionAdapter.cpp @@ -256,7 +256,7 @@ ExchangeBoundResult SessionAdapter::ExchangeHandlerImpl::bound(const std::string } if (!exchange) { - return ExchangeBoundResult(true, false, false, false, false); + return ExchangeBoundResult(true, (!queueName.empty() && !queue), false, false, false); } else if (!queueName.empty() && !queue) { return ExchangeBoundResult(false, true, false, false, false); } else if (exchange->isBound(queue, key.empty() ? 0 : &key, args.count() > 0 ? &args : &args)) { diff --git a/python/tests_0-10/query.py b/python/tests_0-10/query.py index 311df84096..d57e964982 100644 --- a/python/tests_0-10/query.py +++ b/python/tests_0-10/query.py @@ -133,8 +133,20 @@ class QueryTests(TestBase010): #test exchange not found self.assertEqual(True, session.exchange_bound(exchange="unknown-exchange").exchange_not_found) - #test queue not found - self.assertEqual(True, session.exchange_bound(exchange=exchange_name, queue="unknown-queue").queue_not_found) + #test exchange found, queue not found + response = session.exchange_bound(exchange=exchange_name, queue="unknown-queue") + self.assertEqual(False, response.exchange_not_found) + self.assertEqual(True, response.queue_not_found) + + #test exchange not found, queue found + response = session.exchange_bound(exchange="unknown-exchange", queue="used-queue") + self.assertEqual(True, response.exchange_not_found) + self.assertEqual(False, response.queue_not_found) + + #test not exchange found, queue not found + response = session.exchange_bound(exchange="unknown-exchange", queue="unknown-queue") + self.assertEqual(True, response.exchange_not_found) + self.assertEqual(True, response.queue_not_found) def test_exchange_bound_fanout(self): |