[jboss-cvs] JBossAS SVN: r64281 - in branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote: unit and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jul 25 14:39:45 EDT 2007


Author: bdecoste
Date: 2007-07-25 14:39:45 -0400 (Wed, 25 Jul 2007)
New Revision: 64281

Modified:
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulBean.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulRemote.java
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/unit/LocalTestCase.java
Log:
[EJBTHREE-1019] additional test for calling the right bean when calling Remote remotely (tests IsLocalInterceptor) is working properly

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulBean.java	2007-07-25 18:38:22 UTC (rev 64280)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulBean.java	2007-07-25 18:39:45 UTC (rev 64281)
@@ -35,11 +35,29 @@
 {
    private static final Logger log = Logger.getLogger(StatefulRemote.class);
    
+   private static int methodCount = 0;
+   
    public void localCall() throws Exception
    {
       InitialContext jndiContext = new InitialContext();
       StatelessLocal stateless = (StatelessLocal)jndiContext.lookup("StatelessBean/local");
-      log.info("*** Remote called " + jndiContext.getEnvironment());
+      log.info("*** remote Local called " + jndiContext.getEnvironment());
       stateless.method();
    }
+   
+   public int remoteCall() throws Exception
+   {
+      ++methodCount;
+      InitialContext jndiContext = new InitialContext();
+      StatefulRemote stateful = (StatefulRemote)jndiContext.lookup("StatefulBean/remote");
+      log.info("*** calling Remote " + jndiContext.getEnvironment());
+      return stateful.method();
+   }
+   
+   public int method() throws Exception
+   {
+      ++methodCount;
+      log.info("*** remote method called " + methodCount);
+      return methodCount;
+   }
 }

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulRemote.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulRemote.java	2007-07-25 18:38:22 UTC (rev 64280)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/StatefulRemote.java	2007-07-25 18:39:45 UTC (rev 64281)
@@ -27,4 +27,8 @@
 public interface StatefulRemote
 {
    void localCall() throws Exception;
+   
+   int remoteCall() throws Exception;
+   
+   int method() throws Exception;
 }

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/unit/LocalTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/unit/LocalTestCase.java	2007-07-25 18:38:22 UTC (rev 64280)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/localfromremote/unit/LocalTestCase.java	2007-07-25 18:39:45 UTC (rev 64281)
@@ -55,6 +55,15 @@
       {}
    }
    
+   public void testRemoteFromRemote() throws Exception
+   {
+      StatefulRemote bean = (StatefulRemote) getInitialContext().lookup("StatefulBean/remote");
+      assertNotNull(bean);
+      
+      int methodCount = bean.remoteCall();
+      assertEquals(1, methodCount);
+   }
+   
    public static Test suite() throws Exception
    {
       return getDeploySetup(LocalTestCase.class, ""); 




More information about the jboss-cvs-commits mailing list