[jboss-cvs] JBossAS SVN: r58198 - in trunk/ejb3: . src/main/org/jboss/ejb3 src/test/org/jboss/ejb3/test src/test/org/jboss/ejb3/test/ejbthree751 src/test/org/jboss/ejb3/test/ejbthree751/fail src/test/org/jboss/ejb3/test/ejbthree751/pass src/test/org/jboss/ejb3/test/ejbthree751/unit
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Nov 8 07:24:18 EST 2006
Author: wolfc
Date: 2006-11-08 07:24:04 -0500 (Wed, 08 Nov 2006)
New Revision: 58198
Added:
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/fail/
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/fail/FailLocalRemoteSameInterface.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/fail/FailLocalRemoteSameInterfaceBean.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/pass/
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/pass/PassLocalInterface.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/pass/PassLocalRemoteDifferentInterfacesBean.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/pass/PassRemoteInterface.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/unit/
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/unit/FailLocalRemoteSameInterfaceUnitTestCase.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/unit/PassLocalRemoteDifferentInterfacesUnitTestCase.java
Modified:
trunk/ejb3/.classpath
trunk/ejb3/build-test.xml
trunk/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java
Log:
EJBTHREE-751: no local and remote on one interface
Modified: trunk/ejb3/.classpath
===================================================================
--- trunk/ejb3/.classpath 2006-11-08 01:13:31 UTC (rev 58197)
+++ trunk/ejb3/.classpath 2006-11-08 12:24:04 UTC (rev 58198)
@@ -85,7 +85,7 @@
<classpathentry kind="lib" path="/thirdparty/jboss/jbossxb/lib/jboss-xml-binding.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/iiop"/>
<classpathentry kind="lib" path="/thirdparty/jacorb/lib/jacorb.jar"/>
- <classpathentry kind="lib" path="/thirdparty/jboss/test/lib/jboss-test.jar"/>
+ <classpathentry sourcepath="/thirdparty/jboss/test/lib/jboss-test-src.zip" kind="lib" path="/thirdparty/jboss/test/lib/jboss-test.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/security/lib/jbosssx.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/security-spi/lib/jboss-security-spi.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/system-jmx"/>
Modified: trunk/ejb3/build-test.xml
===================================================================
--- trunk/ejb3/build-test.xml 2006-11-08 01:13:31 UTC (rev 58197)
+++ trunk/ejb3/build-test.xml 2006-11-08 12:24:04 UTC (rev 58198)
@@ -1750,6 +1750,25 @@
</jar>
</target>
+ <target name="ejbthree751"
+ description="Builds all jar files."
+ depends="compile-classes">
+
+ <mkdir dir="${build.lib}"/>
+
+ <jar jarfile="${build.lib}/ejbthree751-fail.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/ejb3/test/ejbthree751/fail/*.class"/>
+ </fileset>
+ </jar>
+
+ <jar jarfile="${build.lib}/ejbthree751-pass.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/ejb3/test/ejbthree751/pass/*.class"/>
+ </fileset>
+ </jar>
+ </target>
+
<target name="wolfc"
description="Builds all jar files."
depends="compile-classes">
@@ -2751,7 +2770,7 @@
<target name="jars" depends="arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader,
circulardependency, jsp, timerdependency, servicedependency, servlet, stateless14, webservices, ear, ejbthree440,
- ejbthree454, ejbthree653, ejbthree670, aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency,
+ ejbthree454, ejbthree653, ejbthree670, ejbthree751, aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency,
securitydomain, enventry,
jms/managed, naming, bmt, jca/inflowmdb, pool, jms, security, reference21_30, factory, dd/web, txexceptions,
exception, dd/override, stateless, standalone-jar, dd/mdb, bank, dd, longlived, xmlcfg, hbm, pkg, regressionHHH275,
@@ -3469,6 +3488,9 @@
<antcall target="test" inheritRefs="true">
<param name="test" value="microbench"/>
</antcall>
+ <antcall target="test" inheritRefs="true">
+ <param name="test" value="ejbthree751"/>
+ </antcall>
</target>
<target name="entity-tests" depends="init" description="Execute all tests">
Modified: trunk/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java 2006-11-08 01:13:31 UTC (rev 58197)
+++ trunk/ejb3/src/main/org/jboss/ejb3/ProxyFactoryHelper.java 2006-11-08 12:24:04 UTC (rev 58198)
@@ -123,7 +123,7 @@
intfs = locals.toArray(new Class[locals.size()]);
li = new LocalImpl(intfs);
((Advisor) container).getAnnotations().addClassAnnotation(javax.ejb.Local.class, li);
- return li.value();
+ //return li.value(); ALR Removed (EJBTHREE-751)
}
}
// no @Local interfaces implemented
@@ -151,6 +151,25 @@
((EJBContainer) container).getAnnotations().addClassAnnotation(javax.ejb.Local.class, li);
return rtn;
}
+
+
+ // Check to ensure @Local and @Remote are not defined on the same interface
+ // JIRA EJBTHREE-751
+ if(ri != null)
+ {
+ for (Class remoteInterface : ri)
+ {
+ for (Class localInterface : li.value())
+ {
+ if (localInterface.equals(remoteInterface))
+ {
+ throw new RuntimeException("@Remote and @Local may not both be specified on the same interface \""
+ + remoteInterface.toString() + "\" per EJB3 Spec 4.6.7, Bullet 5.4");
+ }
+ }
+ }
+ }
+
return li.value();
}
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/fail/FailLocalRemoteSameInterface.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/fail/FailLocalRemoteSameInterface.java 2006-11-08 01:13:31 UTC (rev 58197)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/fail/FailLocalRemoteSameInterface.java 2006-11-08 12:24:04 UTC (rev 58198)
@@ -0,0 +1,37 @@
+/*
+ * 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.ejbthree751.fail;
+
+import javax.ejb.Local;
+import javax.ejb.Remote;
+
+/**
+ * @author <a href="mailto:alr at alrubinger.com">Andrew Rubinger</a>
+ * @version $Revision: $
+ */
+ at Local
+ at Remote
+public interface FailLocalRemoteSameInterface {
+
+ public void test();
+
+}
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/fail/FailLocalRemoteSameInterfaceBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/fail/FailLocalRemoteSameInterfaceBean.java 2006-11-08 01:13:31 UTC (rev 58197)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/fail/FailLocalRemoteSameInterfaceBean.java 2006-11-08 12:24:04 UTC (rev 58198)
@@ -0,0 +1,38 @@
+/*
+ * 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.ejbthree751.fail;
+
+import javax.ejb.Stateless;
+
+/**
+ * @author <a href="mailto:alr at alrubinger.com">Andrew Rubinger</a>
+ * @version $Revision: $
+ */
+ at Stateless
+public class FailLocalRemoteSameInterfaceBean implements
+ FailLocalRemoteSameInterface {
+
+ public void test() {
+ System.out.println("Invoked.");
+ }
+
+}
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/pass/PassLocalInterface.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/pass/PassLocalInterface.java 2006-11-08 01:13:31 UTC (rev 58197)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/pass/PassLocalInterface.java 2006-11-08 12:24:04 UTC (rev 58198)
@@ -0,0 +1,35 @@
+/*
+ * 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.ejbthree751.pass;
+
+import javax.ejb.Local;
+
+/**
+ * @author <a href="mailto:alr at alrubinger.com">Andrew Rubinger</a>
+ * @version $Revision: $
+ */
+ at Local
+public interface PassLocalInterface {
+
+ public void test();
+
+}
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/pass/PassLocalRemoteDifferentInterfacesBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/pass/PassLocalRemoteDifferentInterfacesBean.java 2006-11-08 01:13:31 UTC (rev 58197)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/pass/PassLocalRemoteDifferentInterfacesBean.java 2006-11-08 12:24:04 UTC (rev 58198)
@@ -0,0 +1,38 @@
+/*
+ * 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.ejbthree751.pass;
+
+import javax.ejb.Stateless;
+
+/**
+ * @author <a href="mailto:alr at alrubinger.com">Andrew Rubinger</a>
+ * @version $Revision: $
+ */
+ at Stateless
+public class PassLocalRemoteDifferentInterfacesBean implements
+ PassLocalInterface, PassRemoteInterface {
+
+ public void test() {
+ System.out.println("Invoked.");
+ }
+
+}
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/pass/PassRemoteInterface.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/pass/PassRemoteInterface.java 2006-11-08 01:13:31 UTC (rev 58197)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/pass/PassRemoteInterface.java 2006-11-08 12:24:04 UTC (rev 58198)
@@ -0,0 +1,35 @@
+/*
+ * 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.ejbthree751.pass;
+
+import javax.ejb.Remote;
+
+/**
+ * @author <a href="mailto:alr at alrubinger.com">Andrew Rubinger</a>
+ * @version $Revision: $
+ */
+ at Remote
+public interface PassRemoteInterface {
+
+ public void test();
+
+}
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/unit/FailLocalRemoteSameInterfaceUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/unit/FailLocalRemoteSameInterfaceUnitTestCase.java 2006-11-08 01:13:31 UTC (rev 58197)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/unit/FailLocalRemoteSameInterfaceUnitTestCase.java 2006-11-08 12:24:04 UTC (rev 58198)
@@ -0,0 +1,59 @@
+/*
+ * 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.ejbthree751.unit;
+
+import junit.framework.Test;
+
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class FailLocalRemoteSameInterfaceUnitTestCase extends JBossTestCase
+{
+ public FailLocalRemoteSameInterfaceUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() throws Exception
+ {
+ // do not deploy any jars
+ return getDeploySetup(FailLocalRemoteSameInterfaceUnitTestCase.class, null);
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ undeploy("ejbthree751-fail.jar");
+ super.tearDown();
+ }
+
+ public void testDeploymentFailure() throws Exception
+ {
+ redeploy("ejbthree751-fail.jar");
+ fail("should throw an exception");
+ }
+}
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/unit/PassLocalRemoteDifferentInterfacesUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/unit/PassLocalRemoteDifferentInterfacesUnitTestCase.java 2006-11-08 01:13:31 UTC (rev 58197)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree751/unit/PassLocalRemoteDifferentInterfacesUnitTestCase.java 2006-11-08 12:24:04 UTC (rev 58198)
@@ -0,0 +1,58 @@
+/*
+ * 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.ejbthree751.unit;
+
+import junit.framework.Test;
+
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class PassLocalRemoteDifferentInterfacesUnitTestCase extends JBossTestCase
+{
+ public PassLocalRemoteDifferentInterfacesUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() throws Exception
+ {
+ // do not deploy any jars
+ return getDeploySetup(PassLocalRemoteDifferentInterfacesUnitTestCase.class, null);
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ undeploy("ejbthree751-pass.jar");
+ super.tearDown();
+ }
+
+ public void testDeploymentSuccess() throws Exception
+ {
+ deploy("ejbthree751-pass.jar");
+ }
+}
More information about the jboss-cvs-commits
mailing list