[jboss-cvs] JBossAS SVN: r68227 - in trunk/ejb3: src/test/org/jboss/ejb3/test and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Dec 13 02:53:28 EST 2007


Author: ALRubinger
Date: 2007-12-13 02:53:28 -0500 (Thu, 13 Dec 2007)
New Revision: 68227

Added:
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1130/
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1130/TestBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1130/TestRemoteBusiness.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1130/unit/
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1130/unit/LocalBindingWithNoLocalInterfaceUnitTestCase.java
Modified:
   trunk/ejb3/build-test.xml
Log:
[EJBTHREE-1130] Added Unit Test

Modified: trunk/ejb3/build-test.xml
===================================================================
--- trunk/ejb3/build-test.xml	2007-12-13 07:43:26 UTC (rev 68226)
+++ trunk/ejb3/build-test.xml	2007-12-13 07:53:28 UTC (rev 68227)
@@ -2238,6 +2238,10 @@
       <build-simple-jar name="ejbthree1127"/>
    </target>
 	
+   <target name="ejbthree1130" depends="compile-classes">
+      <build-simple-jar name="ejbthree1130"/>
+   </target>
+	
    <target name="ejbthree1146" depends="compile-classes">
       <build-simple-jar name="ejbthree1146"/>
    </target>
@@ -3943,6 +3947,7 @@
       ejbthree1057, ejbthree1060,
       ejbthree1062,
       ejbthree1066, ejbthree1071, ejbthree1075, ejbthree1082, ejbthree1090, ejbthree1092, ejbthree1119, ejbthree1122, ejbthree1123, ejbthree1127,
+      ejbthree1130, 
       ejbthree1146, ejbthree1148, ejbthree1154, ejbthree1155, ejbthree1157, jaxws, jbas4489,
       aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency,
       securitydomain, enventry, security5,
@@ -4939,6 +4944,9 @@
          <param name="test" value="ejbthree1127"/>
       </antcall>
       <antcall target="test" inheritRefs="true">
+         <param name="test" value="ejbthree1130"/>
+      </antcall>
+      <antcall target="test" inheritRefs="true">
          <param name="test" value="ejbthree1146"/>
       </antcall>
       <antcall target="test" inheritRefs="true">

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1130/TestBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1130/TestBean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1130/TestBean.java	2007-12-13 07:53:28 UTC (rev 68227)
@@ -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.ejbthree1130;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
+import org.jboss.ejb3.annotation.LocalBinding;
+import org.jboss.ejb3.annotation.RemoteBinding;
+
+/**
+ * A Test Bean implementing a Remote Business Interface
+ * and defining a LocalBinding
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Remote(TestRemoteBusiness.class)
+ at RemoteBinding(jndiBinding = TestRemoteBusiness.JNDI_NAME)
+ at LocalBinding(jndiBinding = TestRemoteBusiness.JNDI_NAME)
+public class TestBean implements TestRemoteBusiness
+{
+
+}


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

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1130/TestRemoteBusiness.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1130/TestRemoteBusiness.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1130/TestRemoteBusiness.java	2007-12-13 07:53:28 UTC (rev 68227)
@@ -0,0 +1,33 @@
+/*
+ * 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.ejbthree1130;
+
+/**
+ * A Test Remote Business Interface
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestRemoteBusiness
+{
+   String JNDI_NAME = "TestBean/remote";
+}


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

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1130/unit/LocalBindingWithNoLocalInterfaceUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1130/unit/LocalBindingWithNoLocalInterfaceUnitTestCase.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1130/unit/LocalBindingWithNoLocalInterfaceUnitTestCase.java	2007-12-13 07:53:28 UTC (rev 68227)
@@ -0,0 +1,75 @@
+/*
+ * 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.ejbthree1130.unit;
+
+import javax.naming.NamingException;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree1130.TestRemoteBusiness;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Tests that EJBs with a @LocalBinding and no local 
+ * business interface fails deployment
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public class LocalBindingWithNoLocalInterfaceUnitTestCase extends JBossTestCase
+{
+   // Constructor
+   public LocalBindingWithNoLocalInterfaceUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   // Suite
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(LocalBindingWithNoLocalInterfaceUnitTestCase.class, "ejbthree1130.jar");
+   }
+
+   // Tests 
+
+   /**
+    * Ensure that EJB with Remote Business interface and 
+    * @LocalBinding defined fails deployment
+    */
+   public void testLocalBindingWithNoLocalInterface() throws Exception
+   {
+      try
+      {
+         // Lookup EJB 
+         this.getInitialContext().lookup(TestRemoteBusiness.JNDI_NAME);
+      }
+      catch (NamingException ne)
+      {
+         // Expected
+         return;
+      }
+
+      // Should not be reached
+      JBossTestCase.fail("EJB should fail deployment and not be available at " + TestRemoteBusiness.JNDI_NAME);
+   }
+
+}
\ No newline at end of file


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




More information about the jboss-cvs-commits mailing list