[jboss-cvs] JBossAS SVN: r66245 - in trunk/ejb3/src/test/org/jboss/ejb3/test: ejbthree1075 and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 18 12:49:59 EDT 2007


Author: ALRubinger
Date: 2007-10-18 12:49:59 -0400 (Thu, 18 Oct 2007)
New Revision: 66245

Added:
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/homeonly/
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/homeonly/RemoteHomeOnly21Bean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/homeonly/RemoteHomeOnly21Business.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/homeonly/RemoteHomeOnly21Home.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/remoteonly/
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/remoteonly/RemoteInterfaceOnly21.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/remoteonly/RemoteInterfaceOnly21Bean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/remoteonly/RemoteInterfaceOnly21Business.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/unit/
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/unit/Incomplete21ViewUnitTestCase.java
Log:
EJBTHREE-1075: Added Unit Tests

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/homeonly/RemoteHomeOnly21Bean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/homeonly/RemoteHomeOnly21Bean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/homeonly/RemoteHomeOnly21Bean.java	2007-10-18 16:49:59 UTC (rev 66245)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ * 
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ejb3.test.ejbthree1075.homeonly;
+
+import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
+import javax.ejb.Stateless;
+
+import org.jboss.annotation.ejb.RemoteBinding;
+
+/**
+ * A RemoteHomeOnly21Bean.
+ * 
+ * This EJB should fail deployment as a remote home is defined, but no remote interface is. 
+ * 
+ * @author <a href="andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision:  $
+ */
+ at Stateless
+ at RemoteHome(RemoteHome.class)
+ at Remote(RemoteHomeOnly21Business.class)
+ at RemoteBinding(jndiBinding=RemoteHomeOnly21Business.JNDI_NAME_REMOTE)
+public class RemoteHomeOnly21Bean implements RemoteHomeOnly21Business
+{
+
+   public void test()
+   {
+   }
+
+}


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

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/homeonly/RemoteHomeOnly21Business.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/homeonly/RemoteHomeOnly21Business.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/homeonly/RemoteHomeOnly21Business.java	2007-10-18 16:49:59 UTC (rev 66245)
@@ -0,0 +1,14 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ * 
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ejb3.test.ejbthree1075.homeonly;
+
+public interface RemoteHomeOnly21Business
+{
+   public static final String JNDI_NAME_REMOTE = "RemoteHomeOnly21Bean/remote";
+
+   void test();
+}


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

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/homeonly/RemoteHomeOnly21Home.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/homeonly/RemoteHomeOnly21Home.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/homeonly/RemoteHomeOnly21Home.java	2007-10-18 16:49:59 UTC (rev 66245)
@@ -0,0 +1,14 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ * 
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ejb3.test.ejbthree1075.homeonly;
+
+import javax.ejb.EJBHome;
+
+public interface RemoteHomeOnly21Home extends EJBHome
+{
+
+}


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

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/remoteonly/RemoteInterfaceOnly21.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/remoteonly/RemoteInterfaceOnly21.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/remoteonly/RemoteInterfaceOnly21.java	2007-10-18 16:49:59 UTC (rev 66245)
@@ -0,0 +1,14 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ * 
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ejb3.test.ejbthree1075.remoteonly;
+
+import javax.ejb.EJBObject;
+
+public interface RemoteInterfaceOnly21 extends EJBObject
+{
+
+}


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

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/remoteonly/RemoteInterfaceOnly21Bean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/remoteonly/RemoteInterfaceOnly21Bean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/remoteonly/RemoteInterfaceOnly21Bean.java	2007-10-18 16:49:59 UTC (rev 66245)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ * 
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ejb3.test.ejbthree1075.remoteonly;
+
+import javax.ejb.Stateless;
+
+import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.ejb3.test.ejbthree1075.homeonly.RemoteHomeOnly21Business;
+
+/**
+ * A RemoteOnly21Bean.
+ * 
+ * This EJB should fail deployment as a remote interface is defined, but no remote home is. 
+ * 
+ * @author <a href="andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision:  $
+ */
+ at Stateless
+ at javax.ejb.Remote(
+{RemoteInterfaceOnly21.class, RemoteInterfaceOnly21Business.class})
+ at RemoteBinding(jndiBinding = RemoteHomeOnly21Business.JNDI_NAME_REMOTE)
+public class RemoteInterfaceOnly21Bean implements RemoteInterfaceOnly21Business
+{
+
+   public void test()
+   {
+   }
+
+}


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

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/remoteonly/RemoteInterfaceOnly21Business.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/remoteonly/RemoteInterfaceOnly21Business.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/remoteonly/RemoteInterfaceOnly21Business.java	2007-10-18 16:49:59 UTC (rev 66245)
@@ -0,0 +1,14 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ * 
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ejb3.test.ejbthree1075.remoteonly;
+
+public interface RemoteInterfaceOnly21Business
+{
+   public static final String JNDI_NAME_REMOTE = "RemoteOnly21Bean/remote";
+
+   void test();
+}


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

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/unit/Incomplete21ViewUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/unit/Incomplete21ViewUnitTestCase.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1075/unit/Incomplete21ViewUnitTestCase.java	2007-10-18 16:49:59 UTC (rev 66245)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ * 
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.ejb3.test.ejbthree1075.unit;
+
+import javax.naming.NameNotFoundException;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree1075.homeonly.RemoteHomeOnly21Bean;
+import org.jboss.ejb3.test.ejbthree1075.homeonly.RemoteHomeOnly21Business;
+import org.jboss.ejb3.test.ejbthree1075.remoteonly.RemoteInterfaceOnly21Business;
+import org.jboss.ejb3.test.ejbthree1075.remoteonly.RemoteInterfaceOnly21Bean;
+import org.jboss.test.JBossTestCase;
+
+public class Incomplete21ViewUnitTestCase extends JBossTestCase
+{
+
+   // Constructor
+
+   public Incomplete21ViewUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   // Suite
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(Incomplete21ViewUnitTestCase.class, "ejbthree1075-homeonly.jar,ejbthree1075-remoteonly.jar");
+   }
+
+   // Test
+
+   /**
+    * Ensure that an EJB with remote home and no remote interface fails deployment
+    */
+   public void testRemoteHomeOnlyFails() throws Exception
+   {
+      try
+      {
+         // Attempt to access a bean that should have failed on deploy
+         getInitialContext().lookup(RemoteHomeOnly21Business.JNDI_NAME_REMOTE);
+      }
+      catch (NameNotFoundException nnfe)
+      {
+         // Expected
+         return;
+      }
+      // Should not reach this point
+      fail(RemoteHomeOnly21Bean.class.getName() + " should not have deployed or be available in JNDI at "
+            + RemoteHomeOnly21Business.JNDI_NAME_REMOTE);
+   }
+
+   /**
+    * Ensure that an EJB with remote interfaces but no remote home fails deployment
+    */
+   public void testRemoteInterfaceOnlyFails() throws Exception
+   {
+      try
+      {
+         // Attempt to access a bean that should have failed on deploy
+         getInitialContext().lookup(RemoteInterfaceOnly21Business.JNDI_NAME_REMOTE);
+      }
+      catch (NameNotFoundException nnfe)
+      {
+         // Expected
+         return;
+      }
+      // Should not reach this point
+      fail(RemoteInterfaceOnly21Bean.class.getName() + " should not have deployed or be available in JNDI at "
+            + RemoteInterfaceOnly21Business.JNDI_NAME_REMOTE);
+   }
+
+}


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




More information about the jboss-cvs-commits mailing list