new InvocationHandler() {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
assertEquals("getEndpoint", method.getName());
assertEquals(new QName("urn", "svc"), args[0]);
assertEquals("ep", args[1]);
return new ServiceEndpointImpl((QName) args[0], (String) args[1]);
}
});
me = new InOnlyImpl(new ExchangeImpl(Pattern.InOnly));
URIResolver.configureExchange(me, ctx, "endpoint:urn:svc:ep");
assertNull(me.getInterfaceName());
assertNull(me.getOperation());
assertNull(me.getService());
assertNotNull(me.getEndpoint());
ctx = (ComponentContext) Proxy.newProxyInstance(ComponentContext.class.getClassLoader(),
new Class[] { ComponentContext.class },
new InvocationHandler() {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
assertEquals("resolveEndpointReference", method.getName());
assertTrue(args[0] instanceof DocumentFragment);
return new ServiceEndpointImpl(new QName("svc"), "ep");
}
});
me = new InOnlyImpl(new ExchangeImpl(Pattern.InOnly));
URIResolver.configureExchange(me, ctx, "http://urn/");
assertNull(me.getInterfaceName());