Commit 57108a9f authored by Andy Wilkinson's avatar Andy Wilkinson

Try to make the tests for the Cassandra sample more robust

Cassandra sometimes takes a long time when dropping the test keyspace.
This results in the test failing due to an exception being thrown.
This commit attempts to make the tests more robust by catching and
logging any exceptions thrown during server cleanup.
parent 980fb16d
......@@ -17,15 +17,30 @@
package sample.data.cassandra;
import org.cassandraunit.spring.CassandraUnitDependencyInjectionTestExecutionListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.Ordered;
public class OrderedCassandraTestExecutionListener
extends CassandraUnitDependencyInjectionTestExecutionListener {
private static final Logger logger = LoggerFactory
.getLogger(OrderedCassandraTestExecutionListener.class);
@Override
public int getOrder() {
return Ordered.HIGHEST_PRECEDENCE;
}
@Override
protected void cleanServer() {
try {
super.cleanServer();
}
catch (Exception ex) {
logger.warn("Failure during server cleanup", ex);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment