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 2008/02/08 23:23:26 UTC

svn commit: r620014 - 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/

Author: aconway
Date: Fri Feb  8 14:23:23 2008
New Revision: 620014

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

cpp/examples/direct, fanout: Converted listener.cpp to SubscriptionManager.

All python/cpp combos run as part of cpp/examples make check.

Fixed problems with verify scripts and VPATH builds.

Added:
    incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_python_cpp.in
    incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_python_cpp.in
    incubator/qpid/trunk/qpid/cpp/examples/verify
      - copied, changed from r619977, incubator/qpid/trunk/qpid/bin/verify
    incubator/qpid/trunk/qpid/cpp/examples/verify_all   (with props)
Removed:
    incubator/qpid/trunk/qpid/bin/verify
    incubator/qpid/trunk/qpid/bin/verify_all
Modified:
    incubator/qpid/trunk/qpid/cpp/examples/Makefile.am
    incubator/qpid/trunk/qpid/cpp/examples/examples/direct/listener.cpp
    incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify.in
    incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_cpp_python
    incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_cpp_python.in
    incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_python_cpp
    incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_python_cpp.in
    incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/declare_queues.cpp
    incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/fanout_producer.cpp
    incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/listener.cpp
    incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify.in
    incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_cpp_python
    incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_cpp_python.in
    incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_python_cpp
    incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify.in
    incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_cpp_python
    incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_cpp_python.in
    incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_python_cpp
    incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_python_cpp.in
    incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify
    incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify.in
    incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_cpp_python
    incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_cpp_python.in
    incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_python_cpp

Modified: incubator/qpid/trunk/qpid/cpp/examples/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/Makefile.am?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/Makefile.am (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/Makefile.am Fri Feb  8 14:23:23 2008
@@ -17,7 +17,33 @@
 	examples/direct/listener.cpp				\
 	examples/direct/declare_queues.cpp
 
-EXTRA_DIST=$(nobase_pkgdata_DATA)
+VERIFY_FILES= verify verify_all				\
+	examples/request-response/verify		\
+	examples/request-response/verify.in		\
+	examples/request-response/verify_cpp_python	\
+	examples/request-response/verify_cpp_python.in	\
+	examples/request-response/verify_python_cpp	\
+	examples/request-response/verify_python_cpp.in	\
+	examples/fanout/verify				\
+	examples/fanout/verify.in			\
+	examples/fanout/verify_cpp_python		\
+	examples/fanout/verify_cpp_python.in		\
+	examples/fanout/verify_python_cpp		\
+	examples/fanout/verify_python_cpp.in		\
+	examples/pub-sub/verify				\
+	examples/pub-sub/verify.in			\
+	examples/pub-sub/verify_cpp_python		\
+	examples/pub-sub/verify_cpp_python.in		\
+	examples/pub-sub/verify_python_cpp		\
+	examples/pub-sub/verify_python_cpp.in		\
+	examples/direct/verify				\
+	examples/direct/verify.in			\
+	examples/direct/verify_cpp_python		\
+	examples/direct/verify_cpp_python.in		\
+	examples/direct/verify_python_cpp		\
+	examples/direct/verify_python_cpp.in
+
+EXTRA_DIST=$(nobase_pkgdata_DATA) $(VERIFY_FILES)
 
 # Note: we don't use normal automake SUBDIRS because the example
 # makefiles don't understand all the recursive automake targets.
@@ -29,31 +55,24 @@
 abs_top_builddir=@abs_top_builddir@
 abs_top_srcdir=@abs_top_srcdir@
 
-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.
+# Build the examples - copy sources to the build tree in VPATH build.
 all-local:
+	test -d examples || cp -R $(srcdir)/examples .
 	cd examples && $(MAKE) CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS) -I../../$(top_srcdir)/src -I../../$(top_srcdir)/src/gen -I../../$(top_builddir)/src/gen -L../../$(top_builddir)/src/.libs -Wl,-rpath,$(abs_top_builddir)/src/.libs" all
 
 # Verify the examples in the buid tree.
-check-local: all-local
-	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)
-EXAMPLE_DIR=$(DESTDIR)$(pkgdatadir)/examples 
-installcheck-local:
-	cd $(EXAMPLE_DIR) && $(MAKE) CXX="$(CXX)" CXXFLAGS="$(EXAMPLE_FLAGS)" all
-	cd $(EXAMPLE_DIR) && QPIDD=$(sbindir)/qpidd $(VERIFY)
-	cd $(EXAMPLE_DIR) && $(MAKE) clean
+VERIFY=QPID_DATA_DIR= QPIDD=$(abs_top_builddir)/src/qpidd $(srcdir)/verify_all
+check-local: all-local $(VERIFY_FILES)
+	PYTHON_EXAMPLES=$(abs_top_srcdir)/../python/examples $(srcdir)/verify_all $(srcdir)/verify $(top_builddir)/src/qpidd examples 
+
+# TODO:
+#  create a tarball for testing installed examples.
+#  installcheck-local to use the tarball on installed example and clean up after.
+# Build and verify installed C++ examples, clean up to avoid rpmbuild warnings.
+# EXAMPLE_FLAGS=-I$(DESTDIR)$(includedir) -L$(DESTDIR)$(libdir) -Wl,-rpath,$(DESTDIR)$(libdir)
+# EXAMPLE_DIR=$(DESTDIR)$(pkgdatadir)/examples/cpp 
+# installcheck-local:
+# 	cd $(EXAMPLE_DIR) && $(MAKE) CXX="$(CXX)" CXXFLAGS="$(EXAMPLE_FLAGS)" all
+# 	cd $(EXAMPLE_DIR) && QPIDD=$(sbindir)/qpidd $(srcdir)/verify *
+# 	cd $(EXAMPLE_DIR) && $(MAKE) clean
 

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/direct/listener.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/direct/listener.cpp?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/direct/listener.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/direct/listener.cpp Fri Feb  8 14:23:23 2008
@@ -20,32 +20,15 @@
  */
 
 /**
- *  listener.cpp:
- *
- *  This program is one of three programs designed to be used
- *  together. These programs do not specify the exchange type - the
- *  default exchange type is the direct exchange.
- *  
- *    declare_queues.cpp:
- *
- *      Creates a queue on a broker, binding a routing key to route
- *      messages to that queue.
- *
- *    direct_producer.cpp:
- *
- *      Publishes to a broker, specifying a routing key.
- *
- *    listener.cpp (this program):
- *
- *      Reads from a queue on the broker using a message listener.
- *
+ *  listener.cpp: This program reads messages fro a queue on
+ *  the broker using a message listener.
  */
 
 #include <qpid/client/Dispatcher.h>
 #include <qpid/client/Connection.h>
 #include <qpid/client/Session.h>
 #include <qpid/client/Message.h>
-#include <qpid/client/MessageListener.h>
+#include <qpid/client/SubscriptionManager.h>
 
 #include <unistd.h>
 #include <cstdlib>
@@ -56,42 +39,25 @@
 
       
 class Listener : public MessageListener{
-private:
-  std::string destination_name;
-  Dispatcher dispatcher;
-public:
-  Listener(Session& session, string destination_name): 
-    destination_name(destination_name),
-    dispatcher(session)
-  {};
-
-  virtual void listen();
-  virtual void received(Message& message);
-  ~Listener() { };
+  private:
+    SubscriptionManager& subscriptions;
+  public:
+    Listener(SubscriptionManager& subscriptions);
+    virtual void received(Message& message);
 };
 
-
-void Listener::listen() {
-  std::cout << "Activating listener for: " <<destination_name << std::endl;
-  dispatcher.listen(destination_name, this);
-
-  // The following line gives up control
-
-  dispatcher.run();
-}
-
+Listener::Listener(SubscriptionManager& subs) : subscriptions(subs)
+{}
 
 void Listener::received(Message& message) {
   std::cout << "Message: " << message.getData() << std::endl;
-
   if (message.getData() == "That's all, folks!") {
-      std::cout << "Shutting down listener for " <<destination_name << std::endl;
-      dispatcher.stop();
+      std::cout << "Shutting down listener for " << message.getDestination()
+                << std::endl;
+      subscriptions.cancel(message.getDestination());
   }
 }
 
-
-
 int main(int argc, char** argv) {
     const char* host = argc>1 ? argv[1] : "127.0.0.1";
     int port = argc>2 ? atoi(argv[2]) : 5672;
@@ -103,25 +69,15 @@
 
   //--------- Main body of program --------------------------------------------
 
+      SubscriptionManager subscriptions(session);
+      // Create a listener and subscribe it to the queue named "message_queue"
+      Listener listener(subscriptions);
+      subscriptions.subscribe(listener, "message_queue");
+      // Deliver messages until the subscription is cancelled
+      // by Listener::received()
+      subscriptions.run();
 
-      //  Subscribe to the queue, route it to a client destination for
-      //  the  listener. (The destination  name merely  identifies the
-      //  destination in the listener, you can use any name as long as
-      //  you use the same name for the listener).
-
-      session.messageSubscribe(arg::queue="message_queue", arg::destination="listener_destination");
-
-      //##############
-      session.messageFlow(arg::destination="listener_destination", arg::unit=0, arg::value=1);//messages ### Define a constant?
-      session.messageFlow(arg::destination="listener_destination", arg::unit=1, arg::value=0xFFFFFFFF);//bytes ###### Define a constant?
-
-      //  Tell the listener to listen to the destination we just
-      //  created above.
-
-      Listener listener(session, "listener_destination");
-      listener.listen();
-
-  //-----------------------------------------------------------------------------
+  //---------------------------------------------------------------------------
 
       connection.close();
       return 0;

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify.in?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify.in (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify.in Fri Feb  8 14:23:23 2008
@@ -1,7 +1,6 @@
-==== ./declare_queues.out
-==== ./direct_producer.out
-==== ./listener.out
-Activating listener for: listener_destination
+==== declare_queues.out
+==== direct_producer.out
+==== listener.out
 Message: Message 0
 Message: Message 1
 Message: Message 2
@@ -13,4 +12,4 @@
 Message: Message 8
 Message: Message 9
 Message: That's all, folks!
-Shutting down listener for listener_destination
+Shutting down listener for message_queue

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_cpp_python
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_cpp_python?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_cpp_python (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_cpp_python Fri Feb  8 14:23:23 2008
@@ -1,4 +1,4 @@
 # See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=../../../../python/examples/direct
+py=$PYTHON_EXAMPLES/direct
 clients ./declare_queues ./direct_producer $py/direct_consumer.py
 outputs  ./declare_queues.out ./direct_producer.out $py/direct_consumer.py.out

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_cpp_python.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_cpp_python.in?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_cpp_python.in (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_cpp_python.in Fri Feb  8 14:23:23 2008
@@ -1,6 +1,6 @@
-==== ./declare_queues.out
-==== ./direct_producer.out
-==== ../../../../python/examples/direct/direct_consumer.py.out
+==== declare_queues.out
+==== direct_producer.out
+==== direct_consumer.py.out
 Message 0
 Message 1
 Message 2

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_python_cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_python_cpp?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_python_cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_python_cpp Fri Feb  8 14:23:23 2008
@@ -1,5 +1,5 @@
 # See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify 
-py=../../../../python/examples/direct
+py=$PYTHON_EXAMPLES/direct
 clients $py/declare_queues.py $py/direct_producer.py  ./listener
 outputs $py/declare_queues.py.out $py/direct_producer.py.out ./listener.out
 

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_python_cpp.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_python_cpp.in?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_python_cpp.in (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/direct/verify_python_cpp.in Fri Feb  8 14:23:23 2008
@@ -1,7 +1,6 @@
-==== ../../../../python/examples/direct/declare_queues.py.out
-==== ../../../../python/examples/direct/direct_producer.py.out
-==== ./listener.out
-Activating listener for: listener_destination
+==== declare_queues.py.out
+==== direct_producer.py.out
+==== listener.out
 Message: message 0
 Message: message 1
 Message: message 2
@@ -13,4 +12,4 @@
 Message: message 8
 Message: message 9
 Message: That's all, folks!
-Shutting down listener for listener_destination
+Shutting down listener for message_queue

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/declare_queues.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/declare_queues.cpp?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/declare_queues.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/declare_queues.cpp Fri Feb  8 14:23:23 2008
@@ -20,21 +20,16 @@
  */
 
 /**
- *  direct_config_queues.cpp
+ *  declare_queues.cpp (this program):
  *
  *  This program is one of three programs designed to be used
- *  together. These programs use the "amq.direct" exchange.
+ *  together. These programs use the "amq.fanout" exchange.
  *  
- *  direct_config_queues.cpp (this program):
- *
- *      Creates a queue on a broker, binding a routing key to route
- *      messages to that queue.
- *
- *  direct_publisher.cpp:
+ *  fanout_producer.cpp:
  *
  *      Publishes to a broker, specifying a routing key.
  *
- *  direct_listener.cpp
+ * listener.cpp
  *
  *      Reads from a queue on the broker using a message listener.
  *
@@ -65,9 +60,7 @@
 
   //--------- Main body of program --------------------------------------------
 
-      // Create a queue named "message_queue", and route all messages whose
-      // routing key is "routing_key to this newly created queue.
-
+      // Create and bind a queue named "message_queue".
       session.queueDeclare(arg::queue="message_queue");
       session.queueBind(arg::queue="message_queue", arg::exchange="amq.fanout");
 

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/fanout_producer.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/fanout_producer.cpp?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/fanout_producer.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/fanout_producer.cpp Fri Feb  8 14:23:23 2008
@@ -21,22 +21,22 @@
 
 
 /**
- *  direct_publisher.cpp:
+ *  fanout_producer.cpp:
  *
  *  This program is one of three programs designed to be used
  *  together. These programs do not specify the exchange type - the
  *  default exchange type is the direct exchange.
  *  
- *    direct_config_queues.cpp:
+ *    declare_queues.cpp:
  *
  *      Creates a queue on a broker, binding a routing key to route
  *      messages to that queue.
  *
- *    direct_publisher.cpp (this program):
+ *    fanout_producer.cpp (this program):
  *
  *      Publishes to a broker, specifying a routing key.
  *
- *    direct_listener.cpp
+ *    listener.cpp
  *
  *      Reads from a queue on the broker using a message listener.
  *

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/listener.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/listener.cpp?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/listener.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/listener.cpp Fri Feb  8 14:23:23 2008
@@ -20,32 +20,15 @@
  */
 
 /**
- *  direct_listener.cpp:
- *
- *  This program is one of three programs designed to be used
- *  together. These programs do not specify the exchange type - the
- *  default exchange type is the direct exchange.
- *  
- *    direct_config_queues.cpp:
- *
- *      Creates a queue on a broker, binding a routing key to route
- *      messages to that queue.
- *
- *    direct_publisher.cpp:
- *
- *      Publishes to a broker, specifying a routing key.
- *
- *    direct_listener.cpp (this program):
- *
- *      Reads from a queue on the broker using a message listener.
- *
+ *  listener.cpp: This program reads messages fro a queue on
+ *  the broker using a message listener.
  */
 
 #include <qpid/client/Dispatcher.h>
 #include <qpid/client/Connection.h>
 #include <qpid/client/Session.h>
 #include <qpid/client/Message.h>
-#include <qpid/client/MessageListener.h>
+#include <qpid/client/SubscriptionManager.h>
 
 #include <unistd.h>
 #include <cstdlib>
@@ -56,43 +39,25 @@
 
       
 class Listener : public MessageListener{
-private:
-  std::string destination_name;
-  Dispatcher dispatcher;
-public:
-  Listener(Session& session, string destination_name): 
-    destination_name(destination_name),
-    dispatcher(session)
-  {};
-
-  virtual void listen();
-  virtual void received(Message& message);
-  ~Listener() { };
+  private:
+    SubscriptionManager& subscriptions;
+  public:
+    Listener(SubscriptionManager& subscriptions);
+    virtual void received(Message& message);
 };
 
-
-void Listener::listen() {
-  std::cout << "Activating listener for: " <<destination_name << std::endl;
-  dispatcher.listen(destination_name, this);
-
-  // ### The following line gives up control - it should be possible
-  // ### to listen without giving up control!
-
-  dispatcher.run();
-}
-
+Listener::Listener(SubscriptionManager& subs) : subscriptions(subs)
+{}
 
 void Listener::received(Message& message) {
   std::cout << "Message: " << message.getData() << std::endl;
-
   if (message.getData() == "That's all, folks!") {
-      std::cout << "Shutting down listener for " <<destination_name << std::endl;
-      dispatcher.stop();
+      std::cout << "Shutting down listener for " << message.getDestination()
+                << std::endl;
+      subscriptions.cancel(message.getDestination());
   }
 }
 
-
-
 int main(int argc, char** argv) {
     const char* host = argc>1 ? argv[1] : "127.0.0.1";
     int port = argc>2 ? atoi(argv[2]) : 5672;
@@ -104,24 +69,15 @@
 
   //--------- Main body of program --------------------------------------------
 
+      SubscriptionManager subscriptions(session);
+      // Create a listener and subscribe it to the queue named "message_queue"
+      Listener listener(subscriptions);
+      subscriptions.subscribe(listener, "message_queue");
+      // Deliver messages until the subscription is cancelled
+      // by Listener::received()
+      subscriptions.run();
 
-      //  Subscribe to the queue, route it to a client destination for
-      //  the  listener. (The destination  name merely  identifies the
-      //  destination in the listener, you can use any name as long as
-      //  you use the same name for the listener).
-
-      session.messageSubscribe(arg::queue="message_queue", arg::destination="listener_destination");
-
-      session.messageFlow(arg::destination="listener_destination", arg::unit=0, arg::value=1);//messages ### Define a constant?
-      session.messageFlow(arg::destination="listener_destination", arg::unit=1, arg::value=0xFFFFFFFF);//bytes ###### Define a constant?
-
-      //  Tell the listener to listen to the destination we just
-      //  created above.
-
-      Listener listener(session, "listener_destination");
-      listener.listen();
-
-  //-----------------------------------------------------------------------------
+  //---------------------------------------------------------------------------
 
       connection.close();
       return 0;

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify.in?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify.in (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify.in Fri Feb  8 14:23:23 2008
@@ -1,7 +1,6 @@
-==== ./declare_queues.out
-==== ./fanout_producer.out
-==== ./listener.out
-Activating listener for: listener_destination
+==== declare_queues.out
+==== fanout_producer.out
+==== listener.out
 Message: Message 0
 Message: Message 1
 Message: Message 2
@@ -13,4 +12,4 @@
 Message: Message 8
 Message: Message 9
 Message: That's all, folks!
-Shutting down listener for listener_destination
+Shutting down listener for message_queue

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_cpp_python
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_cpp_python?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_cpp_python (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_cpp_python Fri Feb  8 14:23:23 2008
@@ -1,5 +1,5 @@
 # See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify 
-py=../../../../python/examples/fanout
+py=$PYTHON_EXAMPLES/fanout
 clients ./declare_queues ./fanout_producer $py/fanout_consumer.py
 outputs ./declare_queues.out ./fanout_producer.out $py/fanout_consumer.py.out
 

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_cpp_python.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_cpp_python.in?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_cpp_python.in (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_cpp_python.in Fri Feb  8 14:23:23 2008
@@ -1,6 +1,6 @@
-==== ./declare_queues.out
-==== ./fanout_producer.out
-==== ../../../../python/examples/fanout/fanout_consumer.py.out
+==== declare_queues.out
+==== fanout_producer.out
+==== fanout_consumer.py.out
 Message 0
 Message 1
 Message 2

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_python_cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_python_cpp?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_python_cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_python_cpp Fri Feb  8 14:23:23 2008
@@ -1,5 +1,5 @@
 # See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify 
-py=../../../../python/examples/fanout
-clients $py/declare_queues.py $py/fanout_producer .py ./listener
+py=$PYTHON_EXAMPLES/fanout
+clients $py/declare_queues.py $py/fanout_producer.py ./listener
 outputs $py/declare_queues.py.out $py/fanout_producer.py.out ./listener.out
 

Added: incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_python_cpp.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_python_cpp.in?rev=620014&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_python_cpp.in (added)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/fanout/verify_python_cpp.in Fri Feb  8 14:23:23 2008
@@ -0,0 +1,15 @@
+==== declare_queues.py.out
+==== fanout_producer.py.out
+==== listener.out
+Message: message 0
+Message: message 1
+Message: message 2
+Message: message 3
+Message: message 4
+Message: message 5
+Message: message 6
+Message: message 7
+Message: message 8
+Message: message 9
+Message: That's all, folks!
+Shutting down listener for message_queue

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify.in?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify.in (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify.in Fri Feb  8 14:23:23 2008
@@ -1,4 +1,4 @@
-==== ./topic_publisher.out
+==== topic_publisher.out
 ==== topic_listener.out | remove_uuid | sort
 Declaring queue: europe
 Declaring queue: news

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_cpp_python
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_cpp_python?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_cpp_python (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_cpp_python Fri Feb  8 14:23:23 2008
@@ -1,5 +1,5 @@
 # See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify 
-py=../../../../python/examples/pubsub
+py=$PYTHON_EXAMPLES/pubsub
 background "Queues created" $py/topic_subscriber.py
 clients ./topic_publisher
 outputs ./topic_publisher.out "$py/topic_subscriber.py.out | remove_uuid64 | sort"

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_cpp_python.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_cpp_python.in?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_cpp_python.in (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_cpp_python.in Fri Feb  8 14:23:23 2008
@@ -1,5 +1,5 @@
-==== ./topic_publisher.out
-==== ../../../../python/examples/pubsub/topic_subscriber.py.out | remove_uuid64 | sort
+==== topic_publisher.out
+==== topic_subscriber.py.out | remove_uuid64 | sort
 Message 0
 Message 0
 Message 0

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_python_cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_python_cpp?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_python_cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_python_cpp Fri Feb  8 14:23:23 2008
@@ -1,5 +1,5 @@
 # See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify 
-py=../../../../python/examples/pubsub
+py=$PYTHON_EXAMPLES/pubsub
 background "Listening" ./topic_listener
 clients $py/topic_publisher.py
 outputs $py/topic_publisher.py.out "topic_listener.out | remove_uuid | sort"

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_python_cpp.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_python_cpp.in?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_python_cpp.in (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/pub-sub/verify_python_cpp.in Fri Feb  8 14:23:23 2008
@@ -1,4 +1,4 @@
-==== ../../../../python/examples/pubsub/topic_publisher.py.out
+==== topic_publisher.py.out
 ==== topic_listener.out | remove_uuid | sort
 Declaring queue: europe
 Declaring queue: news

Modified: 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=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify Fri Feb  8 14:23:23 2008
@@ -2,4 +2,4 @@
 background "Waiting" ./server
 clients ./client
 kill %% 			# Must kill the server.
-outputs "./client.out | remove_uuid" " server.out | remove_uuid"
+outputs "./client.out | remove_uuid" "server.out | remove_uuid"

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify.in?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify.in (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify.in Fri Feb  8 14:23:23 2008
@@ -1,4 +1,4 @@
-==== ./client.out | remove_uuid
+==== client.out | remove_uuid
 Activating response queue listener for: client
 Request: Twas brillig, and the slithy toves
 Request: Did gire and gymble in the wabe.
@@ -10,7 +10,7 @@
 Response: ALL MIMSY WERE THE BOROGROVES,
 Response: AND THE MOME RATHS OUTGRABE.
 Shutting down listener for client
-====  server.out | remove_uuid
+==== server.out | remove_uuid
 Activating request queue listener for: request
 Waiting for requests
 Request: Twas brillig, and the slithy toves  (client)

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_cpp_python
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_cpp_python?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_cpp_python (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_cpp_python Fri Feb  8 14:23:23 2008
@@ -1,6 +1,5 @@
 # See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify 
-py=../../../../python/examples/request-response
-background "Request server running" $py/server.py
+background "Request server running" $PYTHON_EXAMPLES/request-response/server.py
 clients ./client
 kill %% 			# Must kill the server.
-outputs "./client.out | remove_uuid" "$py/server.py.out | remove_uuid64"
+outputs "./client.out | remove_uuid" "$PYTHON_EXAMPLES/request-response/server.py.out | remove_uuid64"

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_cpp_python.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_cpp_python.in?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_cpp_python.in (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_cpp_python.in Fri Feb  8 14:23:23 2008
@@ -1,4 +1,4 @@
-==== ./client.out | remove_uuid
+==== client.out | remove_uuid
 Activating response queue listener for: client
 Request: Twas brillig, and the slithy toves
 Request: Did gire and gymble in the wabe.
@@ -10,6 +10,6 @@
 Response: ALL MIMSY WERE THE BOROGROVES,
 Response: AND THE MOME RATHS OUTGRABE.
 Shutting down listener for client
-==== ../../../../python/examples/request-response/server.py.out | remove_uuid64
+==== server.py.out | remove_uuid64
 Request server running - run your client now.
 (Times out after 100 seconds ...)

Modified: incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_python_cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_python_cpp?rev=620014&r1=620013&r2=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_python_cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_python_cpp Fri Feb  8 14:23:23 2008
@@ -1,6 +1,5 @@
 # See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify 
-py=../../../../python/examples/request-response
-background "Request server running" ./server
-clients $py/client.py
+background "Waiting" ./server
+clients $PYTHON_EXAMPLES/request-response/client.py
 kill %% 			# Must kill the server.
-outputs "./client.py.out | remove_uuid64" " server.out | remove_uuid"
+outputs "$PYTHON_EXAMPLES/request-response/client.py.out | remove_uuid64" "server.out | remove_uuid64"

Added: incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_python_cpp.in
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_python_cpp.in?rev=620014&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_python_cpp.in (added)
+++ incubator/qpid/trunk/qpid/cpp/examples/examples/request-response/verify_python_cpp.in Fri Feb  8 14:23:23 2008
@@ -0,0 +1,18 @@
+==== 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.out | remove_uuid64
+Activating request queue listener for: request
+Waiting for requests
+Request: Twas brilling, and the slithy toves  (ReplyTo:)
+Request: Did gyre and gimble in the wabe.  (ReplyTo:)
+Request: All mimsy were the borogroves,  (ReplyTo:)
+Request: And the mome raths outgrabe.  (ReplyTo:)

Copied: incubator/qpid/trunk/qpid/cpp/examples/verify (from r619977, incubator/qpid/trunk/qpid/bin/verify)
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/verify?p2=incubator/qpid/trunk/qpid/cpp/examples/verify&p1=incubator/qpid/trunk/qpid/bin/verify&r1=619977&r2=620014&rev=620014&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/bin/verify (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/verify Fri Feb  8 14:23:23 2008
@@ -36,11 +36,16 @@
     waitfor $out "$pattern"
 }
 
+name() {
+    for x in $*; do name="$name `basename $x`"; done
+    echo $name;
+}
+
 outputs() {
     wait 2> /dev/null		# Wait for all backgroud processes to complete
     rm -f $script.out
     for f in "$@"; do
-	{ echo "==== $f"; eval "cat $f"; } >> $script.out || fail
+	{ echo "==== `name $f`"; eval "cat $f"; } >> $script.out || fail
     done
 }
 
@@ -49,6 +54,7 @@
     if [ -d $1 ]; then dir=$1; script=verify;
     else dir=`dirname $1`; script=`basename $1`; fi
     cd $dir || return 1
+    rm -f *.out
     { source ./$script && diff -ac $script.out $script.in ; } || fail
     test -z "$FAIL" && rm -f *.out
     return $FAIL
@@ -59,7 +65,7 @@
     sed "s/$HEX\{8\}-$HEX\{4\}-$HEX\{4\}-$HEX\{4\}-$HEX\{12\}//g" $*
 }
 remove_uuid64() {
-    sed 's/[-A-Za-z0-9_]\{22\}==$//' $*
+    sed 's/[-A-Za-z0-9_]\{22\}==//g' $*
 }
 
 # Start private broker if QPIDD is set.

Added: incubator/qpid/trunk/qpid/cpp/examples/verify_all
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/verify_all?rev=620014&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/verify_all (added)
+++ incubator/qpid/trunk/qpid/cpp/examples/verify_all Fri Feb  8 14:23:23 2008
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Verify all C++/python example combinations.
+#
+verify=$1; shift
+qpidd=$1; shift
+cpp=$1; shift
+ 
+trap "$qpidd -q" exit
+export QPID_PORT=`$qpidd -dp0 --data-dir ""`
+export PYTHON_EXAMPLES
+
+find="find $cpp"
+test -d $PYTHON_EXAMPLES && find="$find $PYTHON_EXAMPLES"
+find="$find -name verify"
+test -d $PYTHON_EXAMPLES && \
+    find="$find -o -name verify_cpp_python -o -name verify_python_cpp"
+$verify `$find`
+

Propchange: incubator/qpid/trunk/qpid/cpp/examples/verify_all
------------------------------------------------------------------------------
    svn:executable = *