[jboss-cvs] JBossAS SVN: r79359 - in projects/ejb3/trunk: proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/unit and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Oct 11 19:07:00 EDT 2008


Author: ALRubinger
Date: 2008-10-11 19:07:00 -0400 (Sat, 11 Oct 2008)
New Revision: 79359

Added:
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/
Removed:
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/ejbthree1130/
Modified:
   projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/unit/LocalBindingWithNoLocalInterfaceUnitTestCase.java
Log:
[EJBTHREE-1130] Move Unit Test to proxy from Integration TestSuite

Copied: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130 (from rev 79355, projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/ejbthree1130)

Modified: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/unit/LocalBindingWithNoLocalInterfaceUnitTestCase.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/ejbthree1130/unit/LocalBindingWithNoLocalInterfaceUnitTestCase.java	2008-10-10 22:51:20 UTC (rev 79355)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/unit/LocalBindingWithNoLocalInterfaceUnitTestCase.java	2008-10-11 23:07:00 UTC (rev 79359)
@@ -19,48 +19,62 @@
  * 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;
+package org.jboss.ejb3.test.proxy.ejbthree1130.unit;
 
+import javax.naming.Context;
+import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
-import junit.framework.Test;
+import junit.framework.TestCase;
 
-import org.jboss.ejb3.test.ejbthree1130.TestRemoteBusiness;
-import org.jboss.test.JBossTestCase;
+import org.jboss.ejb3.common.registrar.spi.Ejb3RegistrarLocator;
+import org.jboss.ejb3.test.proxy.common.SessionTestCaseBase;
+import org.jboss.ejb3.test.proxy.common.Utils;
+import org.jboss.ejb3.test.proxy.common.container.StatefulContainer;
+import org.jboss.ejb3.test.proxy.ejbthree1130.TestBean;
+import org.jboss.ejb3.test.proxy.ejbthree1130.TestRemoteBusiness;
+import org.jboss.ejb3.test.proxy.session.unit.ProxyStatefulSessionTestCase;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
 
 /**
  * Tests that EJBs with a @LocalBinding and no local 
  * business interface fails deployment
  * 
+ * EJBTHREE-1130
+ * 
  * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
  * @version $Revision: $
  */
-public class LocalBindingWithNoLocalInterfaceUnitTestCase extends JBossTestCase
+public class LocalBindingWithNoLocalInterfaceUnitTestCase extends SessionTestCaseBase
 {
-   // Constructor
-   public LocalBindingWithNoLocalInterfaceUnitTestCase(String name)
-   {
-      super(name);
-   }
+   // --------------------------------------------------------------------------------||
+   // Class Members ------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
 
-   // Suite
-   public static Test suite() throws Exception
-   {
-      return getDeploySetup(LocalBindingWithNoLocalInterfaceUnitTestCase.class, "ejbthree1130.jar");
-   }
+   /**
+    * JNDI Context
+    */
+   private static Context context;
 
-   // Tests 
-
+   // --------------------------------------------------------------------------------||
+   // Tests --------------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
    /**
     * Ensure that EJB with Remote Business interface and 
     * @LocalBinding defined fails deployment
     */
+   @Test
    public void testLocalBindingWithNoLocalInterface() throws Exception
    {
+      // Initialize
+      String jndiName = TestRemoteBusiness.JNDI_NAME;
+
       try
       {
          // Lookup EJB 
-         this.getInitialContext().lookup(TestRemoteBusiness.JNDI_NAME);
+         context.lookup(jndiName);
       }
       catch (NamingException ne)
       {
@@ -69,7 +83,44 @@
       }
 
       // Should not be reached
-      JBossTestCase.fail("EJB should fail deployment and not be available at " + TestRemoteBusiness.JNDI_NAME);
+      TestCase.fail("EJB should fail deployment and not be available at " + jndiName);
    }
 
+   // --------------------------------------------------------------------------------||
+   // Lifecycle Methods --------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Perform setup before any tests
+    * 
+    * @throws Throwable
+    */
+   @BeforeClass
+   public static void setUpBeforeClass() throws Throwable
+   {
+      // Create Bootstrap 
+      SessionTestCaseBase.setUpBeforeClass();
+
+      // Deploy MC Beans
+      ProxyStatefulSessionTestCase.bootstrap.deploy(SessionTestCaseBase.class);
+
+      // Create a SLSB
+      StatefulContainer container = Utils.createSfsb(TestBean.class);
+
+      // Install
+      Ejb3RegistrarLocator.locateRegistrar().bind(container.getName(), container);
+
+      // Create JNDI Context
+      context = new InitialContext(); // Props from CP jndi.properties
+
+   }
+
+   @AfterClass
+   public static void tearDownAfterClass() throws Exception
+   {
+      if (bootstrap != null)
+         bootstrap.shutdown();
+      bootstrap = null;
+   }
+
 }
\ No newline at end of file




More information about the jboss-cvs-commits mailing list