if (connection != null) {
connection.close();
}
if (connectionFactory instanceof ActiveMQConnectionFactory) {
ActiveMQConnectionFactory amqConnectionFactory = (ActiveMQConnectionFactory) connectionFactory;
amqConnectionFactory.stop();
}
super.tearDown();
}