[jboss-cvs] JBossAS SVN: r65822 - in trunk/ejb3/src: main/org/jboss/ejb3/stateful and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Oct 3 22:02:24 EDT 2007


Author: ALRubinger
Date: 2007-10-03 22:02:24 -0400 (Wed, 03 Oct 2007)
New Revision: 65822

Added:
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/AbstractRemoveBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Delegate.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/DelegateBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Remove.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulLocal.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulRemote.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessLocal.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessRemote.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatefulRemoveBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatelessRemoveBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java
Removed:
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/GhostRemover.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/GhostRemoverBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/GhostRemoverTesterUnitTestCase.java
Modified:
   trunk/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java
   trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java
   trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java
   trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java
   trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java
Log:
EJBTHREE-786: Fixes and Unit Tests to ensure Proxy only implements EJBObject/EJBLocalObject if explicitly extended by bean provider's business interface.  "remove" method (and others from EJBObject/EJBLocalObject) now permitted and passing unit tests, though if stub is casted to EJBObject/EJBLocalObject and one of its method is invoked, Exception thrown.  Awaiting further development to handle invocation of EJBObject/EJBLocalObject methods and ensure they're handled properly by Stateful/Stateless Container.

Modified: trunk/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java	2007-10-04 00:24:51 UTC (rev 65821)
+++ trunk/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -28,6 +28,8 @@
 import java.util.Iterator;
 import java.util.List;
 
+import javax.ejb.EJBLocalObject;
+import javax.ejb.EJBObject;
 import javax.ejb.Local;
 import javax.ejb.LocalHome;
 import javax.ejb.Remote;
@@ -218,7 +220,56 @@
          return getBusinessInterfaces(beanClass.getSuperclass(), interfaces);
       }
    }
+   
+   /**
+    * Returns whether or not the specified business interface is a 
+    * direct or indirect subclass of EJBObject
+    * 
+    * @param businessInterface
+    * @return
+    */
+   public static boolean isSubclassOfEjbObject(Class<?> businessInterface)
+   {
+      return ProxyFactoryHelper.isSubclassOfEjbObject(businessInterface,false);
+   }
+   
+   /**
+    * Returns whether or not the specified business interface is a 
+    * direct or indirect subclass of EJBLocalObject
+    * 
+    * @param businessInterface
+    * @return
+    */
+   public static boolean isSubclassOfEjbLocalObject(Class<?> businessInterface)
+   {
+      return ProxyFactoryHelper.isSubclassOfEjbObject(businessInterface,true);
+   }
+   
+   private static boolean isSubclassOfEjbObject(Class<?> businessInterface, boolean local)
+   {
+      // Define EJBObject or EJBLocalObject
+      Class<?> testClass = local ? EJBLocalObject.class : EJBObject.class;
 
+      // Test interface
+      if (businessInterface.equals(testClass))
+      {
+         return true;
+      }
+
+      // Loop through all super interfaces
+      for (Class<?> superInterface : businessInterface.getInterfaces())
+      {
+         // Test all super interfaces
+         if (ProxyFactoryHelper.isSubclassOfEjbObject(superInterface, local))
+         {
+            return true;
+         }
+      }
+
+      // Not found
+      return false;
+   }
+
    public static Class getLocalHomeInterface(Container container)
    {
       Class beanClass = container.getBeanClass();

Modified: trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java	2007-10-04 00:24:51 UTC (rev 65821)
+++ trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -21,6 +21,12 @@
  */
 package org.jboss.ejb3.stateful;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.ejb.EJBLocalObject;
+import javax.ejb.EJBObject;
 import javax.ejb.LocalHome;
 import javax.naming.NamingException;
 
@@ -45,33 +51,59 @@
       super(container, binding.jndiBinding());
    }
 
-   protected Class[] getInterfaces()
-   {
-      Class[] interfaces;
-      
+   protected Class<?>[] getInterfaces()
+   {      
       StatefulContainer statefulContainer = (StatefulContainer) container;
       LocalHome localHome = (LocalHome) statefulContainer.resolveAnnotation(LocalHome.class);
-      
+
       boolean bindTogether = false;
-      
+
       if (localHome != null && bindHomeAndBusinessTogether(statefulContainer))
          bindTogether = true;
+
+      // Obtain all local interfaces      
+      List<Class<?>> localInterfaces = new ArrayList<Class<?>>();
+      localInterfaces.addAll(Arrays.asList(ProxyFactoryHelper.getLocalInterfaces(container)));
       
-      Class[] localInterfaces = ProxyFactoryHelper.getLocalInterfaces(container);
-      if (bindTogether)
-         interfaces = new Class[localInterfaces.length + 3];
-      else
-         interfaces = new Class[localInterfaces.length + 2];
+      // Loop through all interfaces, checking for EJBLocalObject
+      boolean addEJBLocalObject = false;
+      for (Class<?> clazz : localInterfaces)
+      {
+         // If a subclass of EJBObject, set flag to add
+         if (ProxyFactoryHelper.isSubclassOfEjbLocalObject(clazz))
+         {
+            addEJBLocalObject = true;
+         }
+      }
+      if (addEJBLocalObject)
+      {
+         // Add EJBLocalObject
+         localInterfaces.add(EJBLocalObject.class);
+      }
+
+      // Add JBossProxy
+      localInterfaces.add(JBossProxy.class);
       
-      System.arraycopy(localInterfaces, 0, interfaces, 0, localInterfaces.length);
-      interfaces[localInterfaces.length] = JBossProxy.class;
-      interfaces[localInterfaces.length + 1] = javax.ejb.EJBLocalObject.class;
-      
+      // Loop through all interfaces
+      for (Class<?> clazz : localInterfaces)
+      {
+         // If a subclass of EJBLocalObject, add
+         if (ProxyFactoryHelper.isSubclassOfEjbLocalObject(clazz))
+         {
+            localInterfaces.add(EJBLocalObject.class);
+         }
+      }
+
+      // If binding along w/ home, add home
       if (bindTogether)
-         interfaces[localInterfaces.length + 2] = localHome.value();
-      
-      return interfaces;
+      {
+         localInterfaces.add(localHome.value());
+      }
 
+      // Return
+      return localInterfaces.toArray(new Class<?>[]
+      {});
+
    }
    
    protected boolean bindHomeAndBusinessTogether(StatefulContainer container)

Modified: trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java	2007-10-04 00:24:51 UTC (rev 65821)
+++ trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -22,7 +22,12 @@
 package org.jboss.ejb3.stateful;
 
 import java.lang.reflect.Proxy;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
+import javax.ejb.EJBLocalObject;
+import javax.ejb.EJBObject;
 import javax.ejb.RemoteHome;
 import javax.naming.NamingException;
 
@@ -68,31 +73,49 @@
       this.binding = binding;
    }
 
-   protected Class[] getInterfaces()
-   {
-      Class[] interfaces;
-      
+   protected Class<?>[] getInterfaces()
+   {     
       StatefulContainer statefulContainer = (StatefulContainer) container;
       RemoteHome remoteHome = (RemoteHome) statefulContainer.resolveAnnotation(RemoteHome.class);
-      
+
       boolean bindTogether = false;
-      
+
       if (remoteHome != null && bindHomeAndBusinessTogether(statefulContainer))
          bindTogether = true;
+
+      // Obtain all remote interfaces
+      List<Class<?>> remoteInterfaces = new ArrayList<Class<?>>();
+      remoteInterfaces.addAll(Arrays.asList(ProxyFactoryHelper.getRemoteInterfaces(container)));     
       
-      Class[] remoteInterfaces = ProxyFactoryHelper.getRemoteInterfaces(container);
+      // Loop through all interfaces, checking for EJBObject
+      boolean addEJBObject = false;
+      for (Class<?> clazz : remoteInterfaces)
+      {
+         // If a subclass of EJBObject, set flag to add
+         if (ProxyFactoryHelper.isSubclassOfEjbObject(clazz))
+         {
+            addEJBObject = true;
+         }
+      }
+      if (addEJBObject)
+      {
+         // Add EJBObject
+         remoteInterfaces.add(EJBObject.class);
+
+      }
+
+      // Add JBossProxy
+      remoteInterfaces.add(JBossProxy.class);
+      
+      // If binding along w/ home, add home
       if (bindTogether)
-         interfaces = new Class[remoteInterfaces.length + 3];
-      else
-         interfaces = new Class[remoteInterfaces.length + 2];
+      {
+         remoteInterfaces.add(remoteHome.value());
+      }
 
-      System.arraycopy(remoteInterfaces, 0, interfaces, 0, remoteInterfaces.length);
-      interfaces[remoteInterfaces.length] = JBossProxy.class;
-      interfaces[remoteInterfaces.length + 1] = javax.ejb.EJBObject.class;
-      if (bindTogether)
-         interfaces[remoteInterfaces.length + 2] = remoteHome.value();
-         
-      return interfaces;
+      // Return
+      return remoteInterfaces.toArray(new Class<?>[]
+      {});
    }
    
    protected boolean bindHomeAndBusinessTogether(StatefulContainer container)

Modified: trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java	2007-10-04 00:24:51 UTC (rev 65821)
+++ trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -21,6 +21,12 @@
  */
 package org.jboss.ejb3.stateless;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.ejb.EJBLocalObject;
+import javax.ejb.EJBObject;
 import javax.ejb.LocalHome;
 
 import org.jboss.annotation.ejb.LocalBinding;
@@ -47,10 +53,8 @@
       super(container, binding.jndiBinding());
    }
 
-   protected Class[] getInterfaces()
+   protected Class<?>[] getInterfaces()
    {
-      Class[] interfaces;
-
       EJBContainer statelessContainer = (EJBContainer)container;
       LocalHome localHome = (LocalHome)statelessContainer.resolveAnnotation(LocalHome.class);
 
@@ -59,28 +63,47 @@
       if (localHome != null && bindHomeAndBusinessTogether(statelessContainer))
          bindTogether = true;
 
-      Class[] localInterfaces = ProxyFactoryHelper.getLocalInterfaces(container);
+      // Obtain all local interfaces
+      List<Class<?>> localInterfaces = new ArrayList<Class<?>>();
+      localInterfaces.addAll(Arrays.asList(ProxyFactoryHelper.getLocalInterfaces(container)));
 
-      if (localInterfaces != null)
+      // Ensure remote interfaces defined
+      if (localInterfaces.size() > 0)
       {
-         if (bindTogether)
-            interfaces = new Class[localInterfaces.length + 3];
-         else 
-            interfaces = new Class[localInterfaces.length + 2];
+         // Loop through all interfaces, checking for EJBLocalObject
+         boolean addEJBLocalObject = false;
+         for (Class<?> clazz : localInterfaces)
+         {
+            // If a subclass of EJBObject, set flag to add
+            if (ProxyFactoryHelper.isSubclassOfEjbLocalObject(clazz))
+            {
+               addEJBLocalObject = true;
+            }
+         }
+         if (addEJBLocalObject)
+         {
+            // Add EJBLocalObject
+            localInterfaces.add(EJBLocalObject.class);
+         }
 
-         System.arraycopy(localInterfaces, 0, interfaces, 0, localInterfaces.length);
-         interfaces[localInterfaces.length] = JBossProxy.class;
-         interfaces[localInterfaces.length + 1] = javax.ejb.EJBLocalObject.class;
+         // Add JBossProxy
+         localInterfaces.add(JBossProxy.class);
+
+         // If binding along w/ home, add home
          if (bindTogether)
-            interfaces[localInterfaces.length + 2] = localHome.value();
+         {
+            localInterfaces.add(localHome.value());
+         }
       }
       else
       {
+         // No remote interfaces defined, log warning
          log.warn("[EJBTHREE-933] NPE when deploying web service beans");
-         interfaces = new Class[] {};
       }
 
-      return interfaces;
+      // Return
+      return localInterfaces.toArray(new Class<?>[]
+      {});
    }
    
    protected boolean bindHomeAndBusinessTogether(EJBContainer container)

Modified: trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java	2007-10-04 00:24:51 UTC (rev 65821)
+++ trunk/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -21,8 +21,15 @@
  */
 package org.jboss.ejb3.stateless;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.ejb.EJBLocalObject;
+import javax.ejb.EJBObject;
 import javax.ejb.RemoteHome;
 import javax.naming.NamingException;
+
 import org.jboss.annotation.ejb.RemoteBinding;
 import org.jboss.aop.Advisor;
 import org.jboss.aop.AspectManager;
@@ -33,8 +40,8 @@
 import org.jboss.ejb3.remoting.RemoteProxyFactory;
 import org.jboss.ejb3.session.SessionContainer;
 import org.jboss.logging.Logger;
+import org.jboss.naming.Util;
 import org.jboss.remoting.InvokerLocator;
-import org.jboss.naming.Util;
 
 
 /**
@@ -57,43 +64,57 @@
       this.binding = binding;
    }
 
-   protected Class[] getInterfaces()
+   protected Class<?>[] getInterfaces()
    {
-      Class[] interfaces = null;
-      
       StatelessContainer statelessContainer = (StatelessContainer) container;
       RemoteHome remoteHome = (RemoteHome) statelessContainer.resolveAnnotation(RemoteHome.class);
-      
+
       boolean bindTogether = false;
-      
+
       if (remoteHome != null && bindHomeAndBusinessTogether(statelessContainer))
          bindTogether = true;
-      
-      Class[] remoteInterfaces = ProxyFactoryHelper.getRemoteInterfaces(container);
 
-      if(remoteInterfaces.length > 0)
+      // Obtain all remote interfaces
+      List<Class<?>> remoteInterfaces = new ArrayList<Class<?>>();
+      remoteInterfaces.addAll(Arrays.asList(ProxyFactoryHelper.getRemoteInterfaces(container)));
+
+      // Ensure remote interfaces defined
+      if (remoteInterfaces.size() > 0)
       {
-         if (bindTogether)
-            interfaces = new Class[remoteInterfaces.length + 3];
-         else
-            interfaces = new Class[remoteInterfaces.length + 2];
+         // Loop through all interfaces, checking for EJBObject
+         boolean addEJBObject = false;
+         for (Class<?> clazz : remoteInterfaces)
+         {
+            // If a subclass of EJBObject, set flag to add
+            if (ProxyFactoryHelper.isSubclassOfEjbObject(clazz))
+            {
+               addEJBObject = true;
+            }
+         }
+         if (addEJBObject)
+         {
+            // Add EJBObject
+            remoteInterfaces.add(EJBObject.class);
+         }
 
-         System.arraycopy(remoteInterfaces, 0, interfaces, 0,
-               remoteInterfaces.length);
-         interfaces[remoteInterfaces.length] = JBossProxy.class;
-         interfaces[remoteInterfaces.length + 1] = javax.ejb.EJBObject.class;
+         // Add JBossProxy
+         remoteInterfaces.add(JBossProxy.class);
 
+         // If binding along w/ home, add home
          if (bindTogether)
-            interfaces[remoteInterfaces.length + 2] = remoteHome.value();
+         {
+            remoteInterfaces.add(remoteHome.value());
+         }
       }
       else
       {
+         // No remote interfaces defined, log warning
          log.warn("[EJBTHREE-933] NPE when deploying web service beans");
-         interfaces = new Class[] {};
       }
-      
-      return interfaces;
 
+      // Return
+      return remoteInterfaces.toArray(new Class<?>[]
+      {});
    }
    
    protected boolean bindHomeAndBusinessTogether(EJBContainer container)

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/AbstractRemoveBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/AbstractRemoveBean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/AbstractRemoveBean.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -0,0 +1,26 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ * 
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ejb3.test.ejbthree786;
+
+/**
+ * 
+ * AbstractRemoveBean.
+ * 
+ * @author <a href="arubinge at redhat.com">ALR</a>
+ * @version $Revision:  $
+ */
+public class AbstractRemoveBean implements Remove
+{
+   // Class Members
+   public static final String RETURN_STRING = "Remove";
+
+   // Required Implementations
+   public String remove()
+   {
+      return AbstractRemoveBean.RETURN_STRING;
+   }
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/AbstractRemoveBean.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Delegate.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Delegate.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Delegate.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -0,0 +1,23 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ * 
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ejb3.test.ejbthree786;
+
+import javax.ejb.Remote;
+
+/**
+ * A Delegate to invoke upon local views of the Remove EJBs
+ * 
+ * @author <a href="arubinge at redhat.com">ALR</a>
+ * @version $Revision:  $
+ */
+ at Remote
+public interface Delegate
+{
+   String invokeStatelessRemove();
+
+   String invokeStatefulRemove();
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Delegate.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/DelegateBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/DelegateBean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/DelegateBean.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ * 
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ejb3.test.ejbthree786;
+
+import javax.ejb.EJB;
+import javax.ejb.Stateless;
+
+import org.jboss.annotation.ejb.RemoteBinding;
+
+ at Stateless
+ at RemoteBinding(jndiBinding = DelegateBean.JNDI_NAME_REMOTE)
+public class DelegateBean implements Delegate
+{
+   // Class Members
+   public static final String JNDI_NAME_REMOTE = "DelegateBean/remote";
+
+   // Instance Members
+
+   @EJB
+   private RemoveStatefulLocal stateful;
+
+   @EJB
+   private RemoveStatelessLocal stateless;
+
+   // Required Implementations
+
+   public String invokeStatefulRemove()
+   {
+      return stateful.remove();
+   }
+
+   public String invokeStatelessRemove()
+   {
+      return stateless.remove();
+   }
+
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/DelegateBean.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -0,0 +1,22 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ * 
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ejb3.test.ejbthree786;
+
+import javax.ejb.EJBObject;
+import javax.ejb.Remote;
+
+/**
+ * An Ejb21View.
+ * 
+ * @author <a href="arubinge at redhat.com">ALR</a>
+ * @version $Revision:  $
+ */
+ at Remote
+public interface Ejb21View extends EJBObject
+{
+   String test();
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ * 
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ejb3.test.ejbthree786;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateful;
+
+import org.jboss.annotation.ejb.RemoteBinding;
+
+ at Stateful
+ at Remote(Ejb21View.class)
+ at RemoteBinding(jndiBinding = Ejb21ViewBean.JNDI_NAME_REMOTE)
+public class Ejb21ViewBean
+{
+
+   // Class Members
+
+   public static final String JNDI_NAME_REMOTE = "Ejb21ViewBean/remote";
+
+   public static final String TEST_STRING = "Test";
+
+   // Required Implementations
+
+   public String test()
+   {
+      return Ejb21ViewBean.TEST_STRING;
+   }
+
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Deleted: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/GhostRemover.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/GhostRemover.java	2007-10-04 00:24:51 UTC (rev 65821)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/GhostRemover.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.ejbthree786;
-
-/**
- * We want a remove method which returns a String.
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
-public interface GhostRemover
-{
-   String remove();
-}

Deleted: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/GhostRemoverBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/GhostRemoverBean.java	2007-10-04 00:24:51 UTC (rev 65821)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/GhostRemoverBean.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.ejbthree786;
-
-import javax.ejb.Stateless;
-
-/**
- * A remove that is not a remove.
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
- at Stateless
-public class GhostRemoverBean implements GhostRemover
-{
-   public String remove()
-   {
-      return "Ghost";
-   }
-}

Copied: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Remove.java (from rev 65797, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/GhostRemover.java)
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Remove.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Remove.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree786;
+
+/**
+ * Defines a method named "remove" of return type "String"
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @author <a href="mailto:arubinge at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface Remove
+{
+   String remove();
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Remove.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulLocal.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulLocal.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulLocal.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree786;
+
+import javax.ejb.Local;
+
+/**
+ * Local implementation of "Remove"
+ *
+ * @author <a href="mailto:arubinge at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Local
+public interface RemoveStatefulLocal extends Remove
+{
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulLocal.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulRemote.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulRemote.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulRemote.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree786;
+
+import javax.ejb.Remote;
+
+/**
+ * Remote implementation of "Remove"
+ *
+ * @author <a href="mailto:arubinge at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Remote
+public interface RemoveStatefulRemote extends Remove
+{
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulRemote.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessLocal.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessLocal.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessLocal.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree786;
+
+import javax.ejb.Local;
+
+/**
+ * Local implementation of "Remove"
+ *
+ * @author <a href="mailto:arubinge at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Local
+public interface RemoveStatelessLocal extends Remove
+{
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessLocal.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessRemote.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessRemote.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessRemote.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree786;
+
+import javax.ejb.Remote;
+
+/**
+ * Remote implementation of "Remove"
+ *
+ * @author <a href="mailto:arubinge at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Remote
+public interface RemoveStatelessRemote extends Remove
+{
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessRemote.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatefulRemoveBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatefulRemoveBean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatefulRemoveBean.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree786;
+
+import javax.ejb.Stateful;
+
+import org.jboss.annotation.ejb.LocalBinding;
+import org.jboss.annotation.ejb.RemoteBinding;
+
+/**
+ * Defines a custom "remove" method that is not associated w/ EJBOBject/EJBLocalObject.remove
+ *
+ * @author <a href="mailto:arubinge at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateful
+ at LocalBinding(jndiBinding = StatefulRemoveBean.JNDI_NAME_LOCAL)
+ at RemoteBinding(jndiBinding = StatefulRemoveBean.JNDI_NAME_REMOTE)
+public class StatefulRemoveBean extends AbstractRemoveBean implements RemoveStatefulRemote, RemoveStatefulLocal
+{
+   // Class Members
+   public static final String JNDI_NAME_REMOTE = "StatefulRemoveBean/remote";
+
+   public static final String JNDI_NAME_LOCAL = "StatefulRemoveBean/local";
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatefulRemoveBean.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatelessRemoveBean.java (from rev 65797, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/GhostRemoverBean.java)
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatelessRemoveBean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatelessRemoveBean.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree786;
+
+import javax.ejb.Stateless;
+
+import org.jboss.annotation.ejb.LocalBinding;
+import org.jboss.annotation.ejb.RemoteBinding;
+
+/**
+ * Defines a custom "remove" method that is not associated w/ EJBOBject/EJBLocalObject.remove
+ *
+ * @author <a href="mailto:arubinge at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at LocalBinding(jndiBinding = StatelessRemoveBean.JNDI_NAME_LOCAL)
+ at RemoteBinding(jndiBinding = StatelessRemoveBean.JNDI_NAME_REMOTE)
+public class StatelessRemoveBean extends AbstractRemoveBean implements RemoveStatelessRemote, RemoveStatelessLocal
+{
+   // Class Members
+   public static final String JNDI_NAME_REMOTE = "StatelessRemoveBean/remote";
+
+   public static final String JNDI_NAME_LOCAL = "StatelessRemoveBean/local";
+}
\ No newline at end of file


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatelessRemoveBean.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Deleted: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/GhostRemoverTesterUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/GhostRemoverTesterUnitTestCase.java	2007-10-04 00:24:51 UTC (rev 65821)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/GhostRemoverTesterUnitTestCase.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.ejbthree786.unit;
-
-import junit.framework.Test;
-
-import org.jboss.ejb3.test.ejbthree786.GhostRemover;
-import org.jboss.test.JBossTestCase;
-
-/**
- * We want a remove action on a backing bean.
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
-public class GhostRemoverTesterUnitTestCase extends JBossTestCase
-{
-
-   public GhostRemoverTesterUnitTestCase(String name)
-   {
-      super(name);
-   }
-
-   public void testSuper() throws Exception
-   {
-      GhostRemover session = (GhostRemover) getInitialContext().lookup("GhostRemoverBean/remote");
-      String result = session.remove();
-      assertEquals("Ghost", result);
-   }
-   
-   public static Test suite() throws Exception
-   {
-      return getDeploySetup(GhostRemoverTesterUnitTestCase.class, "ejbthree786.jar");
-   }
-}

Copied: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java (from rev 65797, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/GhostRemoverTesterUnitTestCase.java)
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java	2007-10-04 02:02:24 UTC (rev 65822)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree786.unit;
+
+import javax.ejb.EJBObject;
+import javax.ejb.NoSuchEJBException;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree786.AbstractRemoveBean;
+import org.jboss.ejb3.test.ejbthree786.Delegate;
+import org.jboss.ejb3.test.ejbthree786.DelegateBean;
+import org.jboss.ejb3.test.ejbthree786.Ejb21View;
+import org.jboss.ejb3.test.ejbthree786.Ejb21ViewBean;
+import org.jboss.ejb3.test.ejbthree786.RemoveStatefulRemote;
+import org.jboss.ejb3.test.ejbthree786.RemoveStatelessRemote;
+import org.jboss.ejb3.test.ejbthree786.StatefulRemoveBean;
+import org.jboss.ejb3.test.ejbthree786.StatelessRemoveBean;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * We want a remove action on a backing bean.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @author <a href="mailto:arubinge at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public class RemoveMethodUnitTestCase extends JBossTestCase
+{
+
+   public RemoveMethodUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testRemoveStatefulRemote() throws Exception
+   {
+      RemoveStatefulRemote session = (RemoveStatefulRemote) getInitialContext().lookup(
+            StatefulRemoveBean.JNDI_NAME_REMOTE);
+      String result = session.remove();
+      assertEquals(AbstractRemoveBean.RETURN_STRING, result);
+   }
+
+   public void testRemoveStatelessRemote() throws Exception
+   {
+      RemoveStatelessRemote session = (RemoveStatelessRemote) getInitialContext().lookup(
+            StatelessRemoveBean.JNDI_NAME_REMOTE);
+      String result = session.remove();
+      assertEquals(AbstractRemoveBean.RETURN_STRING, result);
+   }
+
+   public void testRemoveStatefulLocalViaDelegate() throws Exception
+   {
+      Delegate session = (Delegate) getInitialContext().lookup(DelegateBean.JNDI_NAME_REMOTE);
+      String result = session.invokeStatefulRemove();
+      assertEquals(AbstractRemoveBean.RETURN_STRING, result);
+   }
+
+   public void testRemoveStatelessLocalViaDelegate() throws Exception
+   {
+      Delegate session = (Delegate) getInitialContext().lookup(DelegateBean.JNDI_NAME_REMOTE);
+      String result = session.invokeStatelessRemove();
+      assertEquals(AbstractRemoveBean.RETURN_STRING, result);
+   }
+
+   public void testExplicitExtensionEjbObjectInProxy() throws Exception
+   {
+      // Obtain stub
+      Ejb21View session = (Ejb21View) getInitialContext().lookup(Ejb21ViewBean.JNDI_NAME_REMOTE);
+
+      // Ensure EJBObject 
+      assertTrue(session instanceof EJBObject);
+
+      // Cast and remove appropriately, ensuring removed
+      EJBObject obj = (EJBObject) session;
+      boolean removed = false;
+      String result = session.test();
+      assertEquals(Ejb21ViewBean.TEST_STRING, result);
+      obj.remove();
+      try
+      {
+         session.test();
+      }
+      catch (NoSuchEJBException nsee)
+      {
+         removed = true;
+      }
+      assertTrue(removed);
+
+   }
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(RemoveMethodUnitTestCase.class, "ejbthree786.jar");
+   }
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native




More information about the jboss-cvs-commits mailing list