openejb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r453092 - in /incubator/openejb/trunk/openejb3/container/openejb-core/src: main/java/org/apache/openejb/core/CoreDeploymentInfo.java test/java/org/apache/openejb/core/stateless/StatelessContainerTest.java
Date Thu, 05 Oct 2006 02:53:45 GMT
Author: dblevins
Date: Wed Oct  4 19:53:45 2006
New Revision: 453092

URL: http://svn.apache.org/viewvc?view=rev&rev=453092
Log:
Basic Stateless/Business Remote functionality works.  Part of OPENEJB-92

Modified:
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreDeploymentInfo.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/StatelessContainerTest.java

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreDeploymentInfo.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreDeploymentInfo.java?view=diff&rev=453092&r1=453091&r2=453092
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreDeploymentInfo.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/CoreDeploymentInfo.java
Wed Oct  4 19:53:45 2006
@@ -567,7 +567,7 @@
     }
 
     private void createMethodMap() throws org.apache.openejb.SystemException {
-        if (homeInterface != null) {
+        if (remoteInterface != null) {
             mapObjectInterface(remoteInterface, false);
             mapHomeInterface(homeInterface);
         }

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/StatelessContainerTest.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/StatelessContainerTest.java?view=diff&rev=453092&r1=453091&r2=453092
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/StatelessContainerTest.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/core/stateless/StatelessContainerTest.java
Wed Oct  4 19:53:45 2006
@@ -84,9 +84,33 @@
         assertEquals(join("\n", expected) , join("\n", lifecycle));
     }
 
+    public void testBusinessRemoteInterface() throws Exception {
+
+        CoreDeploymentInfo coreDeploymentInfo = (CoreDeploymentInfo) deploymentInfo;
+        DeploymentInfo.BusinessRemoteHome businessRemoteHome = coreDeploymentInfo.getBusinessRemoteHome();
+        assertNotNull("businessRemoteHome", businessRemoteHome);
+
+        Object object = businessRemoteHome.create();
+        assertNotNull("businessRemoteHome.create()", businessRemoteHome);
+
+        assertTrue("instanceof widget", object instanceof RemoteWidget);
+
+        RemoteWidget widget = (RemoteWidget) object;
+
+        // Do a business method...
+        Stack<Lifecycle> lifecycle = widget.getLifecycle();
+        assertNotNull("lifecycle",lifecycle);
+
+        // Check the lifecycle of the bean
+        List expected = Arrays.asList(Lifecycle.values());
+
+        assertEquals(join("\n", expected) , join("\n", lifecycle));
+    }
+
     protected void setUp() throws Exception {
         StatelessBean bean = new StatelessBean("widget", WidgetBean.class.getName());
         bean.setBusinessLocal(Widget.class.getName());
+        bean.setBusinessRemote(RemoteWidget.class.getName());
         bean.addPostConstruct("init");
         bean.addPreDestroy("destroy");
 
@@ -132,11 +156,15 @@
         Stack<Lifecycle> getLifecycle();
     }
 
+    public static interface RemoteWidget extends Widget {
+
+    }
+
     public static enum Lifecycle {
         CONSTRUCTOR, INJECTION, POST_CONSTRUCT, BUSINESS_METHOD, PRE_DESTROY
     }
 
-    public static class WidgetBean implements Widget {
+    public static class WidgetBean implements Widget, RemoteWidget {
 
         private Stack<Lifecycle> lifecycle = new Stack();
 



Mime
View raw message