summaryrefslogtreecommitdiff
path: root/qpid/java/common/src/test
diff options
context:
space:
mode:
authorAndrew Donald Kennedy <grkvlt@apache.org>2010-08-13 16:19:28 +0000
committerAndrew Donald Kennedy <grkvlt@apache.org>2010-08-13 16:19:28 +0000
commite9e542aabce4d9a15e8556a9750df6e86bcecd16 (patch)
treefb54dda75b03552be0ab4d0ece55d8c59eb5c02b /qpid/java/common/src/test
parentc64383e629c89e47cc07185bb5d7cf82ece88e8d (diff)
downloadqpid-python-e9e542aabce4d9a15e8556a9750df6e86bcecd16.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@985262 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/common/src/test')
-rw-r--r--qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java18
1 files changed, 9 insertions, 9 deletions
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());
+ }
}
}