summaryrefslogtreecommitdiff
path: root/cpp/bindings/qmf/tests
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2009-12-04 18:59:29 +0000
committerTed Ross <tross@apache.org>2009-12-04 18:59:29 +0000
commit66576cdc558e8d5cbb95ed70e851005b4273a0ae (patch)
treed76ba568575bf0de335ca67634652d272a75fadf /cpp/bindings/qmf/tests
parent0e1be326677cf7540d7006efc5f9bad9f47219ce (diff)
downloadqpid-python-66576cdc558e8d5cbb95ed70e851005b4273a0ae.tar.gz
QPID-2246 - QMF - Querying objects using a selector of type ObjectId yields incorrect results
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@887320 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/bindings/qmf/tests')
-rwxr-xr-xcpp/bindings/qmf/tests/agent_ruby.rb4
-rwxr-xr-xcpp/bindings/qmf/tests/python_console.py15
-rwxr-xr-xcpp/bindings/qmf/tests/ruby_console_test.rb16
3 files changed, 31 insertions, 4 deletions
diff --git a/cpp/bindings/qmf/tests/agent_ruby.rb b/cpp/bindings/qmf/tests/agent_ruby.rb
index 426a284e7d..adf91a8b66 100755
--- a/cpp/bindings/qmf/tests/agent_ruby.rb
+++ b/cpp/bindings/qmf/tests/agent_ruby.rb
@@ -83,7 +83,7 @@ end
class App < Qmf::AgentHandler
def get_query(context, query, userId)
-# puts "Query: user=#{userId} context=#{context} class=#{query.class_name} object_num=#{query.object_id.object_num_low if query.object_id}"
+# puts "Query: user=#{userId} context=#{context} class=#{query.class_name} object_num=#{query.object_id if query.object_id}"
if query.class_name == 'parent'
@agent.query_response(context, @parent)
elsif query.object_id == @parent_oid
@@ -93,7 +93,7 @@ class App < Qmf::AgentHandler
end
def method_call(context, name, object_id, args, userId)
-# puts "Method: user=#{userId} context=#{context} method=#{name} object_num=#{object_id.object_num_low if object_id} args=#{args}"
+# puts "Method: user=#{userId} context=#{context} method=#{name} object_num=#{object_id if object_id} args=#{args}"
retCode = 0
retText = "OK"
diff --git a/cpp/bindings/qmf/tests/python_console.py b/cpp/bindings/qmf/tests/python_console.py
index 798e4dddda..6f366d1a3d 100755
--- a/cpp/bindings/qmf/tests/python_console.py
+++ b/cpp/bindings/qmf/tests/python_console.py
@@ -151,6 +151,21 @@ class QmfInteropTests(TestBase010):
newList = qmf.getObjects(_objectId=parent.getObjectId())
self.assertEqual(len(newList), 1)
+ def test_E_filter_by_object_id(self):
+ self.startQmf()
+ qmf = self.qmf
+
+ list = qmf.getObjects(_class="exchange", name="qpid.management")
+ self.assertEqual(len(list), 1, "No Management Exchange")
+ mgmt_exchange = list[0]
+
+ bindings = qmf.getObjects(_class="binding", exchangeRef=mgmt_exchange.getObjectId())
+ if len(bindings) == 0:
+ self.fail("No bindings found on management exchange")
+
+ for binding in bindings:
+ self.assertEqual(binding.exchangeRef, mgmt_exchange.getObjectId())
+
def getProperty(self, msg, name):
for h in msg.headers:
if hasattr(h, name): return getattr(h, name)
diff --git a/cpp/bindings/qmf/tests/ruby_console_test.rb b/cpp/bindings/qmf/tests/ruby_console_test.rb
index 98180a97cd..c5c7b141dd 100755
--- a/cpp/bindings/qmf/tests/ruby_console_test.rb
+++ b/cpp/bindings/qmf/tests/ruby_console_test.rb
@@ -214,9 +214,21 @@ class ConsoleTest < ConsoleTestBase
fail("Didn't find a non-broker agent")
end
-end
+ def test_E_filter_by_object_id
+ mgmt_exchange = @qmfc.object(:class => "exchange", 'name' => "qpid.management")
+ assert(mgmt_exchange, "No Management Exchange")
-app = ConsoleTest.new
+ bindings = @qmfc.objects(:class => "binding", 'exchangeRef' => mgmt_exchange.object_id)
+ if bindings.size == 0
+ fail("No bindings found on management exchange")
+ end
+
+ bindings.each do |binding|
+ assert_equal(binding.exchangeRef, mgmt_exchange.object_id)
+ end
+ end
+end
+app = ConsoleTest.new