Author: gsim
Date: Tue Dec 2 10:35:41 2008
New Revision: 722557
URL: http://svn.apache.org/viewvc?rev=722557&view=rev
Log:
QPID-1419: remove wip support from 0-9 python client
Modified:
incubator/qpid/trunk/qpid/python/qpid/connection08.py
incubator/qpid/trunk/qpid/python/qpid/peer.py
incubator/qpid/trunk/qpid/python/qpid/testlib.py
Modified: incubator/qpid/trunk/qpid/python/qpid/connection08.py
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/qpid/connection08.py?rev=722557&r1=722556&r2=722557&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/qpid/connection08.py (original)
+++ incubator/qpid/trunk/qpid/python/qpid/connection08.py Tue Dec 2 10:35:41
2008
@@ -122,6 +122,12 @@
raise "frame error: expected %r, got %r" % (self.FRAME_END, garbage)
return frame
+ def write_0_9(self, frame):
+ self.write_8_0(frame)
+
+ def read_0_9(self):
+ return self.read_8_0()
+
def write_0_10(self, frame):
c = self.codec
flags = 0
Modified: incubator/qpid/trunk/qpid/python/qpid/peer.py
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/qpid/peer.py?rev=722557&r1=722556&r2=722557&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/qpid/peer.py (original)
+++ incubator/qpid/trunk/qpid/python/qpid/peer.py Tue Dec 2 10:35:41 2008
@@ -193,11 +193,7 @@
self.futures = {}
self.control_queue = Queue(0)#used for incoming methods that appas may
want to handle themselves
- # Use reliable framing if version == 0-9.
- if spec.major == 0 and spec.minor == 9:
- self.invoker = self.invoke_reliable
- else:
- self.invoker = self.invoke_method
+ self.invoker = self.invoke_method
self.use_execution_layer = (spec.major == 0 and spec.minor == 10) or
(spec.major == 99 and spec.minor == 0)
self.synchronous = True
Modified: incubator/qpid/trunk/qpid/python/qpid/testlib.py
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/qpid/testlib.py?rev=722557&r1=722556&r2=722557&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/qpid/testlib.py (original)
+++ incubator/qpid/trunk/qpid/python/qpid/testlib.py Tue Dec 2 10:35:41 2008
@@ -108,6 +108,10 @@
# NB: AMQP 0-8 identifies itself as 8-0 for historical reasons.
return self.spec.major==8 and self.spec.minor==0
+ def use09spec(self):
+ "True if we are running with the 0-9 (non-wip) spec."
+ return self.spec.major==0 and self.spec.minor==9
+
def _parseargs(self, args):
# Defaults
self.setBroker("localhost")
@@ -157,14 +161,12 @@
if len(self.tests) == 0:
if not self.skip_self_test:
self.tests=findmodules("tests")
- if self.use08spec():
+ if self.use08spec() or self.use09spec():
self.tests+=findmodules("tests_0-8")
elif (self.spec.major == 99 and self.spec.minor == 0):
self.tests+=findmodules("tests_0-10_preview")
elif (self.spec.major == 0 and self.spec.minor == 10):
self.tests+=findmodules("tests_0-10")
- else:
- self.tests+=findmodules("tests_0-9")
def testSuite(self):
class IgnoringTestSuite(unittest.TestSuite):
@@ -232,7 +234,7 @@
self.client = self.connect()
self.channel = self.client.channel(1)
self.version = (self.client.spec.major, self.client.spec.minor)
- if self.version == (8, 0):
+ if self.version == (8, 0) or self.version == (0, 9):
self.channel.channel_open()
else:
self.channel.session_open()
@@ -278,7 +280,7 @@
def consume(self, queueName):
"""Consume from named queue returns the Queue object."""
- if testrunner.use08spec():
+ if testrunner.use08spec() or testrunner.use09spec():
reply = self.channel.basic_consume(queue=queueName, no_ack=True)
return self.client.queue(reply.consumer_tag)
else:
@@ -309,7 +311,7 @@
Publish to exchange and assert queue.get() returns the same message.
"""
body = self.uniqueString()
- if testrunner.use08spec():
+ if testrunner.use08spec() or testrunner.use09spec():
self.channel.basic_publish(
exchange=exchange,
content=Content(body, properties=properties),
@@ -319,7 +321,7 @@
destination=exchange,
content=Content(body,
properties={'application_headers':properties,'routing_key':routing_key}))
msg = queue.get(timeout=1)
- if testrunner.use08spec():
+ if testrunner.use08spec() or testrunner.use09spec():
self.assertEqual(body, msg.content.body)
if (properties):
self.assertEqual(properties, msg.content.properties)
@@ -336,7 +338,7 @@
self.assertPublishGet(self.consume(queue), exchange, routing_key,
properties)
def assertChannelException(self, expectedCode, message):
- if self.version == (8, 0): #or "transitional" in self.client.spec.file:
+ if self.version == (8, 0) or self.version == (0, 9):
if not isinstance(message, Message): self.fail("expected
channel_close method, got %s" % (message))
self.assertEqual("channel", message.method.klass.name)
self.assertEqual("close", message.method.name)