From 3f6bd06a2515603d1b4f0133e529919b6d9a30e7 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 8 Jun 2009 17:39:24 +0000 Subject: If expiration is already set, don't alter it. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@782712 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/ClientSessionTest.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'cpp/src/tests/ClientSessionTest.cpp') diff --git a/cpp/src/tests/ClientSessionTest.cpp b/cpp/src/tests/ClientSessionTest.cpp index c82cb77e95..7a6373ac17 100644 --- a/cpp/src/tests/ClientSessionTest.cpp +++ b/cpp/src/tests/ClientSessionTest.cpp @@ -590,6 +590,20 @@ QPID_AUTO_TEST_CASE(testSessionIsValid) { BOOST_CHECK(!session.isValid()); } +QPID_AUTO_TEST_CASE(testExpirationNotAltered) { + ClientSessionFixture fix; + fix.session.queueDeclare(arg::queue="my-queue", arg::exclusive=true, arg::autoDelete=true); + + Message m("my-message", "my-queue"); + m.getDeliveryProperties().setTtl(60000); + m.getDeliveryProperties().setExpiration(12345); + fix.session.messageTransfer(arg::content=m); + Message got; + BOOST_CHECK(fix.subs.get(got, "my-queue")); + BOOST_CHECK_EQUAL("my-message", got.getData()); + BOOST_CHECK_EQUAL(12345u, got.getDeliveryProperties().getExpiration()); +} + QPID_AUTO_TEST_SUITE_END() -- cgit v1.2.1