Examples of ExplicitInvokerNameRemoteBusiness


Examples of org.jboss.ejb3.test.proxy.impl.ejbthree1529.ExplicitInvokerNameRemoteBusiness

   {
      // 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);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.