diff options
author | Aidan Skinner <aidan@apache.org> | 2008-04-18 16:09:03 +0000 |
---|---|---|
committer | Aidan Skinner <aidan@apache.org> | 2008-04-18 16:09:03 +0000 |
commit | 802de181b8cb1c7f9c68a8f7ef7da26a5d94aeb4 (patch) | |
tree | 82caf8a9c34fdc11d675ddd0e340ade3ff5553bd /qpid/cpp/src/tests/ClientSessionTest.cpp | |
parent | f49b101f80507febfa94a17c98c0403979e721c4 (diff) | |
download | qpid-python-802de181b8cb1c7f9c68a8f7ef7da26a5d94aeb4.tar.gz |
Merged revisions 648217-649481 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/trunk
........
r648272 | aconway | 2008-04-15 15:54:46 +0100 (Tue, 15 Apr 2008) | 1 line
Fix build error: MapValue SIZE was too small for Struct32.
........
r648288 | astitcher | 2008-04-15 16:41:21 +0100 (Tue, 15 Apr 2008) | 4 lines
Refactored the IO framework that sits on top of Poller so that it uses a generalised IOHandle.
This means that you can define new classes derived from IOHandle (other than Socket) that
can also be added to a Poller and waited for.
........
r648292 | nsantos | 2008-04-15 16:46:38 +0100 (Tue, 15 Apr 2008) | 1 line
add svn revision include to specfile
........
r648297 | aconway | 2008-04-15 16:57:58 +0100 (Tue, 15 Apr 2008) | 2 lines
Cleanup of size calculations and handling UnknownStruct
........
r648308 | nsantos | 2008-04-15 17:12:01 +0100 (Tue, 15 Apr 2008) | 1 line
QPID-921: applied qpid-patch36.diff on behalf of Ted Ross
........
r648329 | aconway | 2008-04-15 18:00:40 +0100 (Tue, 15 Apr 2008) | 2 lines
Disabled failing tests, working on fixing the issues.
........
r648338 | aconway | 2008-04-15 18:10:59 +0100 (Tue, 15 Apr 2008) | 1 line
Comment out failing test, repairing.
........
r648362 | aconway | 2008-04-15 19:23:55 +0100 (Tue, 15 Apr 2008) | 4 lines
Correct Struct32 encoding: size/code/data.
Proper re-encoding for unknown struct codes.
........
r648418 | aconway | 2008-04-15 22:32:35 +0100 (Tue, 15 Apr 2008) | 1 line
Fix build error - missing op << for Struct32.
........
r648661 | arnaudsimon | 2008-04-16 11:32:23 +0100 (Wed, 16 Apr 2008) | 1 line
QPID-928 Added a pause period for letting the finalyzer a chance to notify all the Mina connector threads before we check for spurious threads.
........
r648681 | arnaudsimon | 2008-04-16 13:28:31 +0100 (Wed, 16 Apr 2008) | 1 line
QPID-897: this test was intermittently timing out when messages are not prefetched. This is a temporary fix until we use a configurable timeout.
........
r648692 | rhs | 2008-04-16 14:32:13 +0100 (Wed, 16 Apr 2008) | 1 line
QPID-901: updates to the java client to use the 0-10 final spec instead of the 0-10 preview spec; this includes improvements to the codegen process as well as some modifications to the shared code path in the client to not lose per message state when consumers are closed.
........
r648699 | rhs | 2008-04-16 14:58:35 +0100 (Wed, 16 Apr 2008) | 1 line
QPID-901: add back ExceptionHelper.java to fix the build
........
r648706 | aconway | 2008-04-16 15:32:33 +0100 (Wed, 16 Apr 2008) | 2 lines
Fix bug in Blob::assign assigning from an empty blob.
........
r648724 | aconway | 2008-04-16 16:33:51 +0100 (Wed, 16 Apr 2008) | 3 lines
Fix encoding for sized structs.
........
r648726 | aconway | 2008-04-16 16:45:01 +0100 (Wed, 16 Apr 2008) | 3 lines
Separate new codec from liqqpidcommon to improve link times.
To be included in libqpidcommon when we are ready to replace framing codec.
........
r648770 | aconway | 2008-04-16 19:01:28 +0100 (Wed, 16 Apr 2008) | 2 lines
Removed complex_types.h from Makefile.am.
........
r648771 | rhs | 2008-04-16 19:03:22 +0100 (Wed, 16 Apr 2008) | 1 line
QPID-901: don't depend on constant values matching up when converting between JMS and AMQP delivery modes
........
r648782 | aconway | 2008-04-16 19:23:14 +0100 (Wed, 16 Apr 2008) | 1 line
Add missing files to packaging.
........
r648784 | rhs | 2008-04-16 19:25:29 +0100 (Wed, 16 Apr 2008) | 1 line
QPID-901: updated the JMS examples to use legal delivery mode values as they are now checked with the 0-10 final updates
........
r648904 | astitcher | 2008-04-17 01:19:14 +0100 (Thu, 17 Apr 2008) | 7 lines
Refactored IO Thread creation so that it happens in the Broker class
- There is now a single Poller created by the Broker class that is
passed to the Acceptor for use in network IO. It can also now be passed
to anything else that wants to put work in the IO threads
- The Broker class itself is now responsible for actually creating the
threads
........
r649016 | arnaudsimon | 2008-04-17 10:20:24 +0100 (Thu, 17 Apr 2008) | 1 line
QPID-919 Changed AMQBrokerDetails to throw an URL exception when the port number is not specified.
........
r649059 | gsim | 2008-04-17 13:21:38 +0100 (Thu, 17 Apr 2008) | 3 lines
Some fixes to the transitional spec defs.
........
r649070 | arnaudsimon | 2008-04-17 13:44:35 +0100 (Thu, 17 Apr 2008) | 1 line
QPID-796 Made connection URL property + use session level method
........
r649099 | arnaudsimon | 2008-04-17 14:47:29 +0100 (Thu, 17 Apr 2008) | 1 line
QPID-884 Added cpp profile that does not use a store. Also updated profile for taking auth into account and updated broker.clean as per QPID-904
........
r649126 | nsantos | 2008-04-17 15:31:01 +0100 (Thu, 17 Apr 2008) | 1 line
add full path to qpidd in init script, as it fails in some environments with just the command name
........
r649130 | aconway | 2008-04-17 15:42:09 +0100 (Thu, 17 Apr 2008) | 4 lines
Added missing .h files to Makefile.am to fix make rpmbuild.
Add non-const Message::data()
Make log/Statement.h public.
........
r649159 | aconway | 2008-04-17 17:01:05 +0100 (Thu, 17 Apr 2008) | 4 lines
src/Makefile.am: Fix problems with rpmbuild.
src/tests/README: Updated information about boost test.
........
r649294 | astitcher | 2008-04-17 22:46:22 +0100 (Thu, 17 Apr 2008) | 2 lines
Patch for improved compatibility with gcc 3.4 and boost 1.33
........
r649339 | aconway | 2008-04-18 01:54:14 +0100 (Fri, 18 Apr 2008) | 3 lines
src/tests/python_tests: fix exit status if QPID_NO_PREVIEW is set.
src/qpid/framing/AMQFrame.h: frame header setters/getters with 0-10 naming.
........
r649409 | arnaudsimon | 2008-04-18 09:43:53 +0100 (Fri, 18 Apr 2008) | 1 line
QPID-798 Make property per connection and/or system wide; change name to SYNC_PERSISTENT to denote only used on persistent messages
........
r649436 | arnaudsimon | 2008-04-18 10:50:13 +0100 (Fri, 18 Apr 2008) | 1 line
QPID-936: added missing session close op
........
r649479 | kpvdr | 2008-04-18 13:09:42 +0100 (Fri, 18 Apr 2008) | 1 line
Fix to prevent possible Timer deadlocks by holding onto mutex while calling fire()
........
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/thegreatmerge@649585 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/ClientSessionTest.cpp')
-rw-r--r-- | qpid/cpp/src/tests/ClientSessionTest.cpp | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/qpid/cpp/src/tests/ClientSessionTest.cpp b/qpid/cpp/src/tests/ClientSessionTest.cpp index 7a997db327..44d5ed4650 100644 --- a/qpid/cpp/src/tests/ClientSessionTest.cpp +++ b/qpid/cpp/src/tests/ClientSessionTest.cpp @@ -102,39 +102,42 @@ struct ClientSessionFixture : public ProxySessionFixture } }; -BOOST_FIXTURE_TEST_CASE(testQueueQuery, ClientSessionFixture) { - session =connection.newSession(ASYNC); - session.queueDeclare(queue="my-queue", alternateExchange="amq.fanout", exclusive=true, autoDelete=true); - TypedResult<QueueQueryResult> result = session.queueQuery(string("my-queue")); +QPID_AUTO_TEST_CASE(testQueueQuery) { + ClientSessionFixture fix; + fix.session = fix.connection.newSession(ASYNC); + fix.session.queueDeclare(queue="my-queue", alternateExchange="amq.fanout", exclusive=true, autoDelete=true); + TypedResult<QueueQueryResult> result = fix.session.queueQuery(string("my-queue")); BOOST_CHECK_EQUAL(false, result.get().getDurable()); BOOST_CHECK_EQUAL(true, result.get().getExclusive()); BOOST_CHECK_EQUAL(string("amq.fanout"), result.get().getAlternateExchange()); } -BOOST_FIXTURE_TEST_CASE(testTransfer, ClientSessionFixture) +QPID_AUTO_TEST_CASE(testTransfer) { - session=connection.newSession(ASYNC); - declareSubscribe(); - session.messageTransfer(content=TransferContent("my-message", "my-queue")); + ClientSessionFixture fix; + fix.session=fix.connection.newSession(ASYNC); + fix.declareSubscribe(); + fix.session.messageTransfer(content=TransferContent("my-message", "my-queue")); //get & test the message: - FrameSet::shared_ptr msg = session.get(); + FrameSet::shared_ptr msg = fix.session.get(); BOOST_CHECK(msg->isA<MessageTransferBody>()); BOOST_CHECK_EQUAL(string("my-message"), msg->getContent()); //confirm receipt: - session.getExecution().completed(msg->getId(), true, true); + fix.session.getExecution().completed(msg->getId(), true, true); } -BOOST_FIXTURE_TEST_CASE(testDispatcher, ClientSessionFixture) +QPID_AUTO_TEST_CASE(testDispatcher) { - session =connection.newSession(ASYNC); - declareSubscribe(); + ClientSessionFixture fix; + fix.session =fix.connection.newSession(ASYNC); + fix.declareSubscribe(); size_t count = 100; for (size_t i = 0; i < count; ++i) - session.messageTransfer(content=TransferContent(lexical_cast<string>(i), "my-queue")); - DummyListener listener(session, "my-dest", count); + fix.session.messageTransfer(content=TransferContent(lexical_cast<string>(i), "my-queue")); + DummyListener listener(fix.session, "my-dest", count); listener.run(); - BOOST_REQUIRE_EQUAL(count, listener.messages.size()); + BOOST_CHECK_EQUAL(count, listener.messages.size()); for (size_t i = 0; i < count; ++i) BOOST_CHECK_EQUAL(lexical_cast<string>(i), listener.messages[i].getData()); } @@ -158,35 +161,38 @@ BOOST_FIXTURE_TEST_CASE(testDispatcherThread, ClientSessionFixture) } */ -BOOST_FIXTURE_TEST_CASE(_FIXTURE, ClientSessionFixture) +QPID_AUTO_TEST_CASE(_FIXTURE) { - session =connection.newSession(ASYNC, 0); - session.suspend(); // session has 0 timeout. + ClientSessionFixture fix; + fix.session =fix.connection.newSession(ASYNC, 0); + fix.session.suspend(); // session has 0 timeout. try { - connection.resume(session); + fix.connection.resume(fix.session); BOOST_FAIL("Expected InvalidArgumentException."); } catch(const InternalErrorException&) {} } -BOOST_FIXTURE_TEST_CASE(testUseSuspendedError, ClientSessionFixture) +QPID_AUTO_TEST_CASE(testUseSuspendedError) { - session =connection.newSession(ASYNC, 60); - session.suspend(); + ClientSessionFixture fix; + fix.session =fix.connection.newSession(ASYNC, 60); + fix.session.suspend(); try { - session.exchangeQuery(name="amq.fanout"); + fix.session.exchangeQuery(name="amq.fanout"); BOOST_FAIL("Expected session suspended exception"); } catch(const CommandInvalidException&) {} } -BOOST_FIXTURE_TEST_CASE(testSuspendResume, ClientSessionFixture) +QPID_AUTO_TEST_CASE(testSuspendResume) { - session =connection.newSession(ASYNC, 60); - declareSubscribe(); - session.suspend(); + ClientSessionFixture fix; + fix.session =fix.connection.newSession(ASYNC, 60); + fix.declareSubscribe(); + fix.session.suspend(); // Make sure we are still subscribed after resume. - connection.resume(session); - session.messageTransfer(content=TransferContent("my-message", "my-queue")); - FrameSet::shared_ptr msg = session.get(); + fix.connection.resume(fix.session); + fix.session.messageTransfer(content=TransferContent("my-message", "my-queue")); + FrameSet::shared_ptr msg = fix.session.get(); BOOST_CHECK_EQUAL(string("my-message"), msg->getContent()); } |