[jboss-cvs] JBossAS SVN: r79361 - in projects/ejb3/trunk/proxy/src: main/java/org/jboss/ejb3/proxy/spi and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat Oct 11 20:50:37 EDT 2008
Author: ALRubinger
Date: 2008-10-11 20:50:37 -0400 (Sat, 11 Oct 2008)
New Revision: 79361
Added:
projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/spi/
projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/spi/common/
projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/spi/common/ErrorCodes.java
projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestLocalBusiness.java
projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestNoLocalBusinessInterfaceWithLocalBindingBean.java
projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestNoRemoteBusinessInterfaceWithRemoteBindingBean.java
projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/unit/BindingsWithNoAppropriateInterfaceUnitTestCase.java
Removed:
projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestBean.java
projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/unit/LocalBindingWithNoLocalInterfaceUnitTestCase.java
Modified:
projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestRemoteBusiness.java
Log:
[EJBTHREE-1130] Rework Unit Tests to cover both LocalBinding and RemoteBinding with no associated business interface, and check for proper error message on deployment
Added: projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/spi/common/ErrorCodes.java
===================================================================
--- projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/spi/common/ErrorCodes.java (rev 0)
+++ projects/ejb3/trunk/proxy/src/main/java/org/jboss/ejb3/proxy/spi/common/ErrorCodes.java 2008-10-12 00:50:37 UTC (rev 79361)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.proxy.spi.common;
+
+/**
+ * ErrorCodes
+ *
+ * Contract for Error Codes used by EJB3 Proxy
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface ErrorCodes
+{
+ /*
+ * Error Codes to be included in error messages for reference
+ */
+
+ public static final String ERROR_MESSAGE_CODE_EJBTHREE1130 = "EJBTHREE-1130";
+}
Deleted: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestBean.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestBean.java 2008-10-11 23:09:28 UTC (rev 79360)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestBean.java 2008-10-12 00:50:37 UTC (rev 79361)
@@ -1,44 +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.proxy.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
-{
-
-}
Added: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestLocalBusiness.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestLocalBusiness.java (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestLocalBusiness.java 2008-10-12 00:50:37 UTC (rev 79361)
@@ -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.proxy.ejbthree1130;
+
+/**
+ * A Test Local Business Interface
+ *
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public interface TestLocalBusiness
+{
+ String JNDI_NAME = "TestBeanOverriddenBinding/local";
+}
Added: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestNoLocalBusinessInterfaceWithLocalBindingBean.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestNoLocalBusinessInterfaceWithLocalBindingBean.java (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestNoLocalBusinessInterfaceWithLocalBindingBean.java 2008-10-12 00:50:37 UTC (rev 79361)
@@ -0,0 +1,46 @@
+/*
+ * 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.proxy.ejbthree1130;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
+import org.jboss.ejb3.annotation.LocalBinding;
+import org.jboss.ejb3.annotation.RemoteBinding;
+
+/**
+ * TestNoLocalBusinessInterfaceWithLocalBindingBean
+ *
+ * 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 TestNoLocalBusinessInterfaceWithLocalBindingBean implements TestRemoteBusiness
+{
+
+}
Added: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestNoRemoteBusinessInterfaceWithRemoteBindingBean.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestNoRemoteBusinessInterfaceWithRemoteBindingBean.java (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestNoRemoteBusinessInterfaceWithRemoteBindingBean.java 2008-10-12 00:50:37 UTC (rev 79361)
@@ -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.proxy.ejbthree1130;
+
+import javax.ejb.Local;
+import javax.ejb.Stateless;
+
+import org.jboss.ejb3.annotation.LocalBinding;
+import org.jboss.ejb3.annotation.RemoteBinding;
+
+/**
+ * A Test Bean implementing a Local Business Interface
+ * and defining a RemoteBinding
+ *
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Local(TestLocalBusiness.class)
+ at RemoteBinding(jndiBinding = TestRemoteBusiness.JNDI_NAME)
+ at LocalBinding(jndiBinding = TestRemoteBusiness.JNDI_NAME)
+public class TestNoRemoteBusinessInterfaceWithRemoteBindingBean implements TestLocalBusiness
+{
+
+}
Modified: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestRemoteBusiness.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestRemoteBusiness.java 2008-10-11 23:09:28 UTC (rev 79360)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/TestRemoteBusiness.java 2008-10-12 00:50:37 UTC (rev 79361)
@@ -29,5 +29,5 @@
*/
public interface TestRemoteBusiness
{
- String JNDI_NAME = "TestBean/remote";
+ String JNDI_NAME = "TestBeanOverriddenBinding/remote";
}
Added: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/unit/BindingsWithNoAppropriateInterfaceUnitTestCase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/unit/BindingsWithNoAppropriateInterfaceUnitTestCase.java (rev 0)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/unit/BindingsWithNoAppropriateInterfaceUnitTestCase.java 2008-10-12 00:50:37 UTC (rev 79361)
@@ -0,0 +1,167 @@
+/*
+ * 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.proxy.ejbthree1130.unit;
+
+import junit.framework.TestCase;
+
+import org.jboss.ejb3.common.registrar.spi.Ejb3RegistrarLocator;
+import org.jboss.ejb3.common.registrar.spi.NotBoundException;
+import org.jboss.ejb3.proxy.spi.common.ErrorCodes;
+import org.jboss.ejb3.test.proxy.common.SessionTestCaseBase;
+import org.jboss.ejb3.test.proxy.common.Utils;
+import org.jboss.ejb3.test.proxy.common.container.SessionContainer;
+import org.jboss.ejb3.test.proxy.ejbthree1130.TestNoLocalBusinessInterfaceWithLocalBindingBean;
+import org.jboss.ejb3.test.proxy.ejbthree1130.TestNoRemoteBusinessInterfaceWithRemoteBindingBean;
+import org.jboss.logging.Logger;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Tests that EJBs with a @LocalBinding/@RemoteBinding and
+ * no corresponding local/remote business interface
+ * fails deployment
+ *
+ * EJBTHREE-1130
+ *
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public class BindingsWithNoAppropriateInterfaceUnitTestCase extends SessionTestCaseBase
+{
+ // --------------------------------------------------------------------------------||
+ // Class Members ------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ private static final Logger log = Logger.getLogger(BindingsWithNoAppropriateInterfaceUnitTestCase.class);
+
+ // --------------------------------------------------------------------------------||
+ // Tests --------------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Ensure that EJB with no local business interface and
+ * @LocalBinding defined fails deployment
+ */
+ @Test
+ public void testLocalBindingWithNoLocalBusinessInterface() throws Throwable
+ {
+ // Run the test
+ this.performTest(TestNoLocalBusinessInterfaceWithLocalBindingBean.class);
+ }
+
+ /**
+ * Ensure that EJB with no remote business interface and
+ * @RemoteBinding defined fails deployment
+ */
+ @Test
+ public void testRemoteBindingWithNoRemoteBusinessInterface() throws Throwable
+ {
+ // Run the test
+ this.performTest(TestNoRemoteBusinessInterfaceWithRemoteBindingBean.class);
+ }
+
+ // --------------------------------------------------------------------------------||
+ // Internal Helper Methods --------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Attempts to install the EJB with the specified implementation class,
+ * and checks that deployment fails with "EJBTHREE-1130" noted in the error
+ * message
+ */
+ private void performTest(Class<?> ejbImplementationClass) throws Throwable
+ {
+ // Initialize
+ String errorCode = ErrorCodes.ERROR_MESSAGE_CODE_EJBTHREE1130;
+
+ // Create the EJB
+ SessionContainer ejb = Utils.createSlsb(ejbImplementationClass);
+ String containerName = ejb.getName();
+
+ // Attempt to install
+ try
+ {
+ // Start
+ ejb.start();
+ }
+ catch (Throwable t)
+ {
+ // Get the message
+ String errorMessage = t.getMessage();
+
+ // Ensure the message contains the proper error code
+ TestCase.assertTrue("The EJB " + containerName + " failed as expected, but the message did not contain \""
+ + errorCode + "\"; instead was: " + errorMessage, errorMessage.indexOf(errorCode) != -1);
+
+ // Log and return
+ log.info("Obtained error message in expected format: " + errorMessage);
+ return;
+
+ }
+ finally
+ {
+ // Cleanup
+ try
+ {
+ Ejb3RegistrarLocator.locateRegistrar().unbind(containerName);
+ }
+ catch (NotBoundException nbe)
+ {
+ // No one cares there, Bob
+ }
+ }
+
+ // Should have failed by now
+ TestCase.fail("EJB " + containerName + " should have failed deployment with a message containing \"" + errorCode
+ + "\"");
+ }
+
+ // --------------------------------------------------------------------------------||
+ // Lifecycle Methods --------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Perform setup before any tests
+ *
+ * @throws Throwable
+ */
+ @BeforeClass
+ public static void setUpBeforeClass() throws Throwable
+ {
+ // Create Bootstrap
+ SessionTestCaseBase.setUpBeforeClass();
+
+ // Deploy MC Beans
+ SessionTestCaseBase.bootstrap.deploy(SessionTestCaseBase.class);
+
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception
+ {
+ if (bootstrap != null)
+ bootstrap.shutdown();
+ bootstrap = null;
+ }
+
+}
\ No newline at end of file
Deleted: projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/unit/LocalBindingWithNoLocalInterfaceUnitTestCase.java
===================================================================
--- projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/unit/LocalBindingWithNoLocalInterfaceUnitTestCase.java 2008-10-11 23:09:28 UTC (rev 79360)
+++ projects/ejb3/trunk/proxy/src/test/java/org/jboss/ejb3/test/proxy/ejbthree1130/unit/LocalBindingWithNoLocalInterfaceUnitTestCase.java 2008-10-12 00:50:37 UTC (rev 79361)
@@ -1,126 +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.proxy.ejbthree1130.unit;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import junit.framework.TestCase;
-
-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 SessionTestCaseBase
-{
- // --------------------------------------------------------------------------------||
- // Class Members ------------------------------------------------------------------||
- // --------------------------------------------------------------------------------||
-
- /**
- * JNDI Context
- */
- private static Context context;
-
- // --------------------------------------------------------------------------------||
- // 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
- context.lookup(jndiName);
- }
- catch (NamingException ne)
- {
- // Expected
- return;
- }
-
- // Should not be reached
- 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