qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject svn commit: r781485 - /qpid/trunk/qpid/python/qpid/tests/messaging.py
Date Wed, 03 Jun 2009 17:24:25 GMT
Author: rhs
Date: Wed Jun  3 17:24:25 2009
New Revision: 781485

URL: http://svn.apache.org/viewvc?rev=781485&view=rev
Log:
added tests for sender

Modified:
    qpid/trunk/qpid/python/qpid/tests/messaging.py

Modified: qpid/trunk/qpid/python/qpid/tests/messaging.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/tests/messaging.py?rev=781485&r1=781484&r2=781485&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/tests/messaging.py (original)
+++ qpid/trunk/qpid/python/qpid/tests/messaging.py Wed Jun  3 17:24:25 2009
@@ -385,6 +385,41 @@
 
   # XXX: need testClose
 
+class SenderTests(Base):
+
+  def setup_connection(self):
+    return Connection.open(self.broker.host, self.broker.port)
+
+  def setup_session(self):
+    return self.conn.session()
+
+  def setup_sender(self):
+    return self.ssn.sender("test-sender-queue")
+
+  def setup_receiver(self):
+    return self.ssn.receiver("test-sender-queue")
+
+  def checkContent(self, content):
+    self.snd.send(content)
+    msg = self.rcv.fetch(0)
+    assert msg.content == content
+
+    out = Message(content)
+    self.snd.send(out)
+    echo = self.rcv.fetch(0)
+    assert out.content == echo.content
+    assert echo.content == msg.content
+    self.ssn.acknowledge()
+
+  def testSendString(self):
+    self.checkContent("testSendString[%s]" % uuid4())
+
+  def testSendList(self):
+    self.checkContent(["testSendList", 1, 3.14, uuid4()])
+
+  def testSendMap(self):
+    self.checkContent({"testSendMap": uuid4(), "pie": "blueberry", "pi": 3.14})
+
 class MessageTests(Base):
 
   def testCreateString(self):



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message