From 700636714d25b073bdfea2d982b5f67f11b240e9 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Thu, 15 Oct 2009 21:38:07 +0000 Subject: Bug fix: Console sent get-requests (by objectId) to all agents, not just the agent identified in the objectId. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@825672 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/bindings/qmf/tests/python_console.py | 11 +++++++++++ qpid/cpp/bindings/qmf/tests/ruby_console_test.rb | 15 +++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'qpid/cpp/bindings') diff --git a/qpid/cpp/bindings/qmf/tests/python_console.py b/qpid/cpp/bindings/qmf/tests/python_console.py index bcd3063fe3..e7fa78f3a2 100755 --- a/qpid/cpp/bindings/qmf/tests/python_console.py +++ b/qpid/cpp/bindings/qmf/tests/python_console.py @@ -140,6 +140,17 @@ class QmfInteropTests(TestBase010): self.assertEqual(result.status, 0) self.assertEqual(result.userid, "guest") + def test_D_get_by_object_id(self): + self.startQmf() + qmf = self.qmf + + parents = qmf.getObjects(_class="parent") + self.assertEqual(len(parents), 1) + parent = parents[0] + + newList = qmf.getObjects(_objectId=parent.getObjectId()) + self.assertEqual(len(newList), 1) + def getProperty(self, msg, name): for h in msg.headers: if hasattr(h, name): return getattr(h, name) diff --git a/qpid/cpp/bindings/qmf/tests/ruby_console_test.rb b/qpid/cpp/bindings/qmf/tests/ruby_console_test.rb index b72c8e3806..e0440367c5 100755 --- a/qpid/cpp/bindings/qmf/tests/ruby_console_test.rb +++ b/qpid/cpp/bindings/qmf/tests/ruby_console_test.rb @@ -186,6 +186,21 @@ class ConsoleTest < ConsoleTestBase assert_equal(result.args.userid, "anonymous") end + def test_D_get_by_object_id + parent = @qmfc.object(:class => "parent") + assert(parent, "Number of parent objects") + + list = @qmfc.objects(:object_id => parent.object_id) + assert_equal(list.size, 1) + + bad_oid = Qmf::ObjectId.new + list = @qmfc.objects(:object_id => bad_oid) + assert_equal(list.size, 0) + + # TODO: test a bad_oid that has an agent-bank that is not associated with an attached agent. + + end + end app = ConsoleTest.new -- cgit v1.2.1