summaryrefslogtreecommitdiff
path: root/java/systests/src
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2009-04-14 14:28:17 +0000
committerMartin Ritchie <ritchiem@apache.org>2009-04-14 14:28:17 +0000
commitef2604098acff8ceb85817669e8608d4212dd5d5 (patch)
tree75c049076c1606523351d363e647ede8e6a2b338 /java/systests/src
parentdf6517b6513aa8278e5feb1b1759da39f50dfc55 (diff)
downloadqpid-python-ef2604098acff8ceb85817669e8608d4212dd5d5.tar.gz
QPID-1779 : Update to ensure CACFTest reports failures correctly and resolved the issue that it was not showing.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@764790 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests/src')
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/CloseAfterConnectionFailureTest.java33
1 files changed, 22 insertions, 11 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/CloseAfterConnectionFailureTest.java b/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/CloseAfterConnectionFailureTest.java
index 1cb24919f0..bb9c22f31a 100644
--- a/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/CloseAfterConnectionFailureTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/CloseAfterConnectionFailureTest.java
@@ -42,6 +42,7 @@ public class CloseAfterConnectionFailureTest extends QpidTestCase implements Exc
Session session;
MessageConsumer consumer;
private CountDownLatch _latch = new CountDownLatch(1);
+ private JMSException _fail;
public void testNoFailover() throws URLSyntaxException, AMQVMBrokerCreationException,
InterruptedException, JMSException
@@ -63,6 +64,12 @@ public class CloseAfterConnectionFailureTest extends QpidTestCase implements Exc
//Kill connection
TransportConnection.killAllVMBrokers();
_latch.await();
+
+ if (_fail != null)
+ {
+ _fail.printStackTrace(System.out);
+ fail("Exception thrown:" + _fail.getMessage());
+ }
}
catch (AMQException e)
{
@@ -72,39 +79,43 @@ public class CloseAfterConnectionFailureTest extends QpidTestCase implements Exc
public void onException(JMSException e)
{
- System.err.println("Connection isClosed after connection Falure?:" + connection.isClosed());
+ System.out.println("Connection isClosed after connection Falure?:" + connection.isClosed());
try
{
consumer.close();
}
- catch (JMSException jsme)
+ catch (JMSException jmse)
{
- System.err.println("Consumer close failed with:" + jsme.getMessage());
+ System.out.println("Consumer close failed with:" + jmse.getMessage());
+ _fail = jmse;
}
- System.err.println("Connection isClosed after connection Falure?:" + connection.isClosed());
+ System.out.println("Connection isClosed after connection Falure?:" + connection.isClosed());
try
{
//Note that if we actually do session.close() we will lock up as the session will never receive a frame
// from the
- ((AMQSession)session).close(10);
+ ((AMQSession) session).close(10);
}
- catch (JMSException jsme)
+ catch (JMSException jmse)
{
- System.err.println("Session close failed with:" + jsme.getMessage());
+ System.out.println("Session close failed with:" + jmse.getMessage());
+ _fail = jmse;
}
- System.err.println("Connection isClosed after connection Falure?:" + connection.isClosed());
+ System.out.println("Connection isClosed after connection Falure?:" + connection.isClosed());
try
{
connection.close();
}
- catch (JMSException jsme)
+ catch (JMSException jmse)
{
- System.err.println("Session close failed with:" + jsme.getMessage());
+ System.out.println("Session close failed with:" + jmse.getMessage());
+ _fail = jmse;
}
- System.err.println("Connection isClosed after connection Falure?:" + connection.isClosed());
+ System.out.println("Connection isClosed after connection Falure?:" + connection.isClosed());
_latch.countDown();
+
}
}