[jboss-cvs] JBossAS SVN: r68155 - trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1156/unit.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 11 17:55:00 EST 2007


Author: ALRubinger
Date: 2007-12-11 17:55:00 -0500 (Tue, 11 Dec 2007)
New Revision: 68155

Added:
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1156/unit/MultipleCreateMethodsInStatelessHomeShouldFailDeploymentUnitTestCase.java
Log:
[EJBTHREE-1156] Added Unit Tests

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1156/unit/MultipleCreateMethodsInStatelessHomeShouldFailDeploymentUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1156/unit/MultipleCreateMethodsInStatelessHomeShouldFailDeploymentUnitTestCase.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1156/unit/MultipleCreateMethodsInStatelessHomeShouldFailDeploymentUnitTestCase.java	2007-12-11 22:55:00 UTC (rev 68155)
@@ -0,0 +1,80 @@
+/*
+ * 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.ejbthree1156.unit;
+
+import javax.naming.NamingException;
+import javax.rmi.PortableRemoteObject;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree1156.TestHome;
+import org.jboss.ejb3.test.ejbthree1156.TestRemote;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * A Test to ensure that a Stateless EJB with a Home that declares more than
+ * one "create<METHOD>" method, violating EJB 3.0 Core 
+ * Specification 4.6.8 Bullet 4, fails deployment
+ * 
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @version $Revision: $
+ */
+public class MultipleCreateMethodsInStatelessHomeShouldFailDeploymentUnitTestCase extends JBossTestCase
+{
+   // Constructor
+
+   public MultipleCreateMethodsInStatelessHomeShouldFailDeploymentUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   // Suite
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(MultipleCreateMethodsInStatelessHomeShouldFailDeploymentUnitTestCase.class,
+            "ejbthree1156.jar");
+   }
+
+   // Tests
+
+   /**
+    * Tests that a Stateless EJB with more than one "create<METHOD>" method
+    * in its 2.1 Home fails deployment
+    */
+   public void testRemoteInterface1FromHomeCreate() throws Exception
+   {
+      try
+      {
+         // Lookup Home
+         PortableRemoteObject.narrow(this.getInitialContext().lookup(TestHome.JNDI_NAME), TestHome.class);
+      }
+      catch (NamingException ne)
+      {
+         // Expected
+         return;
+      }
+
+      JBossTestCase.fail("Test Bean should fail deployment");
+
+   }
+}


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




More information about the jboss-cvs-commits mailing list