summaryrefslogtreecommitdiff
path: root/cpp/src/tests/ClientSessionTest.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-09-10 08:41:05 +0000
committerGordon Sim <gsim@apache.org>2007-09-10 08:41:05 +0000
commita5c0fde5d0b96ae0b747f0cea21414753d6ee654 (patch)
tree4a809a880691db3e04fa3c7374db500b767ca85b /cpp/src/tests/ClientSessionTest.cpp
parent783b718d0b270121cd2e597424d0c81adea77a38 (diff)
downloadqpid-python-a5c0fde5d0b96ae0b747f0cea21414753d6ee654.tar.gz
Client side support for message and delivery properties in header segments.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@574176 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/ClientSessionTest.cpp')
-rw-r--r--cpp/src/tests/ClientSessionTest.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/cpp/src/tests/ClientSessionTest.cpp b/cpp/src/tests/ClientSessionTest.cpp
index 1acac9c980..a3d50d0ae9 100644
--- a/cpp/src/tests/ClientSessionTest.cpp
+++ b/cpp/src/tests/ClientSessionTest.cpp
@@ -22,6 +22,7 @@
#include "qpid_test_plugin.h"
#include "InProcessBroker.h"
#include "qpid/client/Session.h"
+#include "qpid/framing/TransferContent.h"
using namespace qpid::client;
using namespace qpid::framing;
@@ -29,7 +30,8 @@ using namespace qpid::framing;
class ClientSessionTest : public CppUnit::TestCase
{
CPPUNIT_TEST_SUITE(ClientSessionTest);
- CPPUNIT_TEST(testQueueQuery);;
+ CPPUNIT_TEST(testQueueQuery);
+ CPPUNIT_TEST(testTransfer);
CPPUNIT_TEST_SUITE_END();
boost::shared_ptr<Connector> broker;
@@ -55,14 +57,24 @@ class ClientSessionTest : public CppUnit::TestCase
CPPUNIT_ASSERT_EQUAL(alternate, result.get().getAlternateExchange());
}
- void testCompletion()
+ void testTransfer()
{
std::string queue("my-queue");
std::string dest("my-dest");
+ std::string data("my message");
session.queueDeclare(0, queue, "", false, false, true, true, FieldTable());
- //subcribe to the queue with confirm_mode = 1
+ //subcribe to the queue with confirm_mode = 1:
session.messageSubscribe(0, queue, dest, false, 1, 0, false, FieldTable());
- //publish some messages
+ //publish a message:
+ TransferContent content(data);
+ content.getDeliveryProperties().setRoutingKey("my-queue");
+ session.messageTransfer(0, "", 0, 0, content);
+ //get & test the message:
+ FrameSet::shared_ptr msg = session.get();
+ CPPUNIT_ASSERT(msg->isA<MessageTransferBody>());
+ CPPUNIT_ASSERT_EQUAL(data, msg->getContent());
+ //confirm receipt:
+ session.execution().completed(msg->getId(), true, true);
}
};