summaryrefslogtreecommitdiff
path: root/cpp/src/tests/exception_test.cpp
Commit message (Collapse)AuthorAgeFilesLines
* NO-JIRA: eliminate SocketProxy from tests.Alan Conway2011-08-181-8/+6
| | | | | | | | | Was causing problems with changes to introduce IPv6. In most cases this was being used unnecessarilly due to cut-and-paste of tests. In the 2 cases it was useful, replaced by simply shutting down the broker to simulate network failure. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1159268 13f79535-47bb-0310-9956-ffa450edef68
* QPID-2527: Remove Thread::id member as its uses are better implemented by ↵Andrew Stitcher2010-04-211-1/+1
| | | | | | | | comparison operators. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@936537 13f79535-47bb-0310-9956-ffa450edef68
* Separate FailoverListener from client::Connection.Alan Conway2009-10-261-2/+2
| | | | | | | | | | | | | | | | | | client::ConnectionImpl used to contain a FailoverListener to subscribe for updates on the amq.failover exchange. This caused some lifecycle issues including memory leaks. Now FailoverListener is a public API class that the user must create associated with a session to get known-broker updates. Removed the weak_ptr logic in client::SessionImpl which was only required because of FailoverListener. Made SessionImpl::close() idempotent. Gets rid of spurious warning messages in some tests. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@829931 13f79535-47bb-0310-9956-ffa450edef68
* Tidied up namespace usageAndrew Stitcher2009-09-091-6/+11
| | | | | | Miscelleneous whitespace fixes git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@813094 13f79535-47bb-0310-9956-ffa450edef68
* Remove incorrect directory from #includeAlan Conway2009-07-141-3/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@793912 13f79535-47bb-0310-9956-ffa450edef68
* Add directory to #includeAlan Conway2009-07-141-3/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@793909 13f79535-47bb-0310-9956-ffa450edef68
* Applied PIMPL pattern to SubscriptionManager.Alan Conway2009-05-041-0/+1
| | | | | | | Cleaned up some sloppy #includes. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@771366 13f79535-47bb-0310-9956-ffa450edef68
* Various fixes arising from testing client failover:Gordon Sim2008-11-031-5/+4
| | | | | | | | | | | | | | | | | | | | * introduced new exception type for signalling connection failure (as distinct from any logical connection errors) * ConnectionImpl::closeInternal(): take copy of session map to prevent concurrent modification (by the same thread) as sessions are deleted and erase themselves. * ConnectionImpl::shutdown: hold lock before calling closeInternal(); mark handler failed before informing sessions of failure * SessionImpl::connectionBroker(): remove code as its rather meaningless * Don't swallow exceptions in Dispatcher * Handle exceptions in FailoverListener * Take weak_ptr to ConnectionImpl on constructor of Connector, then convert to shared_ptr when 'receiver' thread is started. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@710106 13f79535-47bb-0310-9956-ffa450edef68
* Replicate session state for un-acknowledged messages to new cluster members.Alan Conway2008-10-301-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@709242 13f79535-47bb-0310-9956-ffa450edef68
* Add option to require that only encrypted connections be accepted.Gordon Sim2008-10-201-2/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@706321 13f79535-47bb-0310-9956-ffa450edef68
* SessionImpl using ExceptionHolder to generate correctly typed exceptions..Alan Conway2008-10-081-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@702681 13f79535-47bb-0310-9956-ffa450edef68
* Added ScopedSuppressLogging, used to suppress expected error messages in tests.Alan Conway2008-09-251-1/+9
| | | | | | | For examples see src/tests/exception_test.cpp git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@698981 13f79535-47bb-0310-9956-ffa450edef68
* Fixed error handling session-busy condition on broker.Alan Conway2008-09-221-0/+8
| | | | | | | Added accessors to iterate over broker::SemanticState consumers. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@697951 13f79535-47bb-0310-9956-ffa450edef68
* Fix test error.Alan Conway2008-06-121-3/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@667215 13f79535-47bb-0310-9956-ffa450edef68
* Changes to Session API:Alan Conway2008-05-261-1/+0
| | | | | | | | | | | - Session is synchronous, no futures. - AsyncSession is async, returns futures. - Conversion functions sync(s) async(s) return a sync/async view of session s. - Connection::newSession - takes name, no timeout - SessionBase::getId - returns SessionId not UUID. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@660258 13f79535-47bb-0310-9956-ffa450edef68
* Generate c++ code from final 0-10 specGordon Sim2008-04-241-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@651423 13f79535-47bb-0310-9956-ffa450edef68
* QPID-920: converted c++ client to use final 0-10 protocolGordon Sim2008-04-201-1/+2
| | | | | | | | | | * connection handler converted to using invoker & proxy and updated to final method defs * SessionCore & ExecutionHandler replace by SessionImpl * simplified handling of completion & results, removed handling of responses git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@649915 13f79535-47bb-0310-9956-ffa450edef68
* Patch for improved compatibility with gcc 3.4 and boost 1.33Andrew Stitcher2008-04-171-15/+18
| | | | git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@649294 13f79535-47bb-0310-9956-ffa450edef68
* Some refactoring of the 0-10 codepath (being migrated to final spec) that ↵Gordon Sim2008-02-251-1/+1
| | | | | | primarily colocates the current session and execution layers to facilitate implementing the new session layer that will now encompass this behaviour. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@630934 13f79535-47bb-0310-9956-ffa450edef68
* Improved/additional client API tests.Alan Conway2008-01-241-31/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replaced InProcessBroker with a more accurate loopback BrokerFixture. - Added asserts for mutex/condition/thread errors in debug build. - Added client tests for several exception conditions. - Added peer address to log ouput, client/server distinguished by (addr) or [addr] - Fixed various deadlocks & races exposed by the new asserts & tests. File-by-file: New BrokerFixture replaces InProcessBroker D src/tests/InProcessBroker.h M src/tests/BrokerFixture.h M src/tests/SocketProxy.h M src/tests/Makefile.am Made it run a bit faster. M src/tests/quick_perftest Redundant D src/tests/APRBaseTest.cpp Updated tests to use BrokerFixture M src/tests/ClientChannelTest.cpp M src/tests/exception_test.cpp M src/tests/ClientSessionTest.cpp Print thread IDs in decimal, same as GDB. M src/qpid/log/Logger.cpp Assert mutex/condition ops in debug build. M src/qpid/sys/posix/check.h M src/qpid/sys/posix/Mutex.h M src/qpid/sys/posix/Condition.h M src/qpid/sys/posix/Thread.h Added toFd() so SocketProxy can use ::select() M src/qpid/sys/Socket.h M src/qpid/sys/posix/Socket.cpp Fixes for races & deadlocks shown up by new tests & asserts. Mostly shutdown/close issues. M src/qpid/client/ConnectionHandler.h M src/qpid/client/ConnectionImpl.cpp M src/qpid/client/Demux.h M src/qpid/client/SessionCore.cpp M src/qpid/client/ConnectionHandler.cpp M src/qpid/client/Connector.h M src/qpid/client/Demux.cpp M src/qpid/client/Dispatcher.cpp M src/qpid/client/ConnectionImpl.h Logging peer address. M src/qpid/sys/AsynchIOAcceptor.cpp git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@615063 13f79535-47bb-0310-9956-ffa450edef68
* src/tests/ClientSessionTest.cpp: Disabled hanging test: testDisconnectResume. Alan Conway2007-12-111-26/+27
| | | | | | | | src/tests/SocketProxy.h: fixed exception handling. src/tests/exception_test.cpp: fixed compile error. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@603273 13f79535-47bb-0310-9956-ffa450edef68
* src/tests/SocketProxy.h: proxy between local client & server to simulate ↵Alan Conway2007-12-101-16/+19
| | | | | | | | | | | network disconnect. src/qpid/client/Connector.h: remove friend hack for previous flawed disconnect approach. src/tests/BrokerFixture.h: "" src/tests/ClientSessionTest.cpp, exception_test.cpp: use ProxyConnection git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@602980 13f79535-47bb-0310-9956-ffa450edef68
* Summary:Alan Conway2007-12-071-56/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replaced InProcessBroker with BrokerFixture, uses a full loopback broker for more realistic tests. - Extracted non-generated parts of Session_0_10 into SessionBase. - Sundry small fixes. src/tests/BrokerFixture.h - in process broker with loopback connections. - tests can force a disorderly disconnect. src/qpid/client/Connector.h - back door to private members for BrokerFixture. - close() in destructor to avoid leaks. src/qpid/client/ConnectionImpl.h,cpp: - close() in destructor, to fix hang when destroyed without being closed. src/qpid/client/CompletionTracker.h,.cpp: - Fixed race in close/add. src/qpid/client/SessionBase.h,cpp: - Extracted all non-generated code from Session_0_10 into SessionBase - Added sync() src/tests/exception_test.cpp: Converted to boost & BrokerFixture src/tests/ClientChannelTest.cpp, ClientSessionTest.cpp: Use BrokerFixture git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@602182 13f79535-47bb-0310-9956-ffa450edef68
* Fix problem where client does notice disconnection from Broker. Alan Conway2007-12-011-39/+77
| | | | | | | | | src/qpid/client/SessionCore.cpp: close/open Demux on suspend/resume. src/tests/exception_test.cpp: convert to Session API, boost test. - Temporarily disabled due issues noted in TODO comments git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@600046 13f79535-47bb-0310-9956-ffa450edef68
* Session resume support in client & broker: Client can resume a sessionAlan Conway2007-10-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | after voluntary suspend() or network failure. Frames lost in network failure are automatically re-transmitted for transparent re-connection. client::Session improvements: - Locking to avoid races between network & user threads. - Replaced client::StateManager with sys::StateMonitor - avoid heap allocation. qpid::Exception clean up: - use QPID_MSG consistently to format exception messages. - throw typed exceptions (in reply_exceptions.h) for AMQP exceptions. - re-throw correct typed exception on client for exceptions from broker. - Removed QpidError.h rubygen/templates/constants.rb: - constants.h: Added FOO_CLASS_ID and FOO_BAR_METHOD_ID constants. - reply_constants.h: Added throwReplyException(code, text) log::Logger: - Fixed shutdown race in Statement::~Initializer() git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@588761 13f79535-47bb-0310-9956-ffa450edef68
* Renamed the following files for consistency:Alan Conway2007-09-251-2/+2
| | | | | | | | | | | | | | | | | | broker/BrokerExchange.cpp -> Exchange.cpp broker/BrokerExchange.h -> Exchange.h broker/BrokerQueue.cpp -> Queue.cpp broker/BrokerQueue.h -> Queue.h client/ClientChannel.cpp -> Channel.cpp client/ClientChannel.h -> Channel.h client/ClientConnection.cpp -> Connection.cpp client/ClientExchange.cpp -> Exchange.cpp client/ClientExchange.h -> Exchange.h client/ClientMessage.h -> Message.h client/ClientQueue.cpp -> Queue.cpp client/ClientQueue.h -> Queue.h git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@579340 13f79535-47bb-0310-9956-ffa450edef68
* Fix for QPID-534. Get now detects closure correctly. Also fixed broker to ↵Gordon Sim2007-07-051-0/+67
allow channel.close-ok (and fixed client to send it). git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@553441 13f79535-47bb-0310-9956-ffa450edef68