diff options
author | Andrew Donald Kennedy <grkvlt@apache.org> | 2010-08-13 16:19:28 +0000 |
---|---|---|
committer | Andrew Donald Kennedy <grkvlt@apache.org> | 2010-08-13 16:19:28 +0000 |
commit | c700093f4294bb1bcda42f3fc1982dcc57dc44da (patch) | |
tree | 5fc93a03fed2274513e7da3123258d12f58ffbcd /java/common/src/test | |
parent | cf96b23f687c379bd71f465c837379b0966c2184 (diff) | |
download | qpid-python-c700093f4294bb1bcda42f3fc1982dcc57dc44da.tar.gz |
QPID-2657: Correct handling of sync on 0-10 client session for exceptions
AMQSession_0_10 is modified to contain a pair of get/set methods for the current
exception, using the set method to post the exception to the listener. The sync
method will now throw an exception if one has occurred and all other methods
that used to call sync()/getCurrentException() can just call sync(0 and get the
expected behaviour.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@985262 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common/src/test')
-rw-r--r-- | java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java b/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java index bdd3a0c93b..375a326654 100644 --- a/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java +++ b/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java @@ -424,10 +424,6 @@ public class ConnectionTest extends QpidTestCase implements SessionListener } } - /** - * The 0-10 {@code executionSync} command should set the exception status in the session, - * so that the client session object can then throw it as an {@link AMQException}. - */ public void testExecutionExceptionSync() throws Exception { startServer(); @@ -436,11 +432,15 @@ public class ConnectionTest extends QpidTestCase implements SessionListener conn.connect("localhost", port, null, "guest", "guest"); Session ssn = conn.createSession(); send(ssn, "EXCP 0", true); - ExecutionException before = ssn.getException(); - assertNull("There should not be an exception stored in the session", before); - ssn.sync(); - ExecutionException after = ssn.getException(); - assertNotNull("There should be an exception stored in the session", after); + try + { + ssn.sync(); + fail("this should have failed"); + } + catch (SessionException exc) + { + assertNotNull(exc.getException()); + } } } |