{
// Initialize
String jndiName = ExplicitInvokerNameRemoteBusiness.JNDI_NAME_EXPLICIT_INVOKER_NAME;
// Get the bean
ExplicitInvokerNameRemoteBusiness bean = (ExplicitInvokerNameRemoteBusiness) context.lookup(jndiName);
/*
* Break into Proxy internals to assure we've got the right clientBindUrl
* associated w/ the invoker name
*/
// Get the expected bind URL
String invokerName = ExplicitInvokerNameRemoteBusiness.MC_NAME_INVOKER;
String expectedClientBindUrl = ProxyRemotingUtils.getClientBinding(invokerName);
// Get the clientBindUrl from the Proxy itself
Class<?> proxyClass = bean.getClass();
assert Proxy.isProxyClass(proxyClass) : "Stub from JNDI was not a " + Proxy.class.getName();
SessionRemoteProxyInvocationHandler handler = (SessionRemoteProxyInvocationHandler) Proxy
.getInvocationHandler(bean);
String clientBindUrl = handler.getUrl();
// Ensure the expected value is what we've got in the proxy
TestCase.assertEquals("clientBindUrls are not equal", expectedClientBindUrl, clientBindUrl);
// Invoke
String returnValue = bean.invoke();
// Test return value
TestCase.assertEquals("Didn't get expected return value", ExplicitInvokerNameRemoteBusiness.RETURN_VALUE,
returnValue);
}