summaryrefslogtreecommitdiff
path: root/java/common/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/common/src')
-rw-r--r--java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java17
1 files changed, 9 insertions, 8 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 0ca4a0c659..891ca71b6c 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
@@ -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);
}
}