use of com.adaptris.core.BranchingServiceImp in project interlok by adaptris.
the class ExampleServiceCase method assertDefaults.
protected void assertDefaults(Service s, boolean assertBranching) throws Exception {
if (assertBranching) {
if (s instanceof BranchingServiceImp) {
assertTrue(s.getClass().getName(), s.isBranching());
} else {
assertFalse(s.getClass().getName(), s.isBranching());
}
}
assertFalse(s.getClass().getName(), s.isTrackingEndpoint());
assertFalse(s.getClass().getName(), s.continueOnFailure());
if (s instanceof ServiceImp) {
((ServiceImp) s).setIsTrackingEndpoint(true);
assertEquals(Boolean.TRUE, ((ServiceImp) s).getIsTrackingEndpoint());
((ServiceImp) s).setContinueOnFail(true);
assertEquals(Boolean.TRUE, ((ServiceImp) s).getContinueOnFail());
}
if (s instanceof ServiceCollectionImp) {
((ServiceCollectionImp) s).setContinueOnFail(true);
assertEquals(Boolean.TRUE, ((ServiceCollectionImp) s).getContinueOnFail());
((ServiceCollectionImp) s).setIsTrackingEndpoint(true);
assertEquals(Boolean.TRUE, ((ServiceCollectionImp) s).getIsTrackingEndpoint());
((ServiceCollectionImp) s).setRestartAffectedServiceOnException(Boolean.TRUE);
assertEquals(Boolean.TRUE, ((ServiceCollectionImp) s).getRestartAffectedServiceOnException());
OutOfStateHandler handler = new RaiseExceptionOutOfStateHandler();
((ServiceCollectionImp) s).setOutOfStateHandler(handler);
assertEquals(handler, ((ServiceCollectionImp) s).getOutOfStateHandler());
}
}
Aggregations