[jboss-cvs] JBossAS SVN: r65821 - in branches/Branch_4_2/ejb3: src/main/org/jboss/ejb3 and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Oct 3 20:24:51 EDT 2007
Author: ALRubinger
Date: 2007-10-03 20:24:51 -0400 (Wed, 03 Oct 2007)
New Revision: 65821
Added:
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/AbstractStatelessBean.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStateless.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessBean.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessLocal.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessRemote.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/Tester.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/TesterBean.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/SuperBeanTesterUnitTestCase.java
Removed:
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/AbstractStatelessBean.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStateless.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessBean.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/TesterBean.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/SuperBeanTesterUnitTestCase.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/mdb/MDB.java
Log:
EJBTHREE-785: Merged fixes from trunk to Branch 4.2. Passes Unit Tests.
Modified: branches/Branch_4_2/ejb3/build-test.xml
===================================================================
--- branches/Branch_4_2/ejb3/build-test.xml 2007-10-03 22:52:26 UTC (rev 65820)
+++ branches/Branch_4_2/ejb3/build-test.xml 2007-10-04 00:24:51 UTC (rev 65821)
@@ -1807,6 +1807,10 @@
</jar>
</target>
+ <target name="ejbthree785" depends="compile-classes">
+ <build-simple-jar name="ejbthree785"/>
+ </target>
+
<target name="ejbthree832"
description="Builds all jar files."
depends="compile-classes">
@@ -3365,10 +3369,10 @@
</fileset>
</copy>
</target>
-
+
<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, ejbthree832, ejbthree921,
+ ejbthree454, ejbthree653, ejbthree670, ejbthree712, ejbthree724, ejbthree751, ejbthree785, ejbthree832, ejbthree921,
ejbthree959, ejbthree963, ejbthree986, ejbthree994, ejbthree1023, ejbthree1025,
jbas4489,
aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency, jaxws,
@@ -3928,6 +3932,9 @@
<param name="test" value="ejbthree751"/>
</antcall>
<antcall target="test" inheritRefs="true">
+ <param name="test" value="ejbthree785"/>
+ </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-03 22:52:26 UTC (rev 65820)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java 2007-10-04 00:24:51 UTC (rev 65821)
@@ -21,16 +21,12 @@
*/
package org.jboss.ejb3;
-import org.jboss.annotation.ejb.LocalHomeBinding;
-import org.jboss.annotation.ejb.RemoteHomeBinding;
-import org.jboss.annotation.ejb.LocalBinding;
-import org.jboss.annotation.ejb.RemoteBinding;
-import org.jboss.annotation.ejb.RemoteBindings;
-import org.jboss.aop.Advisor;
-import org.jboss.ejb.LocalImpl;
-import org.jboss.ejb.RemoteImpl;
-import org.jboss.logging.Logger;
-import org.jboss.ejb3.remoting.RemoteProxyFactory;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
import javax.ejb.Local;
import javax.ejb.LocalHome;
@@ -41,10 +37,18 @@
import javax.naming.Context;
import javax.naming.NameNotFoundException;
import javax.naming.NamingException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
+import org.jboss.annotation.ejb.LocalBinding;
+import org.jboss.annotation.ejb.LocalHomeBinding;
+import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.annotation.ejb.RemoteBindings;
+import org.jboss.annotation.ejb.RemoteHomeBinding;
+import org.jboss.aop.Advisor;
+import org.jboss.ejb.LocalImpl;
+import org.jboss.ejb.RemoteImpl;
+import org.jboss.ejb3.remoting.RemoteProxyFactory;
+import org.jboss.logging.Logger;
+
/**
* Comment
*
@@ -90,7 +94,7 @@
// We have an emtpy @Local annotated bean class
- ArrayList list = getBusinessInterfaces(container.getBeanClass());
+ List list = getBusinessInterfaces(container.getBeanClass());
if (list.size() == 0)
throw new RuntimeException("Use of empty @Local on bean class and there are no valid business interfaces: " + container.getEjbName());
if (list.size() > 1)
@@ -111,7 +115,7 @@
// introspect implemented interfaces.
if (li == null)
{
- Class[] intfs = beanClass.getInterfaces();
+ List<Class<?>> intfs = getBusinessInterfaces(beanClass);
ArrayList<Class> locals = new ArrayList<Class>();
for (Class clazz : intfs)
{
@@ -122,8 +126,7 @@
}
if (locals.size() > 0)
{
- intfs = locals.toArray(new Class[locals.size()]);
- li = new LocalImpl(intfs);
+ li = new LocalImpl(locals.toArray(new Class[]{}));
((Advisor) container).getAnnotations().addClassAnnotation(javax.ejb.Local.class, li);
//return li.value(); ALR Removed (EJBTHREE-751)
}
@@ -132,7 +135,7 @@
if (li == null)
{
// search for default
- ArrayList<Class> interfaces = getBusinessInterfaces(beanClass);
+ List<Class<?>> interfaces = getBusinessInterfaces(beanClass);
if (interfaces.size() != 1) return null; // indeterminate
Class intf = interfaces.get(0);
@@ -175,23 +178,57 @@
return li.value();
}
- public static ArrayList<Class> getBusinessInterfaces(Class beanClass)
+ /**
+ * Resolve the potential business interfaces on an enterprise bean.
+ * Returns all interfaces implemented by this class and it's supers which
+ * are potentially a business interface.
+ *
+ * Note: for normal operation call container.getBusinessInterfaces().
+ *
+ * @param beanClass the EJB implementation class
+ * @return a list of potential business interfaces
+ * @see org.jboss.ejb3.EJBContainer#getBusinessInterfaces()
+ */
+ public static List<Class<?>> getBusinessInterfaces(Class<?> beanClass)
{
- ArrayList<Class> interfaces = new ArrayList<Class>(Arrays.asList(beanClass.getInterfaces()));
- interfaces.remove(java.io.Serializable.class);
- interfaces.remove(java.io.Externalizable.class);
- interfaces.remove(javax.ejb.SessionSynchronization.class);
- interfaces.remove(javax.ejb.TimedObject.class);
- Iterator<Class> it = interfaces.iterator();
- while (it.hasNext())
+ // Obtain all business interfaces implemented by this bean class and its superclasses
+ return getBusinessInterfaces(beanClass, new ArrayList<Class<?>>());
+ }
+
+ private static List<Class<?>> getBusinessInterfaces(Class<?> beanClass, List<Class<?>> interfaces)
+ {
+ /*
+ * 4.6.6:
+ * The following interfaces are excluded when determining whether the bean class has
+ * more than one interface: java.io.Serializable; java.io.Externaliz-
+ * able; any of the interfaces defined by the javax.ejb package.
+ */
+ for(Class<?> intf : beanClass.getInterfaces())
{
- String interfaceName = it.next().getName();
- if (interfaceName.startsWith("javax.ejb")) it.remove();
+ if(intf.equals(java.io.Externalizable.class))
+ continue;
+ if(intf.equals(java.io.Serializable.class))
+ continue;
+ if(intf.getName().startsWith("java.ejb"))
+ continue;
- //FIXME Other aop frameworks might add other interfaces, this should really be configurable
- if (interfaceName.startsWith("org.jboss.aop.")) it.remove();
+ // FIXME Other aop frameworks might add other interfaces, this should really be configurable
+ if(intf.getName().startsWith("org.jboss.aop"))
+ continue;
+
+ interfaces.add(intf);
}
- return interfaces;
+
+ // If there's no superclass, return
+ if (beanClass.getSuperclass() == null)
+ {
+ return interfaces;
+ }
+ else
+ {
+ // Include any superclasses' interfaces
+ return getBusinessInterfaces(beanClass.getSuperclass(), interfaces);
+ }
}
public static Class getLocalHomeInterface(Container container)
@@ -365,7 +402,7 @@
if (ri == null)
{
Class beanClass = container.getBeanClass();
- Class[] intfs = beanClass.getInterfaces();
+ Class[] intfs = ProxyFactoryHelper.getBusinessInterfaces(beanClass).toArray(new Class[]{});
ArrayList<Class> remotes = new ArrayList<Class>();
for (Class clazz : intfs)
{
@@ -389,7 +426,7 @@
// We have an emtpy @Remote annotated bean class
- ArrayList list = getBusinessInterfaces(container.getBeanClass());
+ List list = getBusinessInterfaces(container.getBeanClass());
if (list.size() == 0)
throw new RuntimeException("Use of empty @Remote on bean class and there are no valid business interfaces: " + container.getEjbName());
if (list.size() > 1)
Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/mdb/MDB.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/mdb/MDB.java 2007-10-03 22:52:26 UTC (rev 65820)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/mdb/MDB.java 2007-10-04 00:24:51 UTC (rev 65821)
@@ -84,7 +84,7 @@
messagingType = annotation.messageListenerInterface();
if (messagingType.getName().equals(Object.class.getName()))
{
- ArrayList<Class> list = ProxyFactoryHelper.getBusinessInterfaces(clazz);
+ List<Class<?>> list = ProxyFactoryHelper.getBusinessInterfaces(clazz);
if (list.size() > 1 || list.size() == 0) throw new RuntimeException("unable to determine messagingType interface for MDB");
messagingType = list.get(0);
}
Copied: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785 (from rev 65530, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785)
Deleted: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/AbstractStatelessBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/AbstractStatelessBean.java 2007-09-21 14:02:27 UTC (rev 65530)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/AbstractStatelessBean.java 2007-10-04 00:24:51 UTC (rev 65821)
@@ -1,36 +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.ejbthree785;
-
-/**
- * This one implements the business interface.
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
-public class AbstractStatelessBean implements MyStateless
-{
- public String sayHiTo(String name)
- {
- return "Hi " + name;
- }
-}
Copied: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/AbstractStatelessBean.java (from rev 65530, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/AbstractStatelessBean.java)
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/AbstractStatelessBean.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/AbstractStatelessBean.java 2007-10-04 00:24:51 UTC (rev 65821)
@@ -0,0 +1,36 @@
+/*
+ * 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.ejbthree785;
+
+/**
+ * This one implements the business interface.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class AbstractStatelessBean implements MyStatelessRemote, MyStatelessLocal
+{
+ public String sayHiTo(String name)
+ {
+ return "Hi " + name;
+ }
+}
Property changes on: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/AbstractStatelessBean.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStateless.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStateless.java 2007-09-21 14:02:27 UTC (rev 65530)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStateless.java 2007-10-04 00:24:51 UTC (rev 65821)
@@ -1,36 +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.ejbthree785;
-
-import javax.ejb.Local;
-
-/**
- * Comment
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
- at Local
-public interface MyStateless
-{
- String sayHiTo(String name);
-}
Copied: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStateless.java (from rev 65530, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStateless.java)
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStateless.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStateless.java 2007-10-04 00:24:51 UTC (rev 65821)
@@ -0,0 +1,36 @@
+/*
+ * 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.ejbthree785;
+
+import javax.ejb.Local;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Local
+public interface MyStateless
+{
+ String sayHiTo(String name);
+}
Property changes on: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStateless.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessBean.java 2007-09-21 14:02:27 UTC (rev 65530)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessBean.java 2007-10-04 00:24:51 UTC (rev 65821)
@@ -1,36 +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.ejbthree785;
-
-import javax.ejb.Stateless;
-
-/**
- * Comment
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
- at Stateless
-public class MyStatelessBean extends AbstractStatelessBean
-{
-
-}
Copied: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessBean.java (from rev 65530, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessBean.java)
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessBean.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessBean.java 2007-10-04 00:24:51 UTC (rev 65821)
@@ -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.ejbthree785;
+
+import javax.ejb.Stateless;
+
+import org.jboss.annotation.ejb.LocalBinding;
+import org.jboss.annotation.ejb.RemoteBinding;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @author <a href="mailto:alr at alrubinger.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at RemoteBinding(jndiBinding = MyStatelessBean.JNDI_NAME_REMOTE)
+ at LocalBinding(jndiBinding = MyStatelessBean.JNDI_NAME_LOCAL)
+public class MyStatelessBean extends AbstractStatelessBean
+{
+ public static final String JNDI_NAME_REMOTE = "MyStatelessBean/remote";
+
+ public static final String JNDI_NAME_LOCAL = "MyStatelessBean/local";
+}
Property changes on: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessBean.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessLocal.java (from rev 65702, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessLocal.java)
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessLocal.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessLocal.java 2007-10-04 00:24:51 UTC (rev 65821)
@@ -0,0 +1,36 @@
+/*
+ * 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.ejbthree785;
+
+import javax.ejb.Local;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Local
+public interface MyStatelessLocal
+{
+ String sayHiTo(String name);
+}
Property changes on: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessRemote.java (from rev 65702, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessRemote.java)
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessRemote.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessRemote.java 2007-10-04 00:24:51 UTC (rev 65821)
@@ -0,0 +1,36 @@
+/*
+ * 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.ejbthree785;
+
+import javax.ejb.Remote;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Remote
+public interface MyStatelessRemote
+{
+ String sayHiTo(String name);
+}
Property changes on: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/MyStatelessRemote.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/Tester.java (from rev 65702, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/Tester.java)
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/Tester.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/Tester.java 2007-10-04 00:24:51 UTC (rev 65821)
@@ -0,0 +1,15 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ejb3.test.ejbthree785;
+
+import javax.ejb.Remote;
+
+ at Remote
+public interface Tester
+{
+ String sayHiTo(String name);
+}
Property changes on: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/Tester.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/TesterBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/TesterBean.java 2007-09-21 14:02:27 UTC (rev 65530)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/TesterBean.java 2007-10-04 00:24:51 UTC (rev 65821)
@@ -1,45 +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.ejbthree785;
-
-import javax.ejb.EJB;
-import javax.ejb.Remote;
-import javax.ejb.Stateless;
-
-/**
- * Comment
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
- at Stateless
- at Remote(value=MyStateless.class)
-public class TesterBean
-{
- @EJB(beanName="MyStatelessBean")
- private MyStateless delegate;
-
- public String sayHiTo(String name)
- {
- return delegate.sayHiTo(name);
- }
-}
Copied: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/TesterBean.java (from rev 65530, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/TesterBean.java)
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/TesterBean.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/TesterBean.java 2007-10-04 00:24:51 UTC (rev 65821)
@@ -0,0 +1,28 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ejb3.test.ejbthree785;
+
+import javax.ejb.EJB;
+import javax.ejb.Stateless;
+
+import org.jboss.annotation.ejb.RemoteBinding;
+
+ at Stateless
+ at RemoteBinding(jndiBinding = TesterBean.JNDI_NAME)
+public class TesterBean implements Tester
+{
+ // Class Members
+ public static final String JNDI_NAME = "TesterBean/remote";
+
+ @EJB
+ private MyStatelessLocal local;
+
+ public String sayHiTo(String name)
+ {
+ return local.sayHiTo(name);
+ }
+}
Property changes on: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/TesterBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit (from rev 65530, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit)
Deleted: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/SuperBeanTesterUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/SuperBeanTesterUnitTestCase.java 2007-09-21 14:02:27 UTC (rev 65530)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/SuperBeanTesterUnitTestCase.java 2007-10-04 00:24:51 UTC (rev 65821)
@@ -1,58 +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.ejbthree785.unit;
-
-import java.util.Date;
-
-import junit.framework.Test;
-
-import org.jboss.ejb3.test.ejbthree785.MyStateless;
-import org.jboss.test.JBossTestCase;
-
-/**
- * Test to see if a super can have the business interface.
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
-public class SuperBeanTesterUnitTestCase extends JBossTestCase
-{
-
- public SuperBeanTesterUnitTestCase(String name)
- {
- super(name);
- }
-
- public void testSuper() throws Exception
- {
- MyStateless session = (MyStateless) getInitialContext().lookup("TesterBean/remote");
- Date date = new Date();
- String expected = "Hi " + date.toString();
- String actual = session.sayHiTo(date.toString());
- assertEquals(expected, actual);
- }
-
- public static Test suite() throws Exception
- {
- return getDeploySetup(SuperBeanTesterUnitTestCase.class, "ejbthree785.jar");
- }
-}
Copied: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/SuperBeanTesterUnitTestCase.java (from rev 65530, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/SuperBeanTesterUnitTestCase.java)
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/SuperBeanTesterUnitTestCase.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/SuperBeanTesterUnitTestCase.java 2007-10-04 00:24:51 UTC (rev 65821)
@@ -0,0 +1,98 @@
+/*
+ * 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.ejbthree785.unit;
+
+import java.util.Date;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree785.MyStatelessBean;
+import org.jboss.ejb3.test.ejbthree785.MyStatelessLocal;
+import org.jboss.ejb3.test.ejbthree785.MyStatelessRemote;
+import org.jboss.ejb3.test.ejbthree785.Tester;
+import org.jboss.ejb3.test.ejbthree785.TesterBean;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Test to see if a super can have the business interface.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @author <a href="mailto:alr at alrubinger.com">ALR</a>
+ * @version $Revision: $
+ */
+public class SuperBeanTesterUnitTestCase extends JBossTestCase
+{
+
+ public SuperBeanTesterUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Ensures that a remote view of a business interface
+ * implemented by a superclass of an EJB's Implementation
+ * Class is deployed and invokable
+ *
+ * @throws Exception
+ */
+ public void testSuperRemoteInvokable() throws Exception
+ {
+ MyStatelessRemote session = (MyStatelessRemote) getInitialContext().lookup(MyStatelessBean.JNDI_NAME_REMOTE);
+ Date date = new Date();
+ String expected = "Hi " + date.toString();
+ String actual = session.sayHiTo(date.toString());
+ assertEquals(expected, actual);
+ }
+
+ /**
+ * Ensures that a local view of a business interface
+ * implemented by a superclass of an EJB's Implementation
+ * Class is deployed; won't be invokable as unit test runs in separate JVM
+ *
+ * @throws Exception
+ */
+ public void testSuperLocalDeployed() throws Exception
+ {
+ MyStatelessLocal session = (MyStatelessLocal) getInitialContext().lookup(MyStatelessBean.JNDI_NAME_LOCAL);
+ assertNotNull(session);
+ }
+
+ /**
+ * Ensures that dependencies may be made upon EJBs with @Local implemented by
+ * superclass of an EJB's Implementation Class, and that invocation succeeds.
+ *
+ * @throws Exception
+ */
+ public void testSuperLocalViaRemoteDelegate() throws Exception
+ {
+ Tester session = (Tester) getInitialContext().lookup(TesterBean.JNDI_NAME);
+ Date date = new Date();
+ String expected = "Hi " + date.toString();
+ String actual = session.sayHiTo(date.toString());
+ assertEquals(expected, actual);
+ }
+
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(SuperBeanTesterUnitTestCase.class, "ejbthree785.jar");
+ }
+}
Property changes on: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree785/unit/SuperBeanTesterUnitTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
More information about the jboss-cvs-commits
mailing list