[jboss-cvs] JBossAS SVN: r88814 - in branches/JBPAPP_4_2_0_GA_CP/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 May 13 09:06:07 EDT 2009
Author: wolfc
Date: 2009-05-13 09:06:07 -0400 (Wed, 13 May 2009)
New Revision: 88814
Added:
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestBaseClass.java
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestLocalBusinessInterface.java
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestRemoteBusinessInterface.java
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestServiceBean.java
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestStatefulBean.java
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestStatelessBean.java
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/unit/
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/unit/MultipleDefinitionsOfSameBusinessInterfaceUnitTestCase.java
Removed:
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestBaseClass.java
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/unit/
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/unit/MultipleDefinitionsOfSameBusinessInterfaceUnitTestCase.java
Modified:
branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java
branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/MDB.java
Log:
JBPAPP-1601: merged EJBTHREE-1122
Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml 2009-05-13 12:53:29 UTC (rev 88813)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/build-test.xml 2009-05-13 13:06:07 UTC (rev 88814)
@@ -2070,6 +2070,10 @@
</jar>
</target>
+ <target name="ejbthree1122" depends="compile-classes">
+ <build-simple-jar name="ejbthree1122"/>
+ </target>
+
<target name="ejbthree1239"
description="Builds a simple jar files."
depends="compile-classes">
@@ -3868,6 +3872,7 @@
ejbthree1028,
ejbthree1062,
ejbthree1109,
+ ejbthree1122,
ejbthree1239,
ejbthree1358,
ejbthree1504,
@@ -4503,6 +4508,9 @@
<param name="test" value="ejbthree1062"/>
</antcall>
<antcall target="test" inheritRefs="true">
+ <param name="test" value="ejbthree1122"/>
+ </antcall>
+ <antcall target="test" inheritRefs="true">
<param name="test" value="ejbthree1239"/>
</antcall>
<antcall target="test" inheritRefs="true">
Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java 2009-05-13 12:53:29 UTC (rev 88813)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java 2009-05-13 13:06:07 UTC (rev 88814)
@@ -21,17 +21,13 @@
*/
package org.jboss.ejb3;
-import java.io.Serializable;
import java.net.URI;
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
-import javax.ejb.EJBLocalObject;
-import javax.ejb.EJBObject;
import javax.ejb.Local;
import javax.ejb.LocalHome;
import javax.ejb.Remote;
@@ -97,7 +93,7 @@
Remote remoteAnnotation = (Remote)((EJBContainer) container).resolveAnnotation(Remote.class);
// Obtain all business interfaces
- List<Class<?>> businessInterfaces = getBusinessInterfaces(container.getBeanClass());
+ Set<Class<?>> businessInterfaces = getBusinessInterfaces(container.getBeanClass());
// JIRA EJBTHREE-1062
// EJB 3 4.6.6
@@ -173,7 +169,7 @@
}
}
- Class[] rtn = {(Class) businessInterfaces.get(0)};
+ Class<?>[] rtn = { businessInterfaces.iterator().next() };
localAnnotation = new LocalImpl(rtn);
((EJBContainer) container).getAnnotations().addClassAnnotation(javax.ejb.Local.class, localAnnotation);
return rtn;
@@ -190,9 +186,9 @@
// introspect implemented interfaces.
if (localAnnotation == null)
{
- List<Class<?>> intfs = getBusinessInterfaces(beanClass);
- ArrayList<Class> locals = new ArrayList<Class>();
- for (Class clazz : intfs)
+ Set<Class<?>> intfs = getBusinessInterfaces(beanClass);
+ Set<Class<?>> locals = new HashSet<Class<?>>();
+ for (Class<?> clazz : intfs)
{
if (clazz.isAnnotationPresent(javax.ejb.Local.class))
{
@@ -210,13 +206,13 @@
if (localAnnotation == null)
{
// search for default
- List<Class<?>> interfaces = getBusinessInterfaces(beanClass);
+ Set<Class<?>> interfaces = getBusinessInterfaces(beanClass);
if (interfaces.size() != 1) return null; // indeterminate
- Class intf = interfaces.get(0);
+ Class<?> intf = interfaces.iterator().next();
if (remoteInterfaces != null)
{
- for (Class rintf : remoteInterfaces)
+ for (Class<?> rintf : remoteInterfaces)
{
if (intf.getName().equals(rintf.getName()))
{
@@ -226,7 +222,7 @@
}
if (intf.getName().equals(endpoint)) return null;
- Class[] rtn = {intf};
+ Class<?>[] rtn = {intf};
localAnnotation = new LocalImpl(rtn);
((EJBContainer) container).getAnnotations().addClassAnnotation(javax.ejb.Local.class, localAnnotation);
return rtn;
@@ -264,14 +260,14 @@
* @return a list of potential business interfaces
* @see org.jboss.ejb3.EJBContainer#getBusinessInterfaces()
*/
- public static List<Class<?>> getBusinessInterfaces(Class<?> beanClass)
+ public static Set<Class<?>> getBusinessInterfaces(Class<?> beanClass)
{
// Obtain all business interfaces implemented by this bean class and its superclasses
- return getBusinessInterfaces(beanClass, new ArrayList<Class<?>>());
+ return getBusinessInterfaces(beanClass, new HashSet<Class<?>>());
}
- private static List<Class<?>> getBusinessInterfaces(Class<?> beanClass, List<Class<?>> interfaces)
+ private static Set<Class<?>> getBusinessInterfaces(Class<?> beanClass, Set<Class<?>> interfaces)
{
/*
* 4.6.6:
@@ -502,12 +498,12 @@
// We have an emtpy @Remote annotated bean class
- List list = getBusinessInterfaces(container.getBeanClass());
- if (list.size() == 0)
+ Set<Class<?>> businessInterfaces = getBusinessInterfaces(container.getBeanClass());
+ if (businessInterfaces.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)
+ if (businessInterfaces.size() > 1)
throw new RuntimeException("Use of empty @Remote on bean class and there are more than one default interface: " + container.getEjbName());
- Class[] rtn = {(Class) list.get(0)};
+ Class<?>[] rtn = { businessInterfaces.iterator().next() };
ri = new RemoteImpl(rtn);
((EJBContainer) container).getAnnotations().addClassAnnotation(javax.ejb.Remote.class, ri);
return rtn;
Modified: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/MDB.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/MDB.java 2009-05-13 12:53:29 UTC (rev 88813)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/main/org/jboss/ejb3/mdb/MDB.java 2009-05-13 13:06:07 UTC (rev 88814)
@@ -24,8 +24,8 @@
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Hashtable;
-import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
@@ -97,9 +97,9 @@
messagingType = annotation.messageListenerInterface();
if (messagingType.getName().equals(Object.class.getName()))
{
- List<Class<?>> list = ProxyFactoryHelper.getBusinessInterfaces(clazz);
+ Set<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);
+ messagingType = list.iterator().next();
}
}
Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122 (from rev 67301, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122)
Deleted: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestBaseClass.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestBaseClass.java 2007-11-20 17:17:05 UTC (rev 67301)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestBaseClass.java 2009-05-13 13:06:07 UTC (rev 88814)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.ejbthree1122;
-
-/**
- * Test Base, implementing @Remote business interface
- *
- * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
- * @version $Revision: $
- */
-public class TestBaseClass implements TestBusinessInterface
-{
-
- public void test()
- {
- }
-
-}
Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestBaseClass.java (from rev 67301, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestBaseClass.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestBaseClass.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestBaseClass.java 2009-05-13 13:06:07 UTC (rev 88814)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejbthree1122;
+
+/**
+ * Test Base, implementing @Remote and @Local business interfaces
+ *
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public abstract class TestBaseClass implements TestRemoteBusinessInterface, TestLocalBusinessInterface
+{
+ // Required Implementations
+
+ public void test()
+ {
+ }
+
+ public void testLocal()
+ {
+ this.getLocal().test();
+ }
+
+ // Contracts
+
+ public abstract TestLocalBusinessInterface getLocal();
+}
Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestLocalBusinessInterface.java (from rev 67307, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestLocalBusinessInterface.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestLocalBusinessInterface.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestLocalBusinessInterface.java 2009-05-13 13:06:07 UTC (rev 88814)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejbthree1122;
+
+import javax.ejb.Local;
+
+/**
+ * Test Local Business Interface
+ *
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Local
+public interface TestLocalBusinessInterface
+{
+ String JNDI_NAME_STATELESS_LOCAL = "TestBean/stateless/local";
+
+ String JNDI_NAME_STATEFUL_LOCAL = "TestBean/stateful/local";
+
+ String JNDI_NAME_SERVICE_LOCAL = "TestBean/service/local";
+
+ void test();
+}
Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestRemoteBusinessInterface.java (from rev 67307, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestRemoteBusinessInterface.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestRemoteBusinessInterface.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestRemoteBusinessInterface.java 2009-05-13 13:06:07 UTC (rev 88814)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejbthree1122;
+
+import javax.ejb.Remote;
+
+/**
+ * Test Remote Business Interface
+ *
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Remote
+public interface TestRemoteBusinessInterface
+{
+ String JNDI_NAME_STATELESS_REMOTE = "TestBean/stateless/remote";
+
+ String JNDI_NAME_STATEFUL_REMOTE = "TestBean/stateful/remote";
+
+ String JNDI_NAME_SERVICE_REMOTE = "TestBean/service/remote";
+
+ void test();
+
+ void testLocal();
+}
Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestServiceBean.java (from rev 67307, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestServiceBean.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestServiceBean.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestServiceBean.java 2009-05-13 13:06:07 UTC (rev 88814)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejbthree1122;
+
+import javax.ejb.EJB;
+
+import org.jboss.annotation.ejb.LocalBinding;
+import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.annotation.ejb.Service;
+
+/**
+ * A Service/Singleton/Mbean Test EJB both directly implementing a remote business interface
+ * and extending from a base class that also implements a remote
+ * business interface
+ *
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Service
+ at RemoteBinding(jndiBinding = TestRemoteBusinessInterface.JNDI_NAME_SERVICE_REMOTE)
+ at LocalBinding(jndiBinding = TestLocalBusinessInterface.JNDI_NAME_SERVICE_LOCAL)
+public class TestServiceBean extends TestBaseClass implements TestRemoteBusinessInterface, TestLocalBusinessInterface
+{
+ // Instance Members
+ @EJB(mappedName = TestLocalBusinessInterface.JNDI_NAME_SERVICE_LOCAL)
+ TestLocalBusinessInterface localRef;
+
+ public TestLocalBusinessInterface getLocal()
+ {
+ return localRef;
+ }
+}
Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestStatefulBean.java (from rev 67307, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestStatefulBean.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestStatefulBean.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestStatefulBean.java 2009-05-13 13:06:07 UTC (rev 88814)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejbthree1122;
+
+import javax.ejb.Stateful;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.annotation.ejb.LocalBinding;
+import org.jboss.annotation.ejb.RemoteBinding;
+
+/**
+ * A Stateful Test EJB both directly implementing a remote business interface
+ * and extending from a base class that also implements a remote
+ * business interface
+ *
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateful
+ at RemoteBinding(jndiBinding = TestRemoteBusinessInterface.JNDI_NAME_STATEFUL_REMOTE)
+ at LocalBinding(jndiBinding = TestLocalBusinessInterface.JNDI_NAME_STATEFUL_LOCAL)
+public class TestStatefulBean extends TestBaseClass implements TestRemoteBusinessInterface, TestLocalBusinessInterface
+{
+ public TestLocalBusinessInterface getLocal()
+ {
+ try
+ {
+ return (TestLocalBusinessInterface) new InitialContext()
+ .lookup(TestLocalBusinessInterface.JNDI_NAME_STATEFUL_LOCAL);
+ }
+ catch (NamingException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestStatelessBean.java (from rev 67307, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestStatelessBean.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestStatelessBean.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/TestStatelessBean.java 2009-05-13 13:06:07 UTC (rev 88814)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejbthree1122;
+
+import javax.ejb.EJB;
+import javax.ejb.Stateless;
+
+import org.jboss.annotation.ejb.LocalBinding;
+import org.jboss.annotation.ejb.RemoteBinding;
+
+/**
+ * A Stateless Test EJB both directly implementing a remote business interface
+ * and extending from a base class that also implements a remote
+ * business interface
+ *
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at RemoteBinding(jndiBinding = TestRemoteBusinessInterface.JNDI_NAME_STATELESS_REMOTE)
+ at LocalBinding(jndiBinding = TestLocalBusinessInterface.JNDI_NAME_STATELESS_LOCAL)
+public class TestStatelessBean extends TestBaseClass implements TestRemoteBusinessInterface, TestLocalBusinessInterface
+{
+ // Instance Members
+ @EJB(mappedName = TestLocalBusinessInterface.JNDI_NAME_STATELESS_LOCAL)
+ TestLocalBusinessInterface localRef;
+
+ public TestLocalBusinessInterface getLocal()
+ {
+ return localRef;
+ }
+}
Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/unit (from rev 67301, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/unit)
Deleted: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/unit/MultipleDefinitionsOfSameBusinessInterfaceUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/unit/MultipleDefinitionsOfSameBusinessInterfaceUnitTestCase.java 2007-11-20 17:17:05 UTC (rev 67301)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/unit/MultipleDefinitionsOfSameBusinessInterfaceUnitTestCase.java 2009-05-13 13:06:07 UTC (rev 88814)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.ejbthree1122.unit;
-
-import junit.framework.Test;
-
-import org.jboss.test.JBossTestCase;
-
-/**
- * Tests to ensure that a bean with the same @Remote business interface
- * defined multiple times (both explicitly and via inheritance)
- * deploys successfully
- *
- * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
- * @version $Revision: $
- */
-public class MultipleDefinitionsOfSameBusinessInterfaceUnitTestCase extends JBossTestCase
-{
- // Constructor
- public MultipleDefinitionsOfSameBusinessInterfaceUnitTestCase(String name)
- {
- super(name);
- }
-
- // Suite
- public static Test suite() throws Exception
- {
- return getDeploySetup(MultipleDefinitionsOfSameBusinessInterfaceUnitTestCase.class, "ejbthree1122.jar");
- }
-
-
-}
Copied: branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/unit/MultipleDefinitionsOfSameBusinessInterfaceUnitTestCase.java (from rev 67301, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/unit/MultipleDefinitionsOfSameBusinessInterfaceUnitTestCase.java)
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/unit/MultipleDefinitionsOfSameBusinessInterfaceUnitTestCase.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA_CP/ejb3/src/test/org/jboss/ejb3/test/ejbthree1122/unit/MultipleDefinitionsOfSameBusinessInterfaceUnitTestCase.java 2009-05-13 13:06:07 UTC (rev 88814)
@@ -0,0 +1,165 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejbthree1122.unit;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.common.EJB3TestCase;
+import org.jboss.ejb3.test.ejbthree1122.TestRemoteBusinessInterface;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Tests to ensure that a bean with the same @Remote business interface
+ * defined multiple times (both explicitly and via inheritance)
+ * deploys successfully
+ *
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public class MultipleDefinitionsOfSameBusinessInterfaceUnitTestCase extends EJB3TestCase
+{
+ // Constructor
+ public MultipleDefinitionsOfSameBusinessInterfaceUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ // Suite
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(MultipleDefinitionsOfSameBusinessInterfaceUnitTestCase.class, "ejbthree1122.jar");
+ }
+
+ // Tests
+
+ /**
+ * Test the Stateless Remote EJB
+ */
+ public void testTestStatelessRemoteEjb() throws Exception
+ {
+ this.internalTestRemoteView(TestRemoteBusinessInterface.JNDI_NAME_STATELESS_REMOTE);
+ }
+
+ /**
+ * Test the Stateless Local EJB
+ */
+ public void testTestStatelessLocalEjb() throws Exception
+ {
+ this.internalTestLocalView(TestRemoteBusinessInterface.JNDI_NAME_STATELESS_REMOTE);
+ }
+
+ /**
+ * Test the Service Remote EJB
+ */
+ public void testTestServiceRemoteEjb() throws Exception
+ {
+ this.internalTestRemoteView(TestRemoteBusinessInterface.JNDI_NAME_SERVICE_REMOTE);
+ }
+
+ /**
+ * Test the Service Local EJB
+ */
+ public void testTestServiceLocalEjb() throws Exception
+ {
+ this.internalTestLocalView(TestRemoteBusinessInterface.JNDI_NAME_SERVICE_REMOTE);
+ }
+
+ /**
+ * Test the Stateful Remote EJB
+ */
+ public void testTestStatefulRemoteEjb() throws Exception
+ {
+ this.internalTestRemoteView(TestRemoteBusinessInterface.JNDI_NAME_STATEFUL_REMOTE);
+ }
+
+ /**
+ * Test the Stateful Local EJB
+ */
+ public void testTestStatefulLocalEjb() throws Exception
+ {
+ this.internalTestLocalView(TestRemoteBusinessInterface.JNDI_NAME_STATEFUL_REMOTE);
+ }
+
+ // Internal Helper Methods
+
+ private void internalTestRemoteView(String jndiName)
+ {
+ // Initialize
+ TestRemoteBusinessInterface test = null;
+
+ // Lookup
+ try
+ {
+ test = (TestRemoteBusinessInterface) this.getInitialContext().lookup(
+ jndiName);
+ }
+ catch (Throwable t)
+ {
+ log.error(t);
+ JBossTestCase.fail(t.getMessage());
+ }
+ // Ensure lookup succeeds; bean is deployed
+ JBossTestCase.assertNotNull(test);
+
+ // Invoke
+ try
+ {
+ test.test();
+ }
+ catch (Throwable t)
+ {
+ log.error(t);
+ JBossTestCase.fail("Invocation failed: " + t.getMessage());
+ }
+ }
+
+ private void internalTestLocalView(String remoteDelegateJndiName)
+ {
+ // Initialize
+ TestRemoteBusinessInterface test = null;
+
+ // Lookup
+ try
+ {
+ test = (TestRemoteBusinessInterface) this.getInitialContext().lookup(remoteDelegateJndiName);
+ }
+ catch (Throwable t)
+ {
+ log.error(t);
+ JBossTestCase.fail(t.getMessage());
+ }
+ // Ensure lookup succeeds; bean is deployed
+ JBossTestCase.assertNotNull(test);
+
+ // Invoke on local
+ try
+ {
+ test.testLocal();
+ }
+ catch (Throwable t)
+ {
+ log.error(t);
+ JBossTestCase.fail("Invocation failed: " + t.getMessage());
+ }
+ }
+
+}
More information about the jboss-cvs-commits
mailing list