Endpoint endpoint = (Endpoint) context.getTarget();
EndpointInvocationHandler handler = new EndpointInvocationHandler(endpoint, null, Greeter.class);
ClassLoader loader = Thread.currentThread().getContextClassLoader();
Class<?> interfaces[] = { Greeter.class };
Greeter bean = (Greeter) Proxy.newProxyInstance(loader, interfaces, handler);
String result = bean.sayHi("Thingy");
assertEquals("Hi Thingy from MyStatelessBean", result);
}
@Test
public void testStateful() throws Throwable