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.
This commit is contained in:
parent
980fb16d9d
commit
57108a9faa
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue