[jboss-cvs] JBossAS SVN: r67916 - in trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127: unit and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 4 21:43:50 EST 2007


Author: ALRubinger
Date: 2007-12-04 21:43:50 -0500 (Tue, 04 Dec 2007)
New Revision: 67916

Added:
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/DelegateBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/DelegateRemoteBusiness.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/Test21WithNoLocalHomeInterfaceDefinedBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/Test21WithNoLocalInterfaceDefinedBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/Test30WithLocalBusinessInterfaceDefinedBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/TestLocal.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/TestLocalBusiness.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/TestLocalHome.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/unit/InterfaceDefinitionsUnitTestCase.java
Removed:
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/unit/RemoteInterfaceDefinitionsUnitTestCase.java
Log:
[EJBTHREE-1127] Enhanced Unit Tests to Account for Local/LocalHome

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/DelegateBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/DelegateBean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/DelegateBean.java	2007-12-05 02:43:50 UTC (rev 67916)
@@ -0,0 +1,105 @@
+/*
+ * 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.ejbthree1127;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJB;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.ejb3.annotation.RemoteBinding;
+import org.jboss.logging.Logger;
+
+/**
+ * A Delegate Bean for testing the locals
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Remote(DelegateRemoteBusiness.class)
+ at RemoteBinding(jndiBinding = DelegateRemoteBusiness.JNDI_NAME)
+public class DelegateBean implements DelegateRemoteBusiness
+{
+   // Class Members
+   private static final Logger logger = Logger.getLogger(DelegateBean.class);
+
+   // Instance Members
+   @EJB
+   TestLocalBusiness localBusiness;
+
+   // Required Implementations
+
+   public int testLocalBusinessOnlyDefined()
+   {
+      logger.info("testLocalBusinessOnlyDefined");
+      return localBusiness.test();
+   }
+
+   public int testNoLocalExplicitlyDefined()
+   {
+      logger.info("testNoLocalExplicitlyDefined");
+
+      // Obtain reference to home
+      TestLocalHome home = null;
+      try
+      {
+         home = (TestLocalHome)new InitialContext().lookup(TestLocalHome.JNDI_NAME);
+      }
+      catch (NamingException ne)
+      {
+         throw new RuntimeException(ne);
+      }
+      
+      // Invoke
+      try
+      {
+         return home.create().test();
+      }
+      catch (CreateException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   public int testNoLocalHomeDefined()
+   {
+      logger.info("testNoLocalHomeDefined");
+      
+      // Obtain reference to local
+      TestLocal local = null;
+      try
+      {
+         local = (TestLocal)new InitialContext().lookup(TestLocal.JNDI_NAME_NO_LOCAL_HOME);
+      }
+      catch (NamingException ne)
+      {
+         throw new RuntimeException(ne);
+      }
+      
+      
+      return local.test();
+   }
+
+}


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

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/DelegateRemoteBusiness.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/DelegateRemoteBusiness.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/DelegateRemoteBusiness.java	2007-12-05 02:43:50 UTC (rev 67916)
@@ -0,0 +1,39 @@
+/*
+ * 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.ejbthree1127;
+
+/**
+ * A Remote Business interface to a Delegate Bean to test the Locals
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface DelegateRemoteBusiness
+{
+   String JNDI_NAME = "DelegateBean/remote";
+   
+   int testNoLocalHomeDefined();
+   
+   int testNoLocalExplicitlyDefined();
+   
+   int testLocalBusinessOnlyDefined();
+}


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

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/Test21WithNoLocalHomeInterfaceDefinedBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/Test21WithNoLocalHomeInterfaceDefinedBean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/Test21WithNoLocalHomeInterfaceDefinedBean.java	2007-12-05 02:43:50 UTC (rev 67916)
@@ -0,0 +1,52 @@
+/*
+ * 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.ejbthree1127;
+
+import javax.ejb.Local;
+import javax.ejb.Stateless;
+
+import org.jboss.ejb3.annotation.LocalBinding;
+import org.jboss.logging.Logger;
+
+/**
+ * A Test EJB with a 2.1 View denoted only by a Local interface;
+ * the lack of a Local Home must lead to deployment failure
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Local(TestLocal.class)
+ at LocalBinding(jndiBinding=TestLocal.JNDI_NAME_NO_LOCAL_HOME)
+public class Test21WithNoLocalHomeInterfaceDefinedBean
+{
+   // Class Members
+   private static final Logger log = Logger.getLogger(Test21WithNoLocalHomeInterfaceDefinedBean.class);
+
+   // Required Implementations
+
+   public int test()
+   {
+      log.info("Called");
+      return TestLocal.RETURN_VALUE;
+   }
+}


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

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/Test21WithNoLocalInterfaceDefinedBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/Test21WithNoLocalInterfaceDefinedBean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/Test21WithNoLocalInterfaceDefinedBean.java	2007-12-05 02:43:50 UTC (rev 67916)
@@ -0,0 +1,53 @@
+/*
+ * 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.ejbthree1127;
+
+import javax.ejb.LocalHome;
+import javax.ejb.Stateless;
+
+import org.jboss.ejb3.annotation.LocalHomeBinding;
+import org.jboss.logging.Logger;
+
+/**
+ * A Test EJB with a 2.1 View denoted only by a Local Home interface;
+ * the Local interface must be inferred by the return type of the Local 
+ * Home's "create" method.
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at LocalHome(TestLocalHome.class)
+ at LocalHomeBinding(jndiBinding = TestLocalHome.JNDI_NAME)
+public class Test21WithNoLocalInterfaceDefinedBean
+{
+   // Class Members
+   private static final Logger log = Logger.getLogger(Test21WithNoLocalInterfaceDefinedBean.class);
+
+   // Required Implementations
+
+   public int test()
+   {
+      log.info("Called");
+      return TestLocal.RETURN_VALUE;
+   }
+}


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

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/Test30WithLocalBusinessInterfaceDefinedBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/Test30WithLocalBusinessInterfaceDefinedBean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/Test30WithLocalBusinessInterfaceDefinedBean.java	2007-12-05 02:43:50 UTC (rev 67916)
@@ -0,0 +1,49 @@
+/*
+ * 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.ejbthree1127;
+
+import javax.ejb.Local;
+import javax.ejb.Stateless;
+
+import org.jboss.logging.Logger;
+
+/**
+ * A Test EJB with a 3.0 View denoted only by a Local Business interface
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Local(TestLocalBusiness.class)
+public class Test30WithLocalBusinessInterfaceDefinedBean implements TestLocalBusiness
+{
+   // Class Members
+   private static final Logger log = Logger.getLogger(Test30WithLocalBusinessInterfaceDefinedBean.class);
+
+   // Required Implementations
+
+   public int test()
+   {
+      log.info("Called");
+      return TestLocalBusiness.RETURN_VALUE;
+   }
+}


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

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/TestLocal.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/TestLocal.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/TestLocal.java	2007-12-05 02:43:50 UTC (rev 67916)
@@ -0,0 +1,39 @@
+/*
+ * 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.ejbthree1127;
+
+import javax.ejb.EJBLocalObject;
+
+/**
+ * An EJB2.1 Local Interface
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestLocal extends EJBLocalObject
+{
+   String JNDI_NAME_NO_LOCAL_HOME = "NoLocalHomeBean/local";
+   
+   int RETURN_VALUE = 1;
+   
+   int test();
+}


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

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/TestLocalBusiness.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/TestLocalBusiness.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/TestLocalBusiness.java	2007-12-05 02:43:50 UTC (rev 67916)
@@ -0,0 +1,35 @@
+/*
+ * 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.ejbthree1127;
+
+/**
+ * A Test Local Business interface
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestLocalBusiness
+{
+   int RETURN_VALUE = 1;
+
+   int test();
+}


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

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/TestLocalHome.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/TestLocalHome.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/TestLocalHome.java	2007-12-05 02:43:50 UTC (rev 67916)
@@ -0,0 +1,37 @@
+/*
+ * 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.ejbthree1127;
+
+import javax.ejb.EJBLocalHome;
+
+/**
+ * An EJB2.1 Local Home Interface
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestLocalHome extends EJBLocalHome
+{
+   String JNDI_NAME = "TestLocal/home";
+   
+   public TestLocal create() throws javax.ejb.CreateException;
+}
\ No newline at end of file


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

Copied: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/unit/InterfaceDefinitionsUnitTestCase.java (from rev 67913, trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/unit/RemoteInterfaceDefinitionsUnitTestCase.java)
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/unit/InterfaceDefinitionsUnitTestCase.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/unit/InterfaceDefinitionsUnitTestCase.java	2007-12-05 02:43:50 UTC (rev 67916)
@@ -0,0 +1,161 @@
+/*
+ * 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.ejbthree1127.unit;
+
+import javax.naming.NameNotFoundException;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree1127.DelegateRemoteBusiness;
+import org.jboss.ejb3.test.ejbthree1127.TestLocal;
+import org.jboss.ejb3.test.ejbthree1127.TestLocalBusiness;
+import org.jboss.ejb3.test.ejbthree1127.TestRemote;
+import org.jboss.ejb3.test.ejbthree1127.TestRemoteBusiness;
+import org.jboss.ejb3.test.ejbthree1127.TestRemoteHome;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Tests that deployments succeed/fail based upon partially-denoted
+ * Remote/Local, Remote/Local Business, and Remote/Local Home interfaces ensuring
+ * Spec-compliant defaults. 
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public class InterfaceDefinitionsUnitTestCase extends JBossTestCase
+{
+   // Constructor
+   public InterfaceDefinitionsUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   // Suite
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(InterfaceDefinitionsUnitTestCase.class, "ejbthree1127.jar");
+   }
+
+   // Tests 
+
+   /**
+    * Ensure that the Test EJB with 3.0 View defined only by @Remote to 
+    * Remote Business interface properly deploys
+    */
+   public void test30ViewRemoteBusinessInterfaceDefined() throws Exception
+   {
+      // Lookup EJB 
+      TestRemoteBusiness ejb = (TestRemoteBusiness) this.getInitialContext().lookup(TestRemoteBusiness.JNDI_NAME);
+
+      // Invoke on it
+      assertEquals(ejb.test(), TestRemoteBusiness.RETURN_VALUE);
+   }
+
+   /**
+    * Ensure that the Test EJB with 2.1 View defined only by @RemoteHome properly deploys
+    */
+   public void test21ViewRemoteInterfaceNotExplicitlyDefined() throws Exception
+   {
+      // Lookup EJB Home
+      TestRemoteHome home = (TestRemoteHome) this.getInitialContext().lookup(TestRemoteHome.JNDI_NAME);
+
+      // Obtain instance of EJB
+      TestRemote ejb = home.create();
+
+      // Invoke on it
+      assertEquals(ejb.test(), TestRemote.RETURN_VALUE);
+   }
+
+   /**
+    * Ensure that the Test EJB with 2.1 View defined only by a Remote interface 
+    * (no Remote Home) fails to deploy
+    */
+   public void test21ViewRemoteHomeInterfaceNotDefined() throws Exception
+   {
+      // Lookup EJB Home
+      try
+      {
+         this.getInitialContext().lookup(TestRemote.JNDI_NAME_NO_REMOTE_HOME_DEFINED);
+      }
+      catch (NameNotFoundException nnfe)
+      {
+         // Expected
+         return;
+      }
+
+      // If we've reached this point, the EJB that shouldn't have deployed, did
+      JBossTestCase.fail("Test EJB with 2.1 View defining no Remote Home should not successfully deploy.");
+   }
+
+   /**
+    * Ensure that the Test EJB with 3.0 View defined only by @Local to 
+    * Local Business interface properly deploys
+    */
+   public void test30ViewLocalBusinessInterfaceDefined() throws Exception
+   {
+      // Lookup Delegate EJB 
+      DelegateRemoteBusiness ejb = (DelegateRemoteBusiness) this.getInitialContext().lookup(
+            DelegateRemoteBusiness.JNDI_NAME);
+
+      // Invoke on it
+      assertEquals(ejb.testLocalBusinessOnlyDefined(), TestLocalBusiness.RETURN_VALUE);
+   }
+
+   /**
+    * Ensure that the Test EJB with 2.1 View defined only by @LocalHome properly deploys
+    */
+   public void test21ViewLocalInterfaceNotExplicitlyDefined() throws Exception
+   {
+      // Lookup Delegate EJB 
+      DelegateRemoteBusiness ejb = (DelegateRemoteBusiness) this.getInitialContext().lookup(
+            DelegateRemoteBusiness.JNDI_NAME);
+
+      // Invoke 
+      assertEquals(ejb.testNoLocalExplicitlyDefined(), TestLocal.RETURN_VALUE);
+   }
+
+   /**
+    * Ensure that the Test EJB with 2.1 View defined only by a Local interface 
+    * (no Local Home) fails to deploy
+    */
+   public void test21ViewLocalHomeInterfaceNotDefined() throws Exception
+   {
+      // Lookup Delegate EJB 
+      DelegateRemoteBusiness ejb = (DelegateRemoteBusiness) this.getInitialContext().lookup(
+            DelegateRemoteBusiness.JNDI_NAME);
+
+      // Invoke 
+      try
+      {
+         ejb.testNoLocalHomeDefined();
+      }
+      catch (Exception e)
+      {
+         // Expected
+         return;
+      }
+
+      // If we've reached here, the bean deployed and it shouldn't have
+      JBossTestCase.fail("EJB with 2.1 Local View and no LocalHome defined should not have deployed.");
+   }
+
+}
\ No newline at end of file


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

Deleted: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/unit/RemoteInterfaceDefinitionsUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/unit/RemoteInterfaceDefinitionsUnitTestCase.java	2007-12-05 00:21:02 UTC (rev 67915)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1127/unit/RemoteInterfaceDefinitionsUnitTestCase.java	2007-12-05 02:43:50 UTC (rev 67916)
@@ -1,106 +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.ejbthree1127.unit;
-
-import javax.naming.NameNotFoundException;
-
-import junit.framework.Test;
-
-import org.jboss.ejb3.test.ejbthree1127.TestRemote;
-import org.jboss.ejb3.test.ejbthree1127.TestRemoteBusiness;
-import org.jboss.ejb3.test.ejbthree1127.TestRemoteHome;
-import org.jboss.test.JBossTestCase;
-
-/**
- * Tests that deployments succeed/fail based upon partially-denoted
- * Remote, Remote Business, and Remote Home interfaces ensuring
- * Spec-compliant defaults. 
- * 
- * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
- * @version $Revision: $
- */
-public class RemoteInterfaceDefinitionsUnitTestCase extends JBossTestCase
-{
-   // Constructor
-   public RemoteInterfaceDefinitionsUnitTestCase(String name)
-   {
-      super(name);
-   }
-
-   // Suite
-   public static Test suite() throws Exception
-   {
-      return getDeploySetup(RemoteInterfaceDefinitionsUnitTestCase.class, "ejbthree1127.jar");
-   }
-
-   // Tests 
-
-   /**
-    * Ensure that the Test EJB with 3.0 View defined only by @Remote to 
-    * Remote Business interface properly deploys
-    */
-   public void test30ViewRemoteBusinessInterfaceDefined() throws Exception
-   {
-      // Lookup EJB 
-      TestRemoteBusiness ejb = (TestRemoteBusiness) this.getInitialContext().lookup(
-            TestRemoteBusiness.JNDI_NAME);
-
-      // Invoke on it
-      assertEquals(ejb.test(), TestRemoteBusiness.RETURN_VALUE);
-   }
-   
-   /**
-    * Ensure that the Test EJB with 2.1 View defined only by @RemoteHome properly deploys
-    */
-   public void test21ViewRemoteInterfaceNotExplicitlyDefined() throws Exception
-   {
-      // Lookup EJB Home
-      TestRemoteHome home = (TestRemoteHome) this.getInitialContext().lookup(TestRemoteHome.JNDI_NAME);
-
-      // Obtain instance of EJB
-      TestRemote ejb = home.create();
-
-      // Invoke on it
-      assertEquals(ejb.test(), TestRemote.RETURN_VALUE);
-   }
-
-   /**
-    * Ensure that the Test EJB with 2.1 View defined only by a Remote interface 
-    * (no Remote Home) fails to deploy
-    */
-   public void test21ViewRemoteHomeInterfaceNotExplicitlyDefined() throws Exception
-   {
-      // Lookup EJB Home
-      try
-      {
-         this.getInitialContext().lookup(TestRemoteHome.JNDI_NAME);
-      }
-      catch (NameNotFoundException nnfe)
-      {
-         // Expected
-         return;
-      }
-
-      // If we've reached this point, the EJB that shouldn't have deployed, did
-      JBossTestCase.fail("Test EJB with 2.1 View defining no Remote Home should not successfully deploy.");
-   }
-}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list