ctx = (EntryPointContext) child.getContext("source");
Assert.assertNotNull(ctx);
handler = (InvocationHandler) ctx.getHandler();
response = handler.invoke(null, hello, new Object[]{"foo"});
HelloWorldService service1 = (HelloWorldService) child.getContext("target").getInstance(null);
Assert.assertEquals(2, service1.count());
child.publish(new RequestEnd(this, id));
// second request
Object id2 = new Object();
child.publish(new RequestStart(this, id2));
ctx = (EntryPointContext) child.getContext("source");
Assert.assertNotNull(ctx);
handler = (InvocationHandler) ctx.getHandler();
Assert.assertEquals(2, mockInterceptor.getCount());
response = handler.invoke(null, hello, new Object[]{"foo"});
Assert.assertEquals("Hello foo", response);
Assert.assertEquals(3, mockInterceptor.getCount());
HelloWorldService service2 = (HelloWorldService) child.getContext("target").getInstance(null);
Assert.assertEquals(1, service2.count());
child.publish(new RequestEnd(this, id2));
child.publish(new ModuleStop(this));
runtime.stop();
}