diff options
author | Ted Ross <tross@apache.org> | 2010-01-13 11:57:19 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2010-01-13 11:57:19 +0000 |
commit | fd64f22be60f12e03df8974b547cd9b3af331601 (patch) | |
tree | e2d9cafd894623102b5b1384d00af75db4dc88ff /qpid/cpp/bindings/qmf/tests/python_console.py | |
parent | 26280399738211de3f472b625091ff22c762538b (diff) | |
download | qpid-python-fd64f22be60f12e03df8974b547cd9b3af331601.tar.gz |
Added raise_event support to the Ruby and Python wrapped agent APIs.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@898727 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/bindings/qmf/tests/python_console.py')
-rwxr-xr-x | qpid/cpp/bindings/qmf/tests/python_console.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/qpid/cpp/bindings/qmf/tests/python_console.py b/qpid/cpp/bindings/qmf/tests/python_console.py index 6f366d1a3d..fe27c33c4b 100755 --- a/qpid/cpp/bindings/qmf/tests/python_console.py +++ b/qpid/cpp/bindings/qmf/tests/python_console.py @@ -23,6 +23,7 @@ from qpid.testlib import TestBase010 from qpid.datatypes import Message from qpid.queue import Empty from time import sleep +import qmf.console class QmfInteropTests(TestBase010): @@ -166,6 +167,43 @@ class QmfInteropTests(TestBase010): for binding in bindings: self.assertEqual(binding.exchangeRef, mgmt_exchange.getObjectId()) + def test_F_events(self): + class Handler(qmf.console.Console): + def __init__(self): + self.queue = [] + + def event(self, broker, event): + if event.getClassKey().getClassName() == "test_event": + self.queue.append(event) + + handler = Handler() + self.startQmf(handler) + + parents = self.qmf.getObjects(_class="parent") + self.assertEqual(len(parents), 1) + parent = parents[0] + + parent.set_numerics("big") + parent.set_numerics("small") + parent.set_numerics("negative") + parent.set_short_string("TEST") + parent.set_long_string("LONG_TEST") + parent.probe_userid() + + queue = handler.queue + self.assertEqual(len(queue), 5) + self.assertEqual(queue[0].arguments["uint32val"], 0xA5A55A5A) + self.assertEqual(queue[0].arguments["strval"], "Unused") + self.assertEqual(queue[1].arguments["uint32val"], 5) + self.assertEqual(queue[1].arguments["strval"], "Unused") + self.assertEqual(queue[2].arguments["uint32val"], 0) + self.assertEqual(queue[2].arguments["strval"], "Unused") + self.assertEqual(queue[3].arguments["uint32val"], 0) + self.assertEqual(queue[3].arguments["strval"], "TEST") + self.assertEqual(queue[4].arguments["uint32val"], 0) + self.assertEqual(queue[4].arguments["strval"], "LONG_TEST") + + def getProperty(self, msg, name): for h in msg.headers: if hasattr(h, name): return getattr(h, name) |