}
public void testAddByPhase() throws Exception {
Operation op = newOperation("foo");
InvocationChain chain = new InvocationChainImpl(op, op, false);
Interceptor inter1 = new MockInterceptor();
Interceptor inter2 = new MockInterceptor();
Interceptor inter3 = new MockInterceptor();
Interceptor inter4 = new MockInterceptor();
chain.addInterceptor(inter3); // SERVICE
chain.addInterceptor(Phase.IMPLEMENTATION_POLICY, inter4);
chain.addInterceptor(Phase.SERVICE_POLICY, inter2);
chain.addInterceptor(Phase.SERVICE_BINDING, inter1);
Interceptor head = (Interceptor)chain.getHeadInvoker();
assertEquals(inter1, head);
assertEquals(inter2, inter1.getNext());
assertEquals(inter3, inter2.getNext());
assertEquals(inter4, inter3.getNext());
assertEquals(inter4, chain.getTailInvoker());