diff options
| author | Ted Ross <tross@apache.org> | 2009-12-04 18:59:29 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2009-12-04 18:59:29 +0000 |
| commit | 66576cdc558e8d5cbb95ed70e851005b4273a0ae (patch) | |
| tree | d76ba568575bf0de335ca67634652d272a75fadf /cpp/bindings | |
| parent | 0e1be326677cf7540d7006efc5f9bad9f47219ce (diff) | |
| download | qpid-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')
| -rw-r--r-- | cpp/bindings/qmf/python/qmf.py | 5 | ||||
| -rw-r--r-- | cpp/bindings/qmf/ruby/qmf.rb | 3 | ||||
| -rwxr-xr-x | cpp/bindings/qmf/tests/agent_ruby.rb | 4 | ||||
| -rwxr-xr-x | cpp/bindings/qmf/tests/python_console.py | 15 | ||||
| -rwxr-xr-x | cpp/bindings/qmf/tests/ruby_console_test.rb | 16 |
5 files changed, 33 insertions, 10 deletions
diff --git a/cpp/bindings/qmf/python/qmf.py b/cpp/bindings/qmf/python/qmf.py index e97279a8fa..233f1c83d8 100644 --- a/cpp/bindings/qmf/python/qmf.py +++ b/cpp/bindings/qmf/python/qmf.py @@ -35,7 +35,6 @@ from qmfengine import (TYPE_ABSTIME, TYPE_ARRAY, TYPE_BOOL, TYPE_DELTATIME, from qmfengine import (O_EQ, O_NE, O_LT, O_LE, O_GT, O_GE, O_RE_MATCH, O_RE_NOMATCH, E_NOT, E_AND, E_OR, E_XOR) - ##============================================================================== ## CONNECTION ##============================================================================== @@ -561,9 +560,7 @@ class ObjectId: def __eq__(self, other): if not isinstance(other, self.__class__): return False - return (self.impl.getObjectNumHi() == other.impl.getObjectNumHi() and - self.impl.getObjectNumLo() == other.impl.getObjectNumLo()) - + return self.impl == other.impl def __ne__(self, other): return not self.__eq__(other) diff --git a/cpp/bindings/qmf/ruby/qmf.rb b/cpp/bindings/qmf/ruby/qmf.rb index b52f2bce5e..857dd64aeb 100644 --- a/cpp/bindings/qmf/ruby/qmf.rb +++ b/cpp/bindings/qmf/ruby/qmf.rb @@ -472,8 +472,7 @@ module Qmf end def ==(other) - return (@impl.getObjectNumHi == other.impl.getObjectNumHi) && - (@impl.getObjectNumLo == other.impl.getObjectNumLo) + return @impl == other.impl end def to_s 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 |
