From edf2f72240e24f23ee9c528190584cfa9b21022d Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Mon, 26 Jul 2010 14:08:45 +0000 Subject: QPID-2760: Only client 0-10 session sync should throw any exceptions git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@979290 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/qpid/transport/ConnectionTest.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'qpid/java/common/src') 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 0ca4a0c659..891ca71b6c 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 @@ -425,6 +425,10 @@ public class ConnectionTest extends TestCase 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(); @@ -433,14 +437,11 @@ public class ConnectionTest extends TestCase implements SessionListener conn.connect("localhost", port, null, "guest", "guest"); Session ssn = conn.createSession(); send(ssn, "EXCP 0", true); - try - { - ssn.sync(); - } - catch (SessionException exc) - { - assertNotNull(exc.getException()); - } + 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); } } -- cgit v1.2.1