diff options
| author | Gordon Sim <gsim@apache.org> | 2007-09-10 08:41:05 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2007-09-10 08:41:05 +0000 |
| commit | ddd56802f65dfea1743d8dd55f6911bfafd1c778 (patch) | |
| tree | a69269eb97fb708afd58b4b5b2c803235ab43865 /qpid/cpp/src/tests | |
| parent | f91b4e6413c4feafcb26863f750f87d36a59c427 (diff) | |
| download | qpid-python-ddd56802f65dfea1743d8dd55f6911bfafd1c778.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@574176 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests')
| -rw-r--r-- | qpid/cpp/src/tests/ClientSessionTest.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/qpid/cpp/src/tests/ClientSessionTest.cpp b/qpid/cpp/src/tests/ClientSessionTest.cpp index 1acac9c980..a3d50d0ae9 100644 --- a/qpid/cpp/src/tests/ClientSessionTest.cpp +++ b/qpid/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); } }; |
