You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2007/03/17 01:18:27 UTC

svn commit: r519194 - in /incubator/qpid/trunk/qpid: ./ cpp/gen/ cpp/tests/run-python-tests python/qpid/testlib.py

Author: aconway
Date: Fri Mar 16 17:18:26 2007
New Revision: 519194

URL: http://svn.apache.org/viewvc?view=rev&rev=519194
Log:
* python/qpid/testlib.py:
 - fix testlib ops to use 0-8 or 0-9 classes as appropriate.
 - fix bug in arg parsing of specfile.

* cpp/tests/run-python-tests: Fix scripting bug that gave a OK build result
  even if there were python failures.

* cpp/gen: svn:ignore all generated source and Makefile.

Modified:
    incubator/qpid/trunk/qpid/   (props changed)
    incubator/qpid/trunk/qpid/cpp/gen/   (props changed)
    incubator/qpid/trunk/qpid/cpp/tests/run-python-tests
    incubator/qpid/trunk/qpid/python/qpid/testlib.py

Propchange: incubator/qpid/trunk/qpid/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Mar 16 17:18:26 2007
@@ -1 +1 @@
-/incubator/qpid/branches/qpid.0-9:1-492620,496593,497277,500305
+/incubator/qpid/branches/qpid.0-9:1-492620,496593,497277,500305,501022

Propchange: incubator/qpid/trunk/qpid/cpp/gen/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Mar 16 17:18:26 2007
@@ -1,106 +1,6 @@
-AMQP_ClientOperations.h
-AMQP_ClientProxy.cpp
-AMQP_ClientProxy.h
-AMQP_Constants.h
-AMQP_HighestVersion.cpp
-AMQP_MethodVersionMap.cpp
-AMQP_MethodVersionMap.h
-AMQP_ServerOperations.h
-AMQP_ServerProxy.cpp
-AMQP_ServerProxy.h
-AccessRequestBody.h
-AccessRequestOkBody.h
-BasicAckBody.h
-BasicCancelBody.h
-BasicCancelOkBody.h
-BasicConsumeBody.h
-BasicConsumeOkBody.h
-BasicDeliverBody.h
-BasicGetBody.h
-BasicGetEmptyBody.h
-BasicGetOkBody.h
-BasicPublishBody.h
-BasicQosBody.h
-BasicQosOkBody.h
-BasicRecoverBody.h
-BasicRejectBody.h
-BasicReturnBody.h
-ChannelAlertBody.h
-ChannelCloseBody.h
-ChannelCloseOkBody.h
-ChannelFlowBody.h
-ChannelFlowOkBody.h
-ChannelOpenBody.h
-ChannelOpenOkBody.h
-ConnectionCloseBody.h
-ConnectionCloseOkBody.h
-ConnectionOpenBody.h
-ConnectionOpenOkBody.h
-ConnectionRedirectBody.h
-ConnectionSecureBody.h
-ConnectionSecureOkBody.h
-ConnectionStartBody.h
-ConnectionStartOkBody.h
-ConnectionTuneBody.h
-ConnectionTuneOkBody.h
-DtxSelectBody.h
-DtxSelectOkBody.h
-DtxStartBody.h
-DtxStartOkBody.h
-ExchangeBoundBody.h
-ExchangeBoundOkBody.h
-ExchangeDeclareBody.h
-ExchangeDeclareOkBody.h
-ExchangeDeleteBody.h
-ExchangeDeleteOkBody.h
-FileAckBody.h
-FileCancelBody.h
-FileCancelOkBody.h
-FileConsumeBody.h
-FileConsumeOkBody.h
-FileDeliverBody.h
-FileOpenBody.h
-FileOpenOkBody.h
-FilePublishBody.h
-FileQosBody.h
-FileQosOkBody.h
-FileRejectBody.h
-FileReturnBody.h
-FileStageBody.h
-Makefile
-Makefile.in
-QueueBindBody.h
-QueueBindOkBody.h
-QueueDeclareBody.h
-QueueDeclareOkBody.h
-QueueDeleteBody.h
-QueueDeleteOkBody.h
-QueuePurgeBody.h
-QueuePurgeOkBody.h
-StreamCancelBody.h
-StreamCancelOkBody.h
-StreamConsumeBody.h
-StreamConsumeOkBody.h
-StreamDeliverBody.h
-StreamPublishBody.h
-StreamQosBody.h
-StreamQosOkBody.h
-StreamReturnBody.h
-TestContentBody.h
-TestContentOkBody.h
-TestIntegerBody.h
-TestIntegerOkBody.h
-TestStringBody.h
-TestStringOkBody.h
-TestTableBody.h
-TestTableOkBody.h
-TunnelRequestBody.h
-TxCommitBody.h
-TxCommitOkBody.h
-TxRollbackBody.h
-TxRollbackOkBody.h
-TxSelectBody.h
-TxSelectOkBody.h
+*.h
+*.cpp
 timestamp
 gen-src.mk
-AMQP_HighestVersion.h
+Makefile
+Makefile.in

Modified: incubator/qpid/trunk/qpid/cpp/tests/run-python-tests
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/tests/run-python-tests?view=diff&rev=519194&r1=519193&r2=519194
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/tests/run-python-tests (original)
+++ incubator/qpid/trunk/qpid/cpp/tests/run-python-tests Fri Mar 16 17:18:26 2007
@@ -18,7 +18,7 @@
 
 # Run the tests.
 ( cd $abs_srcdir/../../python \
-    && python ./run-tests -v -I cpp_failing.txt || fail=1 )
+    && python ./run-tests -v -I cpp_failing.txt ) || fail=1 
 
 kill $pid || { echo FAIL: process already died; cat log; fail=1; }
 

Modified: incubator/qpid/trunk/qpid/python/qpid/testlib.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/qpid/testlib.py?view=diff&rev=519194&r1=519193&r2=519194
==============================================================================
--- incubator/qpid/trunk/qpid/python/qpid/testlib.py (original)
+++ incubator/qpid/trunk/qpid/python/qpid/testlib.py Fri Mar 16 17:18:26 2007
@@ -80,7 +80,7 @@
     def __init__(self):
         # Defaults
         self.setBroker("localhost")
-        self.spec = "../specs/amqp.0-8.xml"
+        self.specfile = "../specs/amqp.0-8.xml"
         self.verbose = 1
         self.ignore = []
 
@@ -89,6 +89,11 @@
         for line in f.readlines(): self.ignore.append(line.strip())
         f.close()
 
+    def use08spec(self):
+        "True if we are running with the old 0-8 spec."
+        # NB: AMQP 0-8 identifies itself as 8-0 for historical reasons.
+        return self.spec.major==8 and self.spec.minor==0
+            
     def _parseargs(self, args):
         try:
             opts, self.tests = getopt(args, "s:b:h?dvi:I:", ["help", "spec", "server", "verbose", "ignore", "ignore-file"])
@@ -105,9 +110,7 @@
 
         self.spec = qpid.spec.load(self.specfile)
         if len(self.tests) == 0:
-            # NB: not a typo but a quirk of AMQP history.
-            # AMQP 0-8 identifies itself as 8-0.
-            if self.spec.major==8 and self.spec.minor==0:
+            if self.use08spec():
                 testdir="tests_0-8"
             else:
                 testdir="tests"
@@ -203,11 +206,15 @@
         
     def consume(self, queueName):
         """Consume from named queue returns the Queue object."""
-        if not "uniqueTag" in dir(self): self.uniqueTag = 1
-        else: self.uniqueTag += 1
-        consumer_tag = "tag" + str(self.uniqueTag)
-        self.channel.message_consume(queue=queueName, destination=consumer_tag, no_ack=True)
-        return self.client.queue(consumer_tag)
+        if testrunner.use08spec():
+            reply = self.channel.basic_consume(queue=queueName, no_ack=True)
+            return self.client.queue(reply.consumer_tag)
+        else:
+            if not "uniqueTag" in dir(self): self.uniqueTag = 1
+            else: self.uniqueTag += 1
+            consumer_tag = "tag" + str(self.uniqueTag)
+            self.channel.message_consume(queue=queueName, destination=consumer_tag, no_ack=True)
+            return self.client.queue(consumer_tag)
 
     def assertEmpty(self, queue):
         """Assert that the queue is empty"""
@@ -221,12 +228,25 @@
         Publish to exchange and assert queue.get() returns the same message.
         """
         body = self.uniqueString()
-        self.channel.message_transfer(destination=exchange,
-                                      body=body, application_headers=properties,
-                                      routing_key=routing_key)
-        msg = queue.get(timeout=1)    
-        self.assertEqual(body, msg.body)
-        if (properties): self.assertEqual(properties, msg.application_headers)
+        if testrunner.use08spec():
+            self.channel.basic_publish(
+                exchange=exchange,
+                content=Content(body, properties=properties),
+                routing_key=routing_key)
+        else:
+            self.channel.message_transfer(
+                destination=exchange, body=body,
+                application_headers=properties,
+                routing_key=routing_key)
+        msg = queue.get(timeout=1)
+        if testrunner.use08spec():
+            self.assertEqual(body, msg.content.body)
+            if (properties):
+                self.assertEqual(properties, msg.content.properties)
+        else:
+            self.assertEqual(body, msg.body)
+            if (properties):
+                self.assertEqual(properties, msg.application_headers)
         
     def assertPublishConsume(self, queue="", exchange="", routing_key="", properties=None):
         """