assertTrue("T1.T2.T3".equals(result.toString()));
}
public void testErrorHandling() throws Exception {
TestMediator t1 = new TestMediator();
t1.setHandler(
new TestMediateHandler() {
public void handle(MessageContext synCtx) {
result.append("T1.");
}
});
TestMediator t2 = new TestMediator();
t2.setHandler(
new TestMediateHandler() {
public void handle(MessageContext synCtx) {
result.append("T2.");
throw new SynapseException("test");
}
});
TestMediator t3 = new TestMediator();
t3.setHandler(
new TestMediateHandler() {
public void handle(MessageContext synCtx) {
result.append("T3.");
}
});
TestMediator t4 = new TestMediator();
t4.setHandler(
new TestMediateHandler() {
public void handle(MessageContext synCtx) {
result.append("T4");
assertEquals("test", synCtx.getProperty(Constants.ERROR_MESSAGE));
}