qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r619903 - in /incubator/qpid/trunk/qpid: bin/ cpp/examples/ cpp/examples/examples/direct/ cpp/examples/examples/fanout/ cpp/examples/examples/pub-sub/ cpp/examples/examples/request-response/ python/examples/direct/ python/examples/fanout/ p...
Date Fri, 08 Feb 2008 15:01:40 GMT
Author: aconway
Date: Fri Feb  8 07:01:30 2008
New Revision: 619903

URL: http://svn.apache.org/viewvc?rev=619903&view=rev
Log:

Refactored verify scripts, added verify for python Examples.
To verify an example: <qpid-trunk>/bin/verify <example-dir>
See comments in bin/verify for more details.

Changes: 
 - Each example dir has its own verify script and verify.in.
 - Added sys.stdout.flush() to som python examples so verify can tell when they're ready.
 - Made python examples svn:executable.
 - C++ examples/Makefile.am runs python examples

Added:
    incubator/qpid/trunk/qpid/bin/verify   (with props)
    incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify
    incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify
    incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify
    incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify
    incubator/qpid/trunk/qpid/python/examples/direct/verify
    incubator/qpid/trunk/qpid/python/examples/direct/verify.in
    incubator/qpid/trunk/qpid/python/examples/fanout/verify
    incubator/qpid/trunk/qpid/python/examples/fanout/verify.in
    incubator/qpid/trunk/qpid/python/examples/pubsub/verify
    incubator/qpid/trunk/qpid/python/examples/pubsub/verify.in
    incubator/qpid/trunk/qpid/python/examples/request-response/verify
    incubator/qpid/trunk/qpid/python/examples/request-response/verify.in
Removed:
    incubator/qpid/trunk/qpid/cpp/examples/verify
Modified:
    incubator/qpid/trunk/qpid/cpp/examples/Makefile.am
    incubator/qpid/trunk/qpid/python/examples/direct/declare_queues.py   (contents, props
changed)
    incubator/qpid/trunk/qpid/python/examples/direct/direct_consumer.py   (contents, props
changed)
    incubator/qpid/trunk/qpid/python/examples/direct/direct_producer.py   (contents, props
changed)
    incubator/qpid/trunk/qpid/python/examples/direct/listener.py   (contents, props changed)
    incubator/qpid/trunk/qpid/python/examples/fanout/declare_queues.py   (contents, props
changed)
    incubator/qpid/trunk/qpid/python/examples/fanout/fanout_consumer.py   (contents, props
changed)
    incubator/qpid/trunk/qpid/python/examples/fanout/fanout_producer.py   (contents, props
changed)
    incubator/qpid/trunk/qpid/python/examples/fanout/listener.py   (contents, props changed)
    incubator/qpid/trunk/qpid/python/examples/pubsub/topic_publisher.py   (contents, props
changed)
    incubator/qpid/trunk/qpid/python/examples/pubsub/topic_subscriber.py   (contents, props
changed)
    incubator/qpid/trunk/qpid/python/examples/request-response/client.py   (contents, props
changed)
    incubator/qpid/trunk/qpid/python/examples/request-response/server.py   (contents, props
changed)

Added: incubator/qpid/trunk/qpid/bin/verify
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/bin/verify?rev=619903&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/bin/verify (added)
+++ incubator/qpid/trunk/qpid/bin/verify Fri Feb  8 07:01:30 2008
@@ -0,0 +1,74 @@
+#!/bin/sh
+# Driver script to verify installed examples (also used for build tests.)
+#
+# Usage: verify example_dir [ example_dir ...]
+# Where each example_dir must contain a verify sub-script to include.
+#
+# If $QPIDD is set, run a private QPIDD and use it.
+# If $QPID_HOST or $QPID_PORT are set, use them to connect.
+#
+
+export QPID_DATA_DIR=
+
+cleanup() {
+    test -n "$QPIDD" &&  $QPIDD -q # Private broker
+    kill %% > /dev/null 2>&1	# Leftover background jobs
+}
+
+trap cleanup EXIT
+
+ARGS="${QPID_HOST:-localhost} $QPID_PORT"
+
+outfile() { echo $1.out; }
+
+fail() { test -n "$*" && echo $* 1>&2 ; FAIL=1; return 1; }
+
+client() { "$@" $ARGS > `outfile $*` || fail; }
+
+clients() { for cmd in "$@"; do client $cmd; done; }
+
+waitfor() { until grep -a -l "$2" $1 >/dev/null 2>&1 ; do sleep 1 ; done ; } 
+
+background() {
+    pattern=$1; shift
+    out=`outfile $*`
+    eval "$* $ARGS > $out &" || { fail; return 1; }
+    waitfor $out "$pattern"
+}
+
+outputs() {
+    wait 2> /dev/null		# Wait for all backgroud processes to complete
+    for f in "$@"; do
+	{ echo "==== $f"; eval "cat $f"; } >> verify.out || fail
+    done
+}
+
+verify() {
+    FAIL=
+    dir=$1
+    cd $dir || return 1
+    rm -f *.out
+    { source ./verify && diff -ac verify.out verify.in ; } || fail
+    test -z "$FAIL" && rm -f *.out
+    return $FAIL
+}
+
+HEX="[a-fA-F0-9]"
+remove_uuid() {
+    sed "s/$HEX\{8\}-$HEX\{4\}-$HEX\{4\}-$HEX\{4\}-$HEX\{12\}//g" $*
+}
+remove_uuid64() {
+    sed 's/[-A-Za-z0-9_]\{22\}==$//' $*
+}
+
+# Start private broker if QPIDD is set.
+if [ -n "$QPIDD" ] ; then
+    export QPID_PORT=`$QPIDD -dp0` || { echo "Cannot start $QPIDD" ; exit 1; }
+    trap "$QPIDD -q" EXIT
+fi
+
+for dir in "$@"; do
+    echo -n "$dir : "
+    if ( verify $dir; ) then echo "PASS";  else echo "FAIL"; RET=1; fi
+     done
+exit $RET

Propchange: incubator/qpid/trunk/qpid/bin/verify
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/qpid/trunk/qpid/cpp/examples/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/Makefile.am?rev=619903&r1=619902&r2=619903&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/Makefile.am (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/Makefile.am Fri Feb  8 07:01:30 2008
@@ -17,7 +17,11 @@
 	examples/direct/listener.cpp				\
 	examples/direct/declare_queues.cpp
 
-VERIFY_SCRIPT=verify \
+VERIFY_SCRIPT= \
+	examples/request-response/verify \
+	examples/fanout/verify \
+	examples/pub-sub/verify \
+	examples/direct/verify \
 	examples/request-response/verify.in \
 	examples/fanout/verify.in \
 	examples/pub-sub/verify.in \
@@ -35,7 +39,17 @@
 abs_top_builddir=@abs_top_builddir@
 abs_top_srcdir=@abs_top_srcdir@
 
-VERIFY=$(abs_top_srcdir)/examples/verify
+VERIFY=$(top_srcdir)/../bin/verify
+PYTHON_EXAMPLES=$(top_srcdir)/../python/examples
+EXAMPLES= \
+	examples/pub-sub \
+	examples/fanout \
+	examples/direct \
+	examples/request-response \
+	$(PYTHON_EXAMPLES)/pubsub \
+	$(PYTHON_EXAMPLES)/fanout \
+	$(PYTHON_EXAMPLES)/direct \
+	$(PYTHON_EXAMPLES)/request-response
 
 # Build the examples in the source tree.
 all-local:
@@ -43,7 +57,7 @@
 
 # Verify the examples in the buid tree.
 check-local: all-local
-	cd examples && QPID_DATA_DIR= QPIDD=$(abs_top_builddir)/src/qpidd $(VERIFY)
+	QPID_DATA_DIR= QPIDD=$(top_builddir)/src/qpidd $(VERIFY) $(EXAMPLES)
 
 # Build and verify the installed examples, then clean up to avoid rpmbuild warnings.
 EXAMPLE_FLAGS=-I$(DESTDIR)$(includedir) -L$(DESTDIR)$(libdir) -Wl,-rpath,$(DESTDIR)$(libdir)

Added: incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify?rev=619903&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify (added)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify Fri Feb  8 07:01:30 2008
@@ -0,0 +1,3 @@
+# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify 
+clients ./declare_queues ./direct_producer ./listener
+outputs  ./declare_queues.out ./direct_producer.out ./listener.out

Added: incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify?rev=619903&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify (added)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify Fri Feb  8 07:01:30 2008
@@ -0,0 +1,2 @@
+clients ./declare_queues ./fanout_producer ./listener
+outputs ./declare_queues.out ./fanout_producer.out ./listener.out

Added: incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify?rev=619903&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify (added)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify Fri Feb  8 07:01:30 2008
@@ -0,0 +1,4 @@
+# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify 
+background "Listening" ./topic_listener
+clients ./topic_publisher
+outputs ./topic_publisher.out "topic_listener.out | remove_uuid | sort"

Added: incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify?rev=619903&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify (added)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify Fri Feb  8 07:01:30
2008
@@ -0,0 +1,5 @@
+# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify 
+background "Waiting" ./server
+clients ./client
+kill %% 			# Must kill the server.
+outputs "./client.out | remove_uuid" " server.out | remove_uuid"

Modified: incubator/qpid/trunk/qpid/python/examples/direct/declare_queues.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/direct/declare_queues.py?rev=619903&r1=619902&r2=619903&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/direct/declare_queues.py (original)
+++ incubator/qpid/trunk/qpid/python/examples/direct/declare_queues.py Fri Feb  8 07:01:30
2008
@@ -9,6 +9,7 @@
 """
 
 import qpid
+import sys
 from qpid.client import Client
 from qpid.content import Content
 from qpid.queue import Empty
@@ -17,8 +18,8 @@
 
 #  Set parameters for login
 
-host="127.0.0.1"
-port=5672
+host=len(sys.argv) > 1 and sys.argv[1] or "127.0.0.1"
+port=len(sys.argv) > 2 and int(sys.argv[2]) or 5672
 amqp_spec="/usr/share/amqp/amqp.0-10-preview.xml"
 user="guest"
 password="guest"

Propchange: incubator/qpid/trunk/qpid/python/examples/direct/declare_queues.py
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/qpid/trunk/qpid/python/examples/direct/direct_consumer.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/direct/direct_consumer.py?rev=619903&r1=619902&r2=619903&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/direct/direct_consumer.py (original)
+++ incubator/qpid/trunk/qpid/python/examples/direct/direct_consumer.py Fri Feb  8 07:01:30
2008
@@ -7,6 +7,7 @@
 """
 
 import qpid
+import sys
 from qpid.client import Client
 from qpid.content import Content
 from qpid.queue import Empty
@@ -16,8 +17,8 @@
 
 #  Set parameters for login
 
-host="127.0.0.1"
-port=5672
+host=len(sys.argv) > 1 and sys.argv[1] or "127.0.0.1"
+port=len(sys.argv) > 2 and int(sys.argv[2]) or 5672
 amqp_spec="/usr/share/amqp/amqp.0-10-preview.xml"
 user="guest"
 password="guest"

Propchange: incubator/qpid/trunk/qpid/python/examples/direct/direct_consumer.py
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/qpid/trunk/qpid/python/examples/direct/direct_producer.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/direct/direct_producer.py?rev=619903&r1=619902&r2=619903&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/direct/direct_producer.py (original)
+++ incubator/qpid/trunk/qpid/python/examples/direct/direct_producer.py Fri Feb  8 07:01:30
2008
@@ -7,6 +7,7 @@
 """
 
 import qpid
+import sys
 from qpid.client import Client
 from qpid.content import Content
 from qpid.queue import Empty
@@ -15,8 +16,8 @@
 
 #  Set parameters for login
 
-host="127.0.0.1"
-port=5672
+host=len(sys.argv) > 1 and sys.argv[1] or "127.0.0.1"
+port=len(sys.argv) > 2 and int(sys.argv[2]) or 5672
 amqp_spec="/usr/share/amqp/amqp.0-10-preview.xml"
 user="guest"
 password="guest"

Propchange: incubator/qpid/trunk/qpid/python/examples/direct/direct_producer.py
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/qpid/trunk/qpid/python/examples/direct/listener.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/direct/listener.py?rev=619903&r1=619902&r2=619903&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/direct/listener.py (original)
+++ incubator/qpid/trunk/qpid/python/examples/direct/listener.py Fri Feb  8 07:01:30 2008
@@ -8,6 +8,7 @@
 """
 
 import qpid
+import sys
 from qpid.client  import Client
 from qpid.content import Content
 from qpid.queue   import Empty
@@ -40,8 +41,8 @@
 
 #  Set parameters for login
 
-host="127.0.0.1"
-port=5672
+host=len(sys.argv) > 1 and sys.argv[1] or "127.0.0.1"
+port=len(sys.argv) > 2 and int(sys.argv[2]) or 5672
 amqp_spec="/usr/share/amqp/amqp.0-10-preview.xml"
 user="guest"
 password="guest"

Propchange: incubator/qpid/trunk/qpid/python/examples/direct/listener.py
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/python/examples/direct/verify
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/direct/verify?rev=619903&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/direct/verify (added)
+++ incubator/qpid/trunk/qpid/python/examples/direct/verify Fri Feb  8 07:01:30 2008
@@ -0,0 +1,3 @@
+# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify 
+clients ./declare_queues.py ./direct_producer.py ./direct_consumer.py
+outputs ./declare_queues.py.out ./direct_producer.py.out ./direct_consumer.py.out

Added: incubator/qpid/trunk/qpid/python/examples/direct/verify.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/direct/verify.in?rev=619903&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/direct/verify.in (added)
+++ incubator/qpid/trunk/qpid/python/examples/direct/verify.in Fri Feb  8 07:01:30 2008
@@ -0,0 +1,14 @@
+==== ./declare_queues.py.out
+==== ./direct_producer.py.out
+==== ./direct_consumer.py.out
+message 0
+message 1
+message 2
+message 3
+message 4
+message 5
+message 6
+message 7
+message 8
+message 9
+That's all, folks!

Modified: incubator/qpid/trunk/qpid/python/examples/fanout/declare_queues.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/fanout/declare_queues.py?rev=619903&r1=619902&r2=619903&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/fanout/declare_queues.py (original)
+++ incubator/qpid/trunk/qpid/python/examples/fanout/declare_queues.py Fri Feb  8 07:01:30
2008
@@ -9,6 +9,7 @@
 """
 
 import qpid
+import sys
 from qpid.client import Client
 from qpid.content import Content
 from qpid.queue import Empty
@@ -17,8 +18,8 @@
 
 #  Set parameters for login
 
-host="127.0.0.1"
-port=5672
+host=len(sys.argv) > 1 and sys.argv[1] or "127.0.0.1"
+port=len(sys.argv) > 2 and int(sys.argv[2]) or 5672
 amqp_spec="/usr/share/amqp/amqp.0-10-preview.xml"
 user="guest"
 password="guest"

Propchange: incubator/qpid/trunk/qpid/python/examples/fanout/declare_queues.py
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/qpid/trunk/qpid/python/examples/fanout/fanout_consumer.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/fanout/fanout_consumer.py?rev=619903&r1=619902&r2=619903&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/fanout/fanout_consumer.py (original)
+++ incubator/qpid/trunk/qpid/python/examples/fanout/fanout_consumer.py Fri Feb  8 07:01:30
2008
@@ -7,6 +7,7 @@
 """
 
 import qpid
+import sys
 from qpid.client import Client
 from qpid.content import Content
 from qpid.queue import Empty
@@ -16,8 +17,8 @@
 
 #  Set parameters for login
 
-host="127.0.0.1"
-port=5672
+host=len(sys.argv) > 1 and sys.argv[1] or "127.0.0.1"
+port=len(sys.argv) > 2 and int(sys.argv[2]) or 5672
 amqp_spec="/usr/share/amqp/amqp.0-10-preview.xml"
 user="guest"
 password="guest"

Propchange: incubator/qpid/trunk/qpid/python/examples/fanout/fanout_consumer.py
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/qpid/trunk/qpid/python/examples/fanout/fanout_producer.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/fanout/fanout_producer.py?rev=619903&r1=619902&r2=619903&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/fanout/fanout_producer.py (original)
+++ incubator/qpid/trunk/qpid/python/examples/fanout/fanout_producer.py Fri Feb  8 07:01:30
2008
@@ -7,6 +7,7 @@
 """
 
 import qpid
+import sys
 from qpid.client import Client
 from qpid.content import Content
 from qpid.queue import Empty
@@ -15,8 +16,8 @@
 
 #  Set parameters for login
 
-host="127.0.0.1"
-port=5672
+host=len(sys.argv) > 1 and sys.argv[1] or "127.0.0.1"
+port=len(sys.argv) > 2 and int(sys.argv[2]) or 5672
 amqp_spec="/usr/share/amqp/amqp.0-10-preview.xml"
 user="guest"
 password="guest"

Propchange: incubator/qpid/trunk/qpid/python/examples/fanout/fanout_producer.py
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/qpid/trunk/qpid/python/examples/fanout/listener.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/fanout/listener.py?rev=619903&r1=619902&r2=619903&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/fanout/listener.py (original)
+++ incubator/qpid/trunk/qpid/python/examples/fanout/listener.py Fri Feb  8 07:01:30 2008
@@ -7,6 +7,7 @@
 """
 
 import qpid
+import sys
 from qpid.client  import Client
 from qpid.content import Content
 from qpid.queue   import Empty
@@ -39,8 +40,8 @@
 
 #  Set parameters for login
 
-host="127.0.0.1"
-port=5672
+host=len(sys.argv) > 1 and sys.argv[1] or "127.0.0.1"
+port=len(sys.argv) > 2 and int(sys.argv[2]) or 5672
 amqp_spec="/usr/share/amqp/amqp.0-10-preview.xml"
 user="guest"
 password="guest"

Propchange: incubator/qpid/trunk/qpid/python/examples/fanout/listener.py
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/python/examples/fanout/verify
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/fanout/verify?rev=619903&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/fanout/verify (added)
+++ incubator/qpid/trunk/qpid/python/examples/fanout/verify Fri Feb  8 07:01:30 2008
@@ -0,0 +1,3 @@
+# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify 
+clients ./declare_queues.py ./fanout_producer.py ./fanout_consumer.py
+outputs ./declare_queues.py.out ./fanout_producer.py.out ./fanout_consumer.py.out

Added: incubator/qpid/trunk/qpid/python/examples/fanout/verify.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/fanout/verify.in?rev=619903&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/fanout/verify.in (added)
+++ incubator/qpid/trunk/qpid/python/examples/fanout/verify.in Fri Feb  8 07:01:30 2008
@@ -0,0 +1,14 @@
+==== ./declare_queues.py.out
+==== ./fanout_producer.py.out
+==== ./fanout_consumer.py.out
+message 0
+message 1
+message 2
+message 3
+message 4
+message 5
+message 6
+message 7
+message 8
+message 9
+That's all, folks!

Modified: incubator/qpid/trunk/qpid/python/examples/pubsub/topic_publisher.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/pubsub/topic_publisher.py?rev=619903&r1=619902&r2=619903&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/pubsub/topic_publisher.py (original)
+++ incubator/qpid/trunk/qpid/python/examples/pubsub/topic_publisher.py Fri Feb  8 07:01:30
2008
@@ -8,6 +8,7 @@
 """
 
 import qpid
+import sys
 from qpid.client import Client
 from qpid.content import Content
 from qpid.queue import Empty
@@ -15,9 +16,8 @@
 #----- Initialization -----------------------------------
 
 #  Set parameters for login. 
-
-host="127.0.0.1"
-port=5672
+host=len(sys.argv) > 1 and sys.argv[1] or "127.0.0.1"
+port=len(sys.argv) > 2 and int(sys.argv[2]) or 5672
 amqp_spec="/usr/share/amqp/amqp.0-10-preview.xml"
 user="guest"
 password="guest"

Propchange: incubator/qpid/trunk/qpid/python/examples/pubsub/topic_publisher.py
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/qpid/trunk/qpid/python/examples/pubsub/topic_subscriber.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/pubsub/topic_subscriber.py?rev=619903&r1=619902&r2=619903&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/pubsub/topic_subscriber.py (original)
+++ incubator/qpid/trunk/qpid/python/examples/pubsub/topic_subscriber.py Fri Feb  8 07:01:30
2008
@@ -7,7 +7,7 @@
 """
 
 import base64
-
+import sys
 import qpid
 from qpid.client import Client
 from qpid.content import Content
@@ -60,8 +60,8 @@
 
 #  Set parameters for login
 
-host="127.0.0.1"
-port=5672
+host=len(sys.argv) > 1 and sys.argv[1] or "127.0.0.1"
+port=len(sys.argv) > 2 and int(sys.argv[2]) or 5672
 amqp_spec="/usr/share/amqp/amqp.0-10-preview.xml"
 user="guest"
 password="guest"
@@ -108,7 +108,8 @@
 
 # Remind the user to start the topic producer
 
-print "Queues create - please start the topic producer"
+print "Queues created - please start the topic producer"
+sys.stdout.flush()
 
 # Call dump_queue to print messages from each queue
 

Propchange: incubator/qpid/trunk/qpid/python/examples/pubsub/topic_subscriber.py
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/python/examples/pubsub/verify
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/pubsub/verify?rev=619903&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/pubsub/verify (added)
+++ incubator/qpid/trunk/qpid/python/examples/pubsub/verify Fri Feb  8 07:01:30 2008
@@ -0,0 +1,4 @@
+# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify 
+background "Queues created" ./topic_subscriber.py
+clients ./topic_publisher.py
+outputs ./topic_publisher.py.out "topic_subscriber.py.out | remove_uuid64 | sort"

Added: incubator/qpid/trunk/qpid/python/examples/pubsub/verify.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/pubsub/verify.in?rev=619903&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/pubsub/verify.in (added)
+++ incubator/qpid/trunk/qpid/python/examples/pubsub/verify.in Fri Feb  8 07:01:30 2008
@@ -0,0 +1,51 @@
+==== ./topic_publisher.py.out
+==== topic_subscriber.py.out | remove_uuid64 | sort
+message 0
+message 0
+message 0
+message 0
+message 0
+message 0
+message 0
+message 0
+message 1
+message 1
+message 1
+message 1
+message 1
+message 1
+message 1
+message 1
+message 2
+message 2
+message 2
+message 2
+message 2
+message 2
+message 2
+message 2
+message 3
+message 3
+message 3
+message 3
+message 3
+message 3
+message 3
+message 3
+message 4
+message 4
+message 4
+message 4
+message 4
+message 4
+message 4
+message 4
+Messages queue: europe
+Messages queue: news
+Messages queue: usa
+Messages queue: weather
+Queues created - please start the topic producer
+That's all, folks!
+That's all, folks!
+That's all, folks!
+That's all, folks!

Modified: incubator/qpid/trunk/qpid/python/examples/request-response/client.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/request-response/client.py?rev=619903&r1=619902&r2=619903&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/request-response/client.py (original)
+++ incubator/qpid/trunk/qpid/python/examples/request-response/client.py Fri Feb  8 07:01:30
2008
@@ -9,6 +9,7 @@
 import base64
 
 import qpid
+import sys
 from qpid.client import Client
 from qpid.content import Content
 from qpid.queue import Empty
@@ -59,8 +60,8 @@
 
 #  Set parameters for login
 
-host="127.0.0.1"
-port=5672
+host=len(sys.argv) > 1 and sys.argv[1] or "127.0.0.1"
+port=len(sys.argv) > 2 and int(sys.argv[2]) or 5672
 amqp_spec="/usr/share/amqp/amqp.0-10-preview.xml"
 user="guest"
 password="guest"

Propchange: incubator/qpid/trunk/qpid/python/examples/request-response/client.py
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/qpid/trunk/qpid/python/examples/request-response/server.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/request-response/server.py?rev=619903&r1=619902&r2=619903&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/request-response/server.py (original)
+++ incubator/qpid/trunk/qpid/python/examples/request-response/server.py Fri Feb  8 07:01:30
2008
@@ -6,6 +6,7 @@
 """
 
 import qpid
+import sys
 from qpid.client import Client
 from qpid.content import Content
 from qpid.queue import Empty
@@ -27,8 +28,8 @@
 
 #  Set parameters for login
 
-host="127.0.0.1"
-port=5672
+host=len(sys.argv) > 1 and sys.argv[1] or "127.0.0.1"
+port=len(sys.argv) > 2 and int(sys.argv[2]) or 5672
 amqp_spec="/usr/share/amqp/amqp.0-10-preview.xml"
 user="guest"
 password="guest"
@@ -61,6 +62,7 @@
 
 print "Request server running - run your client now."
 print "(Times out after 100 seconds ...)"
+sys.stdout.flush()
 
 # Respond to each request
 

Propchange: incubator/qpid/trunk/qpid/python/examples/request-response/server.py
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/python/examples/request-response/verify
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/request-response/verify?rev=619903&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/request-response/verify (added)
+++ incubator/qpid/trunk/qpid/python/examples/request-response/verify Fri Feb  8 07:01:30
2008
@@ -0,0 +1,5 @@
+# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify 
+background "Request server running" ./server.py
+clients ./client.py
+kill %% 			# Must kill the server.
+outputs "./client.py.out | remove_uuid64" " server.py.out | remove_uuid64"

Added: incubator/qpid/trunk/qpid/python/examples/request-response/verify.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/examples/request-response/verify.in?rev=619903&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/python/examples/request-response/verify.in (added)
+++ incubator/qpid/trunk/qpid/python/examples/request-response/verify.in Fri Feb  8 07:01:30
2008
@@ -0,0 +1,14 @@
+==== ./client.py.out | remove_uuid64
+Request: Twas brilling, and the slithy toves
+Request: Did gyre and gimble in the wabe.
+Request: All mimsy were the borogroves,
+Request: And the mome raths outgrabe.
+Messages queue: ReplyTo:
+Response: TWAS BRILLING, AND THE SLITHY TOVES
+Response: DID GYRE AND GIMBLE IN THE WABE.
+Response: ALL MIMSY WERE THE BOROGROVES,
+Response: AND THE MOME RATHS OUTGRABE.
+No more messages!
+====  server.py.out | remove_uuid64
+Request server running - run your client now.
+(Times out after 100 seconds ...)



Mime
View raw message