diff options
-rw-r--r-- | python/qpid/peer.py | 4 | ||||
-rw-r--r-- | python/qpid/spec.py | 5 | ||||
-rw-r--r-- | python/qpid/testlib.py | 27 |
3 files changed, 22 insertions, 14 deletions
diff --git a/python/qpid/peer.py b/python/qpid/peer.py index d1f49fb2da..b6b528f12c 100644 --- a/python/qpid/peer.py +++ b/python/qpid/peer.py @@ -183,8 +183,8 @@ class Channel: self.requester = Requester(self.write) self.responder = Responder(self.write) - # XXX: better switch - self.reliable = True + # Use reliable framing if version >= 0-9. + self.reliable = (spec.major >= 0 and spec.minor >= 9) self.synchronous = True def close(self, reason): diff --git a/python/qpid/spec.py b/python/qpid/spec.py index e430c45b96..4f0661bcbc 100644 --- a/python/qpid/spec.py +++ b/python/qpid/spec.py @@ -79,12 +79,11 @@ class Spec(Metadata): PRINT=["major", "minor", "file"] - def __init__(self, major, minor, file, errata): + def __init__(self, major, minor, file): Metadata.__init__(self) self.major = major self.minor = minor self.file = file - self.errata = errata self.constants = SpecContainer() self.classes = SpecContainer() # methods indexed by classname_methname @@ -275,7 +274,7 @@ def load_fields(nd, l, domains): def load(specfile, *errata): doc = xmlutil.parse(specfile) spec_root = doc["amqp"][0] - spec = Spec(int(spec_root["@major"]), int(spec_root["@minor"]), specfile, errata) + spec = Spec(int(spec_root["@major"]), int(spec_root["@minor"]), specfile) for root in [spec_root] + map(lambda x: xmlutil.parse(x)["amqp"][0], errata): # constants diff --git a/python/qpid/testlib.py b/python/qpid/testlib.py index 815d95ca26..4b78865e98 100644 --- a/python/qpid/testlib.py +++ b/python/qpid/testlib.py @@ -57,13 +57,14 @@ class TestRunner: run-tests [options] [test*] The name of a test is package.module.ClassName.testMethod Options: - -?/-h/--help : this message - -s/--spec <spec.xml> : file containing amqp XML spec + -?/-h/--help : this message + -s/--spec <spec.xml> : file containing amqp XML spec + -e/--errata <errata.xml> : file containing amqp XML errata -b/--broker [<user>[/<password>]@]<host>[:<port>] : broker to connect to - -v/--verbose : verbose - lists tests as they are run. - -d/--debug : enable debug logging. - -i/--ignore <test> : ignore the named test. - -I/--ignore-file : file containing patterns to ignore. + -v/--verbose : verbose - lists tests as they are run. + -d/--debug : enable debug logging. + -i/--ignore <test> : ignore the named test. + -I/--ignore-file : file containing patterns to ignore. """ sys.exit(1) @@ -81,10 +82,10 @@ Options: def __init__(self): # Defaults self.setBroker("localhost") - self.spec = "../specs/amqp.0-9.xml" - self.errata = "../specs/amqp-errata.0-9.xml" self.verbose = 1 self.ignore = [] + self.spec = None + self.errata = [] def ignoreFile(self, filename): f = file(filename) @@ -99,12 +100,20 @@ Options: for opt, value in opts: if opt in ("-?", "-h", "--help"): self._die() if opt in ("-s", "--spec"): self.spec = value + if opt in ("-e", "--errata"): self.errata.append(value) if opt in ("-b", "--broker"): self.setBroker(value) if opt in ("-v", "--verbose"): self.verbose = 2 if opt in ("-d", "--debug"): logging.basicConfig(level=logging.DEBUG) if opt in ("-i", "--ignore"): self.ignore.append(value) if opt in ("-I", "--ignore-file"): self.ignoreFile(value) + # Default spec and errata. + if (self.spec == None): + if (len(self.errata)>0): + self._die("Specified errata with no spec.") + self.spec = "../specs/amqp.0-9.xml" + self.errata = ["../specs/amqp-errata.0-9.xml"] + # Default to running all tests. if len(self.tests) == 0: self.tests=findmodules("tests") def testSuite(self): @@ -142,7 +151,7 @@ Options: errata = errata or self.errata user = user or self.user password = password or self.password - client = qpid.client.Client(host, port, qpid.spec.load(spec, errata)) + client = qpid.client.Client(host, port, qpid.spec.load(spec, *errata)) client.start({"LOGIN": user, "PASSWORD": password}, tune_params=tune_params) return client |