diff options
author | Kenneth Anthony Giusti <kgiusti@apache.org> | 2010-01-25 17:58:11 +0000 |
---|---|---|
committer | Kenneth Anthony Giusti <kgiusti@apache.org> | 2010-01-25 17:58:11 +0000 |
commit | 6536b1dcdee2da5db3554d47aa1cd694e8cb8f11 (patch) | |
tree | b027c46ac6fc490d1faeebeb7ea34f5bd63ea752 | |
parent | fadd169527df40c715e549f538d256fc23bab3da (diff) | |
download | qpid-python-qmfv2.tar.gz |
QPID-2261: fix path to modules.qmfv2
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/qmfv2@902894 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/python/qmf2/__init__.py | 18 | ||||
-rw-r--r-- | qpid/python/qmf2/tests/agent_discovery.py | 30 | ||||
-rw-r--r-- | qpid/python/qmf2/tests/basic_method.py | 12 | ||||
-rw-r--r-- | qpid/python/qmf2/tests/basic_query.py | 10 | ||||
-rw-r--r-- | qpid/python/qmf2/tests/events.py | 6 | ||||
-rw-r--r-- | qpid/python/qmf2/tests/obj_gets.py | 6 |
6 files changed, 50 insertions, 32 deletions
diff --git a/qpid/python/qmf2/__init__.py b/qpid/python/qmf2/__init__.py new file mode 100644 index 0000000000..31d5a2ef58 --- /dev/null +++ b/qpid/python/qmf2/__init__.py @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# diff --git a/qpid/python/qmf2/tests/agent_discovery.py b/qpid/python/qmf2/tests/agent_discovery.py index 19ed79cbc2..3c530cc060 100644 --- a/qpid/python/qmf2/tests/agent_discovery.py +++ b/qpid/python/qmf2/tests/agent_discovery.py @@ -25,7 +25,7 @@ import qmf2.console import qmf2.agent -class _testNotifier(qmf.qmfCommon.Notifier): +class _testNotifier(qmf2.common.Notifier): def __init__(self): self._event = Event() @@ -48,7 +48,7 @@ class _agentApp(Thread): def __init__(self, name, heartbeat): Thread.__init__(self) self.notifier = _testNotifier() - self.agent = qmf.qmfAgent.Agent(name, + self.agent = qmf2.agent.Agent(name, _notifier=self.notifier, _heartbeat_interval=heartbeat) # No database needed for this test @@ -118,7 +118,7 @@ class BaseTest(unittest.TestCase): # wait # expect agent add for agent1 and agent2 self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier, + self.console = qmf2.console.Console(notifier=self.notifier, agent_timeout=3) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, @@ -133,7 +133,7 @@ class BaseTest(unittest.TestCase): while wi and not (agent1_found and agent2_found): if wi.get_type() == wi.AGENT_ADDED: agent = wi.get_params().get("agent") - if not agent or not isinstance(agent, qmf.qmfConsole.Agent): + if not agent or not isinstance(agent, qmf2.console.Agent): self.fail("Unexpected workitem from agent") else: if agent.get_name() == "agent1": @@ -159,7 +159,7 @@ class BaseTest(unittest.TestCase): # wait until timeout # expect agent add for agent1 only self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier, + self.console = qmf2.console.Console(notifier=self.notifier, agent_timeout=3) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, @@ -168,10 +168,10 @@ class BaseTest(unittest.TestCase): self.conn.connect() self.console.addConnection(self.conn) - query = qmf.qmfCommon.QmfQuery.create_predicate( - qmf.qmfCommon.QmfQuery.TARGET_AGENT, - qmf.qmfCommon.QmfQueryPredicate({qmf.qmfCommon.QmfQuery.CMP_EQ: - [qmf.qmfCommon.QmfQuery.KEY_AGENT_NAME, "agent1"]})) + query = qmf2.common.QmfQuery.create_predicate( + qmf2.common.QmfQuery.TARGET_AGENT, + qmf2.common.QmfQueryPredicate({qmf2.common.QmfQuery.CMP_EQ: + [qmf2.common.QmfQuery.KEY_AGENT_NAME, "agent1"]})) self.console.enable_agent_discovery(query) agent1_found = agent2_found = False @@ -179,7 +179,7 @@ class BaseTest(unittest.TestCase): while wi: if wi.get_type() == wi.AGENT_ADDED: agent = wi.get_params().get("agent") - if not agent or not isinstance(agent, qmf.qmfConsole.Agent): + if not agent or not isinstance(agent, qmf2.console.Agent): self.fail("Unexpected workitem from agent") else: if agent.get_name() == "agent1": @@ -203,7 +203,7 @@ class BaseTest(unittest.TestCase): # stop agent1, expect timeout notification # stop agent2, expect timeout notification self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier, + self.console = qmf2.console.Console(notifier=self.notifier, agent_timeout=2) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, @@ -218,7 +218,7 @@ class BaseTest(unittest.TestCase): while wi and not (agent1_found and agent2_found): if wi.get_type() == wi.AGENT_ADDED: agent = wi.get_params().get("agent") - if not agent or not isinstance(agent, qmf.qmfConsole.Agent): + if not agent or not isinstance(agent, qmf2.console.Agent): self.fail("Unexpected workitem from agent") else: if agent.get_name() == "agent1": @@ -246,7 +246,7 @@ class BaseTest(unittest.TestCase): while wi is not None: if wi.get_type() == wi.AGENT_DELETED: agent = wi.get_params().get("agent") - if not agent or not isinstance(agent, qmf.qmfConsole.Agent): + if not agent or not isinstance(agent, qmf2.console.Agent): self.fail("Unexpected workitem from agent") else: if agent.get_name() == "agent1": @@ -272,7 +272,7 @@ class BaseTest(unittest.TestCase): while wi is not None: if wi.get_type() == wi.AGENT_DELETED: agent = wi.get_params().get("agent") - if not agent or not isinstance(agent, qmf.qmfConsole.Agent): + if not agent or not isinstance(agent, qmf2.console.Agent): self.fail("Unexpected workitem from agent") else: if agent.get_name() == "agent2": @@ -297,7 +297,7 @@ class BaseTest(unittest.TestCase): # find agent-none, expect failure # find agent2, expect success self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier) + self.console = qmf2.console.Console(notifier=self.notifier) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, self.broker.user, diff --git a/qpid/python/qmf2/tests/basic_method.py b/qpid/python/qmf2/tests/basic_method.py index c5098b5d72..a054a769d0 100644 --- a/qpid/python/qmf2/tests/basic_method.py +++ b/qpid/python/qmf2/tests/basic_method.py @@ -228,8 +228,8 @@ class BaseTest(unittest.TestCase): # synchronous query for all objects in schema # method call on each object self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier, - agent_timeout=3) + self.console = qmf2.console.Console(notifier=self.notifier, + agent_timeout=3) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, self.broker.user, @@ -254,7 +254,7 @@ class BaseTest(unittest.TestCase): mr = obj.invoke_method( "set_meth", {"arg_int": -99, "arg_str": "Now set!"}, _timeout=3) - self.assertTrue(isinstance(mr, qmf.qmfConsole.MethodResult)) + self.assertTrue(isinstance(mr, qmf2.console.MethodResult)) self.assertTrue(mr.succeeded()) self.assertTrue(mr.get_argument("code") == 0) @@ -278,7 +278,7 @@ class BaseTest(unittest.TestCase): # invalid method call on each object # - should throw a ValueError self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier, + self.console = qmf2.console.Console(notifier=self.notifier, agent_timeout=3) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, @@ -315,7 +315,7 @@ class BaseTest(unittest.TestCase): # synchronous query for a managed object # method call on each object self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier, + self.console = qmf2.console.Console(notifier=self.notifier, agent_timeout=3) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, @@ -340,7 +340,7 @@ class BaseTest(unittest.TestCase): "arg2": "Now set!", "arg3": 1966}, _timeout=3) - self.assertTrue(isinstance(mr, qmf.qmfConsole.MethodResult)) + self.assertTrue(isinstance(mr, qmf2.console.MethodResult)) self.assertTrue(mr.succeeded()) self.assertTrue(mr.get_argument("code") == 0) # @todo refresh and verify changes diff --git a/qpid/python/qmf2/tests/basic_query.py b/qpid/python/qmf2/tests/basic_query.py index 46dc87f4a1..2009f5c594 100644 --- a/qpid/python/qmf2/tests/basic_query.py +++ b/qpid/python/qmf2/tests/basic_query.py @@ -174,7 +174,7 @@ class BaseTest(unittest.TestCase): # synchronous query for all objects by id # verify known object ids are returned self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier, + self.console = qmf2.console.Console(notifier=self.notifier, agent_timeout=3) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, @@ -206,7 +206,7 @@ class BaseTest(unittest.TestCase): # synchronous query for each objects # verify objects and schemas are correct self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier, + self.console = qmf2.console.Console(notifier=self.notifier, agent_timeout=3) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, @@ -248,7 +248,7 @@ class BaseTest(unittest.TestCase): # find agents # synchronous query all package names self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier, + self.console = qmf2.console.Console(notifier=self.notifier, agent_timeout=3) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, @@ -276,7 +276,7 @@ class BaseTest(unittest.TestCase): # find agents # synchronous query for all schema by package name self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier, + self.console = qmf2.console.Console(notifier=self.notifier, agent_timeout=3) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, @@ -310,7 +310,7 @@ class BaseTest(unittest.TestCase): # find agents # synchronous query for all schema by package name self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier, + self.console = qmf2.console.Console(notifier=self.notifier, agent_timeout=3) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, diff --git a/qpid/python/qmf2/tests/events.py b/qpid/python/qmf2/tests/events.py index 8ce534ce3a..b2d934728d 100644 --- a/qpid/python/qmf2/tests/events.py +++ b/qpid/python/qmf2/tests/events.py @@ -144,8 +144,8 @@ class BaseTest(unittest.TestCase): # find agents self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier, - agent_timeout=3) + self.console = qmf2.console.Console(notifier=self.notifier, + agent_timeout=3) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, self.broker.user, @@ -169,7 +169,7 @@ class BaseTest(unittest.TestCase): self.assertTrue(event.get_value("prop-1") > 0) agent = wi.get_params().get("agent") - if not agent or not isinstance(agent, qmf.qmfConsole.Agent): + if not agent or not isinstance(agent, qmf2.console.Agent): self.fail("Unexpected workitem from agent") else: if agent.get_name() == "agent1": diff --git a/qpid/python/qmf2/tests/obj_gets.py b/qpid/python/qmf2/tests/obj_gets.py index e58575440d..9287fc7173 100644 --- a/qpid/python/qmf2/tests/obj_gets.py +++ b/qpid/python/qmf2/tests/obj_gets.py @@ -203,7 +203,7 @@ class BaseTest(unittest.TestCase): # synchronous query for all objects by id # verify known object ids are returned self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier, + self.console = qmf2.console.Console(notifier=self.notifier, agent_timeout=3) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, @@ -261,7 +261,7 @@ class BaseTest(unittest.TestCase): # synchronous query for all objects by id # verify known object ids are returned self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier, + self.console = qmf2.console.Console(notifier=self.notifier, agent_timeout=3) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, @@ -333,7 +333,7 @@ class BaseTest(unittest.TestCase): # synchronous query for all objects by id # verify known object ids are returned self.notifier = _testNotifier() - self.console = qmf.qmfConsole.Console(notifier=self.notifier, + self.console = qmf2.console.Console(notifier=self.notifier, agent_timeout=3) self.conn = qpid.messaging.Connection(self.broker.host, self.broker.port, |