try {
SimpleChain c = new SimpleChain();
Handler h1 = new TestHandler();
c.addHandler(h1);
// A null engine is good enough for this test
MessageContext mc = new MessageContext(null);
c.invoke(mc);
// while testing, disable noise
boolean oldLogging = InternalException.getLogging();
InternalException.setLogging(false);
try {
Handler h2 = new TestHandler();
c.addHandler(h2);
assertTrue("Handler added after chain invoked", false);
} catch (Exception e) {
// Correct behaviour. Exact exception isn't critical
}
// resume noise
InternalException.setLogging(oldLogging);
} catch (AxisFault af) {
assertTrue("Unexpected exception", false);
}