mirror of https://github.com/apache/activemq.git
trap potential exception on abortive close
This commit is contained in:
parent
165959e250
commit
ac635ddf1d
|
@ -238,4 +238,11 @@ public abstract class TestSupport extends CombinationTestSupport {
|
|||
assertFalse("Base directory cannot contain spaces.", new File(System.getProperty("basedir", ".")).getAbsoluteFile().toString().contains(" "));
|
||||
}
|
||||
|
||||
public void safeCloseConnection(Connection c) {
|
||||
if (c != null) {
|
||||
try {
|
||||
c.close();
|
||||
} catch (JMSException ignored) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ public class RedeliveryRestartWithExceptionTest extends TestSupport {
|
|||
assertNotNull("Expecting an exception when updateMessage fails", expectedException);
|
||||
|
||||
consumer.close();
|
||||
connection.close();
|
||||
safeCloseConnection(connection);
|
||||
|
||||
restartBroker();
|
||||
|
||||
|
@ -187,7 +187,7 @@ public class RedeliveryRestartWithExceptionTest extends TestSupport {
|
|||
assertNotNull("Expecting an exception when updateMessage fails", expectedException);
|
||||
|
||||
consumer.close();
|
||||
connection.close();
|
||||
safeCloseConnection(connection);
|
||||
|
||||
connection = (ActiveMQConnection) connectionFactory.createConnection();
|
||||
connection.start();
|
||||
|
|
Loading…
Reference in New Issue