use of org.apache.cxf.clustering.FailoverFailedException in project cxf by apache.
the class CircuitBreakerFailoverTest method testSequentialStrategyUnavailableAlternatives.
@Test(expected = FailoverFailedException.class)
public void testSequentialStrategyUnavailableAlternatives() throws Exception {
FailoverFeature feature = getFeature(false, "http://localhost:" + NON_PORT + "/non-existent", "http://localhost:" + NON_PORT + "/non-existent2");
final BookStore bookStore = getBookStore("http://localhost:" + NON_PORT + "/non-existent", feature);
// Second iteration should not call any URL as all targets are not available.
for (int i = 0; i < 2; ++i) {
try {
bookStore.getBook(1);
fail("Exception expected");
} catch (ProcessingException ex) {
if (ex.getCause() instanceof FailoverFailedException) {
throw (FailoverFailedException) ex.getCause();
}
}
}
}
Aggregations