[jboss-cvs] JBossAS SVN: r65843 - in branches/Branch_4_2/ejb3: src/main/org/jboss/ejb3 and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Oct 4 11:09:59 EDT 2007
Author: ALRubinger
Date: 2007-10-04 11:09:59 -0400 (Thu, 04 Oct 2007)
New Revision: 65843
Added:
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/AbstractRemoveBean.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Delegate.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/DelegateBean.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Remove.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulLocal.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulRemote.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessLocal.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessRemote.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatefulRemoveBean.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatelessRemoveBean.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java
Modified:
branches/Branch_4_2/ejb3/build-test.xml
branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java
branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java
branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java
branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java
branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java
Log:
EJBTHREE-786: Merged some fixes and unit tests from trunk
Modified: branches/Branch_4_2/ejb3/build-test.xml
===================================================================
--- branches/Branch_4_2/ejb3/build-test.xml 2007-10-04 14:34:28 UTC (rev 65842)
+++ branches/Branch_4_2/ejb3/build-test.xml 2007-10-04 15:09:59 UTC (rev 65843)
@@ -1810,6 +1810,10 @@
<target name="ejbthree785" depends="compile-classes">
<build-simple-jar name="ejbthree785"/>
</target>
+
+ <target name="ejbthree786" depends="compile-classes">
+ <build-simple-jar name="ejbthree786"/>
+ </target>
<target name="ejbthree832"
description="Builds all jar files."
@@ -3372,7 +3376,7 @@
<target name="jars" depends="removedislocal, statelesscreation, defaultremotebindings, localfromremote, clusteredjms, entityoptimisticlocking, concurrentnaming, propertyreplacement, persistenceunits, invalidtxmdb, descriptortypo, libdeployment, homeinterface, timestampentity, servicexmbean, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader,
circulardependency, jsp, timerdependency, servicedependency, servlet, stateless14, webservices, ear, ejbthree440,
- ejbthree454, ejbthree653, ejbthree670, ejbthree712, ejbthree724, ejbthree751, ejbthree785, ejbthree832, ejbthree921,
+ ejbthree454, ejbthree653, ejbthree670, ejbthree712, ejbthree724, ejbthree751, ejbthree785, ejbthree786, ejbthree832, ejbthree921,
ejbthree959, ejbthree963, ejbthree986, ejbthree994, ejbthree1023, ejbthree1025,
jbas4489,
aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency, jaxws,
@@ -3935,6 +3939,9 @@
<param name="test" value="ejbthree785"/>
</antcall>
<antcall target="test" inheritRefs="true">
+ <param name="test" value="ejbthree786"/>
+ </antcall>
+ <antcall target="test" inheritRefs="true">
<param name="test" value="ejbthree832"/>
</antcall>
<antcall target="test" inheritRefs="true">
Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java 2007-10-04 14:34:28 UTC (rev 65842)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -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;
@@ -84,7 +86,7 @@
}
- public static Class[] getLocalInterfaces(Container container)
+ public static Class<?>[] getLocalInterfaces(Container container)
{
Local li = (javax.ejb.Local) ((EJBContainer) container).resolveAnnotation(javax.ejb.Local.class);
@@ -230,7 +232,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();
@@ -396,7 +447,7 @@
}
}
- public static Class[] getRemoteInterfaces(Container container)
+ public static Class<?>[] getRemoteInterfaces(Container container)
{
Remote ri = (Remote) ((Advisor) container).resolveAnnotation(Remote.class);
if (ri == null)
Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java 2007-10-04 14:34:28 UTC (rev 65842)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulLocalProxyFactory.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -26,17 +26,19 @@
import java.io.ObjectOutput;
import java.lang.reflect.InvocationTargetException;
import java.rmi.dgc.VMID;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
-import javax.ejb.EJBException;
+import javax.ejb.EJBLocalObject;
import javax.ejb.LocalHome;
import javax.naming.NamingException;
+
import org.jboss.annotation.ejb.LocalBinding;
import org.jboss.aop.Advisor;
-import org.jboss.ejb3.Container;
import org.jboss.ejb3.EJBContainer;
import org.jboss.ejb3.Ejb3Registry;
import org.jboss.ejb3.JBossProxy;
-import org.jboss.ejb3.NonSerializableFactory;
import org.jboss.ejb3.ProxyFactoryHelper;
import org.jboss.logging.Logger;
import org.jboss.naming.Util;
@@ -54,32 +56,58 @@
private VMID vmid = Ejb3Registry.getVMID();
- protected Class[] getInterfaces()
- {
- Class[] interfaces;
-
+ protected Class<?>[] getInterfaces()
+ {
StatefulContainer statefulContainer = (StatefulContainer) getContainer();
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(statefulContainer)));
- Class[] localInterfaces = ProxyFactoryHelper.getLocalInterfaces(getContainer());
- 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: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java 2007-10-04 14:34:28 UTC (rev 65842)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateful/StatefulRemoteProxyFactory.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -23,9 +23,14 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Proxy;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import javax.ejb.EJBObject;
+import javax.ejb.RemoteHome;
import javax.naming.NamingException;
-import javax.ejb.RemoteHome;
+
import org.jboss.annotation.ejb.RemoteBinding;
import org.jboss.aop.Advisor;
import org.jboss.aop.AspectManager;
@@ -65,31 +70,49 @@
this.binding = binding;
}
- protected Class[] getInterfaces()
- {
- Class[] interfaces;
-
+ protected Class<?>[] getInterfaces()
+ {
StatefulContainer statefulContainer = (StatefulContainer) getContainer();
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(statefulContainer)));
- Class[] remoteInterfaces = ProxyFactoryHelper.getRemoteInterfaces(getContainer());
+ // 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: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java 2007-10-04 14:34:28 UTC (rev 65842)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessLocalProxyFactory.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -21,7 +21,11 @@
*/
package org.jboss.ejb3.stateless;
-import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.ejb.EJBLocalObject;
import javax.ejb.LocalHome;
import org.jboss.annotation.ejb.LocalBinding;
@@ -43,32 +47,57 @@
{
private static final Logger log = Logger.getLogger(StatelessLocalProxyFactory.class);
- protected Class[] getInterfaces()
+ protected Class<?>[] getInterfaces()
{
- Class[] interfaces;
-
- EJBContainer statelessContainer = (EJBContainer) getContainer();
- LocalHome localHome = (LocalHome) statelessContainer.resolveAnnotation(LocalHome.class);
-
+ EJBContainer statelessContainer = (EJBContainer)getContainer();
+ LocalHome localHome = (LocalHome)statelessContainer.resolveAnnotation(LocalHome.class);
+
boolean bindTogether = false;
if (localHome != null && bindHomeAndBusinessTogether(statelessContainer))
bindTogether = true;
-
- Class[] localInterfaces = ProxyFactoryHelper.getLocalInterfaces(getContainer());
-
- if (bindTogether)
- interfaces = new Class[localInterfaces.length + 3];
+
+ // Obtain all local interfaces
+ List<Class<?>> localInterfaces = new ArrayList<Class<?>>();
+ localInterfaces.addAll(Arrays.asList(ProxyFactoryHelper.getLocalInterfaces(statelessContainer)));
+
+ // Ensure remote interfaces defined
+ if (localInterfaces.size() > 0)
+ {
+ // 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);
+
+ // If binding along w/ home, add home
+ if (bindTogether)
+ {
+ localInterfaces.add(localHome.value());
+ }
+ }
else
- interfaces = new Class[localInterfaces.length + 2];
+ {
+ // No remote interfaces defined, log warning
+ log.warn("[EJBTHREE-933] NPE when deploying web service beans");
+ }
- System.arraycopy(localInterfaces, 0, interfaces, 0, localInterfaces.length);
- interfaces[localInterfaces.length] = JBossProxy.class;
- interfaces[localInterfaces.length + 1] = javax.ejb.EJBLocalObject.class;
- if (bindTogether)
- interfaces[localInterfaces.length + 2] = localHome.value();
-
- return interfaces;
+ // Return
+ return localInterfaces.toArray(new Class<?>[]
+ {});
}
protected boolean bindHomeAndBusinessTogether(EJBContainer container)
Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java 2007-10-04 14:34:28 UTC (rev 65842)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/stateless/StatelessRemoteProxyFactory.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -21,8 +21,14 @@
*/
package org.jboss.ejb3.stateless;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+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;
@@ -32,8 +38,8 @@
import org.jboss.ejb3.ProxyFactoryHelper;
import org.jboss.ejb3.remoting.RemoteProxyFactory;
import org.jboss.logging.Logger;
+import org.jboss.naming.Util;
import org.jboss.remoting.InvokerLocator;
-import org.jboss.naming.Util;
/**
* Comment
@@ -55,34 +61,57 @@
this.binding = binding;
}
- protected Class[] getInterfaces()
+ protected Class<?>[] getInterfaces()
{
- Class[] interfaces;
-
StatelessContainer statelessContainer = (StatelessContainer) getContainer();
RemoteHome remoteHome = (RemoteHome) statelessContainer.resolveAnnotation(RemoteHome.class);
-
+
boolean bindTogether = false;
-
+
if (remoteHome != null && bindHomeAndBusinessTogether(statelessContainer))
bindTogether = true;
-
- Class[] remoteInterfaces = ProxyFactoryHelper.getRemoteInterfaces(getContainer());
-
- if (bindTogether)
- interfaces = new Class[remoteInterfaces.length + 3];
+
+ // Obtain all remote interfaces
+ List<Class<?>> remoteInterfaces = new ArrayList<Class<?>>();
+ remoteInterfaces.addAll(Arrays.asList(ProxyFactoryHelper.getRemoteInterfaces(statelessContainer)));
+
+ // Ensure remote interfaces defined
+ if (remoteInterfaces.size() > 0)
+ {
+ // 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)
+ {
+ remoteInterfaces.add(remoteHome.value());
+ }
+ }
else
- interfaces = new Class[remoteInterfaces.length + 2];
-
- 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();
+ {
+ // No remote interfaces defined, log warning
+ log.warn("[EJBTHREE-933] NPE when deploying web service beans");
+ }
- return interfaces;
+ // Return
+ return remoteInterfaces.toArray(new Class<?>[]
+ {});
}
protected boolean bindHomeAndBusinessTogether(EJBContainer container)
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/AbstractRemoveBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/AbstractRemoveBean.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/AbstractRemoveBean.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -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: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/AbstractRemoveBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Delegate.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Delegate.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Delegate.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -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: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Delegate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/DelegateBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/DelegateBean.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/DelegateBean.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -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: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/DelegateBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -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: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21View.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -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: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Ejb21ViewBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Remove.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Remove.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Remove.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -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: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/Remove.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulLocal.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulLocal.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulLocal.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -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: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulRemote.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulRemote.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulRemote.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -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: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatefulRemote.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessLocal.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessLocal.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessLocal.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -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: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessRemote.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessRemote.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessRemote.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -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: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/RemoveStatelessRemote.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatefulRemoveBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatefulRemoveBean.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatefulRemoveBean.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -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: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatefulRemoveBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatelessRemoveBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatelessRemoveBean.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatelessRemoveBean.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -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: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/StatelessRemoveBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java 2007-10-04 15:09:59 UTC (rev 65843)
@@ -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: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree786/unit/RemoveMethodUnitTestCase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
More information about the jboss-cvs-commits
mailing list