[jboss-cvs] JBossAS SVN: r79479 - in projects/ejb3/trunk: core/src/main/java/org/jboss/ejb3/common and 4 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Oct 14 13:52:15 EDT 2008


Author: ALRubinger
Date: 2008-10-14 13:52:15 -0400 (Tue, 14 Oct 2008)
New Revision: 79479

Added:
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/common/
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/common/spi/
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/common/spi/ErrorCodes.java
Modified:
   projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/factory/ProxyFactoryHelper.java
   projects/ejb3/trunk/testsuite/pom.xml
   projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/ejbthree751/unit/FailLocalRemoteSameInterfaceUnitTestCase.java
Log:
[EJBTHREE-1241][EJBTHREE-751] Update the check for proper error message to reference, define a contract to make the test more stable

Added: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/common/spi/ErrorCodes.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/common/spi/ErrorCodes.java	                        (rev 0)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/common/spi/ErrorCodes.java	2008-10-14 17:52:15 UTC (rev 79479)
@@ -0,0 +1,38 @@
+/*
+ * 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.common.spi;
+
+/**
+ * ErrorCodes
+ * 
+ * Defines a contract for ErrorCodes to use within the application
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface ErrorCodes
+{
+   /*
+    * Error Codes
+    */
+   String ERROR_CODE_EJBTHREE751 = "EJBTHREE-751";
+}

Modified: projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/factory/ProxyFactoryHelper.java
===================================================================
--- projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/factory/ProxyFactoryHelper.java	2008-10-14 17:48:48 UTC (rev 79478)
+++ projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/proxy/factory/ProxyFactoryHelper.java	2008-10-14 17:52:15 UTC (rev 79479)
@@ -54,6 +54,7 @@
 import org.jboss.ejb3.annotation.impl.LocalImpl;
 import org.jboss.ejb3.annotation.impl.RemoteImpl;
 import org.jboss.ejb3.common.lang.ClassHelper;
+import org.jboss.ejb3.common.spi.ErrorCodes;
 import org.jboss.ejb3.session.SessionContainer;
 import org.jboss.ejb3.stateless.StatelessContainer;
 import org.jboss.logging.Logger;
@@ -226,9 +227,12 @@
             {
                if (localInterface.equals(remoteInterface))
                {
+                  /*
+                   * The error code in this message is checked by the ejbthree751 integration test
+                   */
                   throw new RuntimeException("@Remote and @Local may not both be specified on the same interface \""
                         + remoteInterface.toString() + "\" for EJB \"" + container.getEjbName()
-                        + "\" per EJB3 Spec 4.6.6, Bullet 5.4");
+                        + "\" per EJB3 Spec 4.6.6, Bullet 5.4 [" + ErrorCodes.ERROR_CODE_EJBTHREE751 + "]");
                }
             }
          }

Modified: projects/ejb3/trunk/testsuite/pom.xml
===================================================================
--- projects/ejb3/trunk/testsuite/pom.xml	2008-10-14 17:48:48 UTC (rev 79478)
+++ projects/ejb3/trunk/testsuite/pom.xml	2008-10-14 17:52:15 UTC (rev 79479)
@@ -208,7 +208,7 @@
     <dependency>
       <groupId>org.jboss.ejb3</groupId>
       <artifactId>jboss-ejb3-core</artifactId>
-      <version>1.0.0-Beta3</version>
+      <version>1.0.0-SNAPSHOT</version>
       <scope>test</scope>
     </dependency>
     

Modified: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/ejbthree751/unit/FailLocalRemoteSameInterfaceUnitTestCase.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/ejbthree751/unit/FailLocalRemoteSameInterfaceUnitTestCase.java	2008-10-14 17:48:48 UTC (rev 79478)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/ejbthree751/unit/FailLocalRemoteSameInterfaceUnitTestCase.java	2008-10-14 17:52:15 UTC (rev 79479)
@@ -23,6 +23,7 @@
 
 import junit.framework.Test;
 
+import org.jboss.ejb3.common.spi.ErrorCodes;
 import org.jboss.test.JBossTestCase;
 
 /**
@@ -63,8 +64,11 @@
          for(Throwable t = e;t != null; t = t.getCause())
          {
             // See ProxyFactoryHelper.getLocalInterfaces
-            if(t.getMessage().contains("EJB3 Spec 4.6.7, Bullet 5.4"))
+            String message = t.getMessage();
+            if (message.contains(ErrorCodes.ERROR_CODE_EJBTHREE751))
+            {
                return;
+            }
          }
          e.printStackTrace();
          fail("Exception did not contain expected message");




More information about the jboss-cvs-commits mailing list