You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2016/04/12 16:07:43 UTC

qpid-interop-test git commit: QPIDIT-21: Updated to reflect latest C++ API changes in Qpid Proton

Repository: qpid-interop-test
Updated Branches:
  refs/heads/master a2bee83f0 -> a3753a434


QPIDIT-21: Updated to reflect latest C++ API changes in Qpid Proton


Project: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/commit/a3753a43
Tree: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/tree/a3753a43
Diff: http://git-wip-us.apache.org/repos/asf/qpid-interop-test/diff/a3753a43

Branch: refs/heads/master
Commit: a3753a434d0f89ab4afa43cfe5a768a422d696c9
Parents: a2bee83
Author: Kim van der Riet <kp...@apache.org>
Authored: Tue Apr 12 10:07:28 2016 -0400
Committer: Kim van der Riet <kp...@apache.org>
Committed: Tue Apr 12 10:07:28 2016 -0400

----------------------------------------------------------------------
 .../src/qpidit/shim/AmqpReceiver.cpp            | 28 ++++++++++----------
 .../src/qpidit/shim/AmqpReceiver.hpp            | 12 ++++-----
 .../src/qpidit/shim/AmqpSender.cpp              | 26 +++++++++---------
 .../src/qpidit/shim/AmqpSender.hpp              | 16 +++++------
 .../src/qpidit/shim/JmsReceiver.cpp             |  9 ++++---
 .../src/qpidit/shim/JmsReceiver.hpp             |  4 +--
 .../src/qpidit/shim/JmsSender.cpp               | 11 ++++----
 .../src/qpidit/shim/JmsSender.hpp               |  8 +++---
 8 files changed, 58 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/a3753a43/shims/qpid-proton-cpp/src/qpidit/shim/AmqpReceiver.cpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/qpidit/shim/AmqpReceiver.cpp b/shims/qpid-proton-cpp/src/qpidit/shim/AmqpReceiver.cpp
index de29d2d..0965092 100644
--- a/shims/qpid-proton-cpp/src/qpidit/shim/AmqpReceiver.cpp
+++ b/shims/qpid-proton-cpp/src/qpidit/shim/AmqpReceiver.cpp
@@ -23,9 +23,9 @@
 
 #include <iostream>
 #include <json/json.h>
-#include <proton/types.hpp>
+#include "proton/connection.hpp"
 #include "proton/container.hpp"
-#include "proton/event.hpp"
+#include <proton/types.hpp>
 #include "qpidit/QpidItErrors.hpp"
 
 namespace qpidit
@@ -49,11 +49,11 @@ namespace qpidit
             return _receivedValueList;
         }
 
-        void AmqpReceiver::on_container_start(proton::event &e, proton::container &c) {
+        void AmqpReceiver::on_container_start(proton::container &c) {
             _receiver = c.open_receiver(_brokerUrl);
         }
 
-        void AmqpReceiver::on_message(proton::event &e, proton::delivery &d, proton::message &m) {
+        void AmqpReceiver::on_message(proton::delivery &d, proton::message &m) {
             if (m.id().get<uint64_t>() < _received) return; // ignore duplicate
             if (_received < _expected) {
                 if (_amqpType.compare("null") == 0) {
@@ -148,25 +148,25 @@ namespace qpidit
             }
             _received++;
             if (_received >= _expected) {
-                e.receiver().close();
-                e.connection().close();
+                d.link().close();
+                d.connection().close();
             }
         }
 
-        void AmqpReceiver::on_connection_error(proton::event &e, proton::connection &c) {
-            std::cerr << "AmqpReceiver:on_connection_error() event=" << e.name() << std::endl;
+        void AmqpReceiver::on_connection_error(proton::connection &c) {
+            std::cerr << "AmqpReceiver:on_connection_error()" << std::endl;
         }
 
-        void AmqpReceiver::on_sender_error(proton::event &e, proton::sender& l) {
-            std::cerr << "AmqpReceiver:on_sender_error() event=" << e.name() << std::endl;
+        void AmqpReceiver::on_sender_error(proton::sender& l) {
+            std::cerr << "AmqpReceiver:on_sender_error()" << std::endl;
         }
 
-        void AmqpReceiver::on_transport_error(proton::event &e, proton::transport &t) {
-            std::cerr << "AmqpReceiver:on_transport_error() event=" << e.name() << std::endl;
+        void AmqpReceiver::on_transport_error(proton::transport &t) {
+            std::cerr << "AmqpReceiver:on_transport_error()" << std::endl;
         }
 
-        void AmqpReceiver::on_unhandled_error(proton::event &e, const proton::condition &c) {
-            std::cerr << "AmqpReceiver:on_unhandled_error() event=" << e.name() << " condition=" << c.name() << std::endl;
+        void AmqpReceiver::on_unhandled_error(const proton::condition &c) {
+            std::cerr << "AmqpReceiver:on_unhandled_error() condition=" << c.name() << std::endl;
         }
 
         // protected

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/a3753a43/shims/qpid-proton-cpp/src/qpidit/shim/AmqpReceiver.hpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/qpidit/shim/AmqpReceiver.hpp b/shims/qpid-proton-cpp/src/qpidit/shim/AmqpReceiver.hpp
index 896a42d..812043f 100644
--- a/shims/qpid-proton-cpp/src/qpidit/shim/AmqpReceiver.hpp
+++ b/shims/qpid-proton-cpp/src/qpidit/shim/AmqpReceiver.hpp
@@ -46,13 +46,13 @@ namespace qpidit
             AmqpReceiver(const std::string& brokerUrl, const std::string& amqpType, uint32_t exptected);
             virtual ~AmqpReceiver();
             Json::Value& getReceivedValueList();
-            void on_container_start(proton::event &e, proton::container &c);
-            void on_message(proton::event &e, proton::delivery &d, proton::message &m);
+            void on_container_start(proton::container &c);
+            void on_message(proton::delivery &d, proton::message &m);
 
-            void on_connection_error(proton::event &e, proton::connection &c);
-            void on_sender_error(proton::event &e, proton::sender& l);
-            void on_transport_error(proton::event &e, proton::transport &t);
-            void on_unhandled_error(proton::event &e, const proton::condition &c);
+            void on_connection_error(proton::connection &c);
+            void on_sender_error(proton::sender& l);
+            void on_transport_error(proton::transport &t);
+            void on_unhandled_error(const proton::condition &c);
         protected:
             static void checkMessageType(const proton::message& msg, proton::type_id msgType);
             static Json::Value& getMap(Json::Value& jsonMap, const proton::value& val);

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/a3753a43/shims/qpid-proton-cpp/src/qpidit/shim/AmqpSender.cpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/qpidit/shim/AmqpSender.cpp b/shims/qpid-proton-cpp/src/qpidit/shim/AmqpSender.cpp
index 77fbb0b..a4015eb 100644
--- a/shims/qpid-proton-cpp/src/qpidit/shim/AmqpSender.cpp
+++ b/shims/qpid-proton-cpp/src/qpidit/shim/AmqpSender.cpp
@@ -23,9 +23,9 @@
 
 #include <iostream>
 #include <json/json.h>
+#include "proton/connection.hpp"
 #include "proton/container.hpp"
 #include "proton/decimal.hpp"
-#include "proton/event.hpp"
 
 namespace qpidit
 {
@@ -45,11 +45,11 @@ namespace qpidit
 
         AmqpSender::~AmqpSender() {}
 
-        void AmqpSender::on_container_start(proton::event &e, proton::container &c) {
+        void AmqpSender::on_container_start(proton::container &c) {
             c.open_sender(_brokerUrl);
         }
 
-        void AmqpSender::on_sendable(proton::event &e, proton::sender &s) {
+        void AmqpSender::on_sendable(proton::sender &s) {
             if (_totalMsgs == 0) {
                 s.connection().close();
             } else if (_msgsSent == 0) {
@@ -65,31 +65,31 @@ namespace qpidit
             }
         }
 
-        void AmqpSender::on_delivery_accept(proton::event &e, proton::delivery &d) {
+        void AmqpSender::on_delivery_accept(proton::delivery &d) {
             _msgsConfirmed++;
             if (_msgsConfirmed == _totalMsgs) {
                 d.connection().close();
             }
         }
 
-        void AmqpSender::on_transport_close(proton::event &e, proton::transport &t) {
+        void AmqpSender::on_transport_close(proton::transport &t) {
             _msgsSent = _msgsConfirmed;
         }
 
-        void AmqpSender::on_connection_error(proton::event &e, proton::connection &c) {
-            std::cerr << "AmqpSender:on_connection_error() event=" << e.name() << std::endl;
+        void AmqpSender::on_connection_error(proton::connection &c) {
+            std::cerr << "AmqpSender:on_connection_error()" << std::endl;
         }
 
-        void AmqpSender::on_sender_error(proton::event &e, proton::sender& l) {
-            std::cerr << "AmqpSender:on_sender_error() event=" << e.name() << std::endl;
+        void AmqpSender::on_sender_error(proton::sender& l) {
+            std::cerr << "AmqpSender:on_sender_error()" << std::endl;
         }
 
-        void AmqpSender::on_transport_error(proton::event &e, proton::transport &t) {
-            std::cerr << "AmqpSender:on_transport_error() event=" << e.name() << std::endl;
+        void AmqpSender::on_transport_error(proton::transport &t) {
+            std::cerr << "AmqpSender:on_transport_error()" << std::endl;
         }
 
-        void AmqpSender::on_unhandled_error(proton::event &e, const proton::condition &c) {
-            std::cerr << "AmqpSender:on_unhandled_error() event=" << e.name() << " condition=" << c.name() << std::endl;
+        void AmqpSender::on_unhandled_error(const proton::condition &c) {
+            std::cerr << "AmqpSender:on_unhandled_error()" << " condition=" << c.name() << std::endl;
         }
 
         // protected

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/a3753a43/shims/qpid-proton-cpp/src/qpidit/shim/AmqpSender.hpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/qpidit/shim/AmqpSender.hpp b/shims/qpid-proton-cpp/src/qpidit/shim/AmqpSender.hpp
index 9a30ef2..90ec217 100644
--- a/shims/qpid-proton-cpp/src/qpidit/shim/AmqpSender.hpp
+++ b/shims/qpid-proton-cpp/src/qpidit/shim/AmqpSender.hpp
@@ -45,15 +45,15 @@ namespace qpidit
         public:
             AmqpSender(const std::string& brokerUrl, const std::string& amqpType, const Json::Value& testValues);
             virtual ~AmqpSender();
-            void on_container_start(proton::event &e, proton::container &c);
-            void on_sendable(proton::event &e, proton::sender &s);
-            void on_delivery_accept(proton::event &e, proton::delivery &d);
-            void on_transport_close(proton::event &e, proton::transport &t);
+            void on_container_start(proton::container &c);
+            void on_sendable(proton::sender &s);
+            void on_delivery_accept(proton::delivery &d);
+            void on_transport_close(proton::transport &t);
 
-            void on_connection_error(proton::event &e, proton::connection &c);
-            void on_sender_error(proton::event &e, proton::sender& l);
-            void on_transport_error(proton::event &e, proton::transport &t);
-            void on_unhandled_error(proton::event &e, const proton::condition &c);
+            void on_connection_error(proton::connection &c);
+            void on_sender_error(proton::sender& l);
+            void on_transport_error(proton::transport &t);
+            void on_unhandled_error(const proton::condition &c);
         protected:
             proton::message& setMessage(proton::message& msg, const Json::Value& testValue);
 

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/a3753a43/shims/qpid-proton-cpp/src/qpidit/shim/JmsReceiver.cpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/qpidit/shim/JmsReceiver.cpp b/shims/qpid-proton-cpp/src/qpidit/shim/JmsReceiver.cpp
index 8cd38d3..0fc700d 100644
--- a/shims/qpid-proton-cpp/src/qpidit/shim/JmsReceiver.cpp
+++ b/shims/qpid-proton-cpp/src/qpidit/shim/JmsReceiver.cpp
@@ -24,8 +24,8 @@
 #include <iostream>
 #include <json/json.h>
 #include <map>
+#include "proton/connection.hpp"
 #include "proton/container.hpp"
-#include "proton/event.hpp"
 #include "qpidit/QpidItErrors.hpp"
 
 namespace qpidit
@@ -59,11 +59,11 @@ namespace qpidit
             return _receivedValueMap;
         }
 
-        void JmsReceiver::on_container_start(proton::event &e, proton::container &c) {
+        void JmsReceiver::on_container_start(proton::container &c) {
             _receiver = c.open_receiver(_brokerUrl);
         }
 
-        void JmsReceiver::on_message(proton::event &e, proton::delivery &d, proton::message &m) {
+        void JmsReceiver::on_message(proton::delivery &d, proton::message &m) {
             if (_received < _expected) {
                 switch (m.message_annotations()[proton::symbol("x-opt-jms-msg-type")].get<int8_t>()) {
                 case JMS_MESSAGE_TYPE:
@@ -98,7 +98,8 @@ namespace qpidit
                 _received++;
                 if (_received >= _expected) {
                     _receiver.close();
-                    e.connection().close();
+                    d.link().close();
+                    d.connection().close();
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/a3753a43/shims/qpid-proton-cpp/src/qpidit/shim/JmsReceiver.hpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/qpidit/shim/JmsReceiver.hpp b/shims/qpid-proton-cpp/src/qpidit/shim/JmsReceiver.hpp
index f93430a..ffaf1ff 100644
--- a/shims/qpid-proton-cpp/src/qpidit/shim/JmsReceiver.hpp
+++ b/shims/qpid-proton-cpp/src/qpidit/shim/JmsReceiver.hpp
@@ -54,8 +54,8 @@ namespace qpidit
             JmsReceiver(const std::string& brokerUrl, const std::string& jmsMessageType, const Json::Value& testNumberMap);
             virtual ~JmsReceiver();
             Json::Value& getReceivedValueMap();
-            void on_container_start(proton::event &e, proton::container &c);
-            void on_message(proton::event &e, proton::delivery &d, proton::message &m);
+            void on_container_start(proton::container &c);
+            void on_message(proton::delivery &d, proton::message &m);
 
             static uint32_t getTotalNumExpectedMsgs(const Json::Value testNumberMap);
 

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/a3753a43/shims/qpid-proton-cpp/src/qpidit/shim/JmsSender.cpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/qpidit/shim/JmsSender.cpp b/shims/qpid-proton-cpp/src/qpidit/shim/JmsSender.cpp
index 8b43377..3b03ef5 100644
--- a/shims/qpid-proton-cpp/src/qpidit/shim/JmsSender.cpp
+++ b/shims/qpid-proton-cpp/src/qpidit/shim/JmsSender.cpp
@@ -25,8 +25,8 @@
 #include <iostream>
 #include <iomanip>
 #include <json/json.h>
+#include "proton/connection.hpp"
 #include "proton/container.hpp"
-#include "proton/event.hpp"
 #include "qpidit/QpidItErrors.hpp"
 #include <stdio.h>
 
@@ -56,11 +56,11 @@ namespace qpidit
 
         JmsSender::~JmsSender() {}
 
-        void JmsSender::on_container_start(proton::event &e, proton::container &c) {
+        void JmsSender::on_container_start(proton::container &c) {
             c.open_sender(_brokerUrl);
         }
 
-        void JmsSender::on_sendable(proton::event &e, proton::sender &s) {
+        void JmsSender::on_sendable(proton::sender &s) {
             if (_totalMsgs == 0) {
                 s.connection().close();
             } else if (_msgsSent == 0) {
@@ -72,14 +72,15 @@ namespace qpidit
             }
         }
 
-        void JmsSender::on_delivery_accept(proton::event &e, proton::delivery &d) {
+        void JmsSender::on_delivery_accept(proton::delivery &d) {
             _msgsConfirmed++;
             if (_msgsConfirmed == _totalMsgs) {
+                d.link().close();
                 d.connection().close();
             }
         }
 
-        void JmsSender::on_transport_close(proton::event &e, proton::transport &t) {
+        void JmsSender::on_transport_close(proton::transport &t) {
             _msgsSent = _msgsConfirmed;
         }
 

http://git-wip-us.apache.org/repos/asf/qpid-interop-test/blob/a3753a43/shims/qpid-proton-cpp/src/qpidit/shim/JmsSender.hpp
----------------------------------------------------------------------
diff --git a/shims/qpid-proton-cpp/src/qpidit/shim/JmsSender.hpp b/shims/qpid-proton-cpp/src/qpidit/shim/JmsSender.hpp
index 0749830..962f012 100644
--- a/shims/qpid-proton-cpp/src/qpidit/shim/JmsSender.hpp
+++ b/shims/qpid-proton-cpp/src/qpidit/shim/JmsSender.hpp
@@ -51,10 +51,10 @@ namespace qpidit
         public:
             JmsSender(const std::string& brokerUrl, const std::string& jmsMessageType, const Json::Value& testValues);
             virtual ~JmsSender();
-            void on_container_start(proton::event &e, proton::container &c);
-            void on_sendable(proton::event &e, proton::sender &s);
-            void on_delivery_accept(proton::event &e, proton::delivery &d);
-            void on_transport_close(proton::event &e, proton::transport &t);
+            void on_container_start(proton::container &c);
+            void on_sendable(proton::sender &s);
+            void on_delivery_accept(proton::delivery &d);
+            void on_transport_close(proton::transport &t);
         protected:
             void  sendMessages(proton::sender &s, const std::string& subType, const Json::Value& testValueMap);
             proton::message& setBytesMessage(proton::message& msg, const std::string& subType, const std::string& testValueStr);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org