}
}
@Test
public void testFaultTolerance() throws Exception {
FaultTolerance tolerance = new FaultTolerance(true, false);
tolerance = new FaultTolerance(true, true, IOException.class.getName());
tolerance.handleException(new IOException(), new Record());
tolerance = new FaultTolerance(true, true, IOException.class.getName());
tolerance.handleException(new RuntimeException(), new Record());
tolerance = new FaultTolerance(true, true, IOException.class.getName());
tolerance.handleException(new RuntimeException(new IOException()), new Record());
tolerance = new FaultTolerance(true, false, IOException.class.getName());
try {
tolerance.handleException(new IOException(), new Record());
fail();
} catch (MorphlineRuntimeException e) {
; // expected
}
tolerance = new FaultTolerance(false, false, IOException.class.getName());
try {
tolerance.handleException(new IOException(), new Record());
fail();
} catch (MorphlineRuntimeException e) {
; // expected
}
tolerance = new FaultTolerance(false, false, IOException.class.getName());
try {
tolerance.handleException(new RuntimeException(), new Record());
fail();
} catch (MorphlineRuntimeException e) {
; // expected
}
tolerance = new FaultTolerance(true, true, Error.class.getName());
try {
tolerance.handleException(new Error(), new Record());
fail();
} catch (Error e) {
; // expected
}
}