From e9e542aabce4d9a15e8556a9750df6e86bcecd16 Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Fri, 13 Aug 2010 16:19:28 +0000 Subject: 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@985262 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/qpid/transport/ConnectionTest.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'qpid/java/common/src/test') diff --git a/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java b/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java index bdd3a0c93b..375a326654 100644 --- a/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java +++ b/qpid/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()); + } } } -- cgit v1.2.1