[jboss-cvs] JBossAS SVN: r110517 - in branches/JBPAPP_5_1: testsuite/imports/sections and 6 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Feb 2 11:56:27 EST 2011


Author: csams
Date: 2011-02-02 11:56:27 -0500 (Wed, 02 Feb 2011)
New Revision: 110517

Added:
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jboss51xsd/
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jboss51xsd/Echo.java
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jboss51xsd/EchoBean.java
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jboss51xsd/unit/
   branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jboss51xsd/unit/EJB3DeploymentWithJBoss51xsdTestCase.java
   branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jboss51xsd/
   branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jboss51xsd/META-INF/
   branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jboss51xsd/META-INF/jboss.xml
Modified:
   branches/JBPAPP_5_1/server/src/etc/deployers/metadata-deployer-jboss-beans.xml
   branches/JBPAPP_5_1/testsuite/imports/sections/ejb3.xml
Log:
[JBPAPP-5407] metadata-deployer-jboss-beans.xml was missing mapping for jboss_5_1 xsd. This is a backport of JBAS 7231.

Modified: branches/JBPAPP_5_1/server/src/etc/deployers/metadata-deployer-jboss-beans.xml
===================================================================
--- branches/JBPAPP_5_1/server/src/etc/deployers/metadata-deployer-jboss-beans.xml	2011-02-02 05:43:10 UTC (rev 110516)
+++ branches/JBPAPP_5_1/server/src/etc/deployers/metadata-deployer-jboss-beans.xml	2011-02-02 16:56:27 UTC (rev 110517)
@@ -261,6 +261,10 @@
                <key>jboss_5_0.xsd</key>
                <value>org.jboss.metadata.ejb.jboss.JBoss50MetaData</value>
             </entry>
+            <entry>
+               <key>jboss_5_1.xsd</key>
+               <value>org.jboss.metadata.ejb.jboss.JBoss51MetaData</value>
+            </entry>
             
             <!-- WebMetaData -->
             <entry>

Modified: branches/JBPAPP_5_1/testsuite/imports/sections/ejb3.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/imports/sections/ejb3.xml	2011-02-02 05:43:10 UTC (rev 110516)
+++ branches/JBPAPP_5_1/testsuite/imports/sections/ejb3.xml	2011-02-02 16:56:27 UTC (rev 110517)
@@ -200,14 +200,25 @@
 	      </jar>
 	</target>    
    
+   <target name="jboss51xsd" depends="compile">
+	   <mkdir dir="${build.lib}" />
+	   
+	   <jar destfile="${build.lib}/jboss51xsd.jar">
+		   <fileset dir="${build.classes}">
+			   <include name="org/jboss/test/ejb3/jboss51xsd/**" />
+		   </fileset>
+		   <fileset dir="${source.resources}/ejb3/jboss51xsd" includes="**">
+		   </fileset>
+	   </jar>
+   </target>
+
    <target name="_jars-ejb3" depends="ejb3-servlet,jbas6161,jbas6239,ejbthree1597,jbas5713,
-      ejb3iiop,
-      ejb3-webservice,
-      jbpapp2260,
-      jbpapp2473,
-      jbpapp3026,
-		jbpapp4681
-      ">
+			ejb3iiop,
+			ejb3-webservice,
+			jbpapp2260,
+			jbpapp2473,
+			jbpapp3026,
+			jboss51xsd">
       <mkdir dir="${build.lib}" />
 
       <!-- A jar with a simple ejb3 session -->

Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jboss51xsd/Echo.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jboss51xsd/Echo.java	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jboss51xsd/Echo.java	2011-02-02 16:56:27 UTC (rev 110517)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt 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.test.ejb3.jboss51xsd;
+
+/**
+ * Echo
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public interface Echo
+{
+   
+   /**
+    * Just return back the passed <code>msg</code>
+    * @param msg
+    * @return
+    */
+   String echo(String msg);
+}

Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jboss51xsd/EchoBean.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jboss51xsd/EchoBean.java	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jboss51xsd/EchoBean.java	2011-02-02 16:56:27 UTC (rev 110517)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt 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.test.ejb3.jboss51xsd;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
+import org.jboss.test.ejb3.jboss51xsd.unit.EJB3DeploymentWithJBoss51xsdTestCase;
+
+/**
+ * EchoBean
+ * 
+ * Used in testing of JBAS-7231 https://jira.jboss.org/jira/browse/JBAS-7231
+ * 
+ *  @see EJB3DeploymentWithJBoss51xsdTestCase
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+ at Stateless
+ at Remote (Echo.class)
+public class EchoBean implements Echo
+{
+
+   /**
+    * @see Echo#echo(String)
+    */
+   public String echo(String msg)
+   {
+      return msg;
+   }
+
+}

Added: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jboss51xsd/unit/EJB3DeploymentWithJBoss51xsdTestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jboss51xsd/unit/EJB3DeploymentWithJBoss51xsdTestCase.java	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jboss51xsd/unit/EJB3DeploymentWithJBoss51xsdTestCase.java	2011-02-02 16:56:27 UTC (rev 110517)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt 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.test.ejb3.jboss51xsd.unit;
+
+import junit.framework.Test;
+
+import org.jboss.logging.Logger;
+import org.jboss.test.JBossTestCase;
+import org.jboss.test.ejb3.jboss51xsd.Echo;
+
+/**
+ * EJB3DeploymentWithJBoss51xsdTestCase
+ * 
+ * Tests the bug fix for https://jira.jboss.org/jira/browse/JBAS-7231
+ * 
+ * The bug in JBAS-7231 relates to missing of jboss_5_1 xsd from the 
+ * metadata-deployer-jboss-beans.xml. As a result, the deployment of 
+ * the EJB3 deployment used to fallback on the dtd version of jboss.xml
+ * which not as robust as the 5_1 xsd.
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public class EJB3DeploymentWithJBoss51xsdTestCase extends JBossTestCase
+{
+
+   /**
+    * Logger
+    */
+   private static Logger logger = Logger.getLogger(EJB3DeploymentWithJBoss51xsdTestCase.class);
+   
+   /**
+    * Constructor
+    * @param name
+    */
+   public EJB3DeploymentWithJBoss51xsdTestCase(String name)
+   {
+      super(name);
+   }
+
+   
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(EJB3DeploymentWithJBoss51xsdTestCase.class, "jboss51xsd.jar");
+   }
+   
+   public void testDeployment() throws Exception
+   {
+      // make sure that there were no deployment errors
+      // Yes, it's a weird method name for testing that the deployment
+      // did not throw errors during deployment :)
+      serverFound();
+      
+      // Now just do a simple test of the EJBs - lookup and invoke a method
+      Echo bean = (Echo) this.getInitialContext().lookup("JBAS-7231-BeanJNDINameFromJBossXml");
+      String msg = "JBAS-7231 is now fixed!!";
+      String returnedMessage = bean.echo(msg);
+      
+      assertEquals("Bean returned unexpected value", msg, returnedMessage);
+      
+   }
+}

Added: branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jboss51xsd/META-INF/jboss.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jboss51xsd/META-INF/jboss.xml	                        (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/resources/ejb3/jboss51xsd/META-INF/jboss.xml	2011-02-02 16:56:27 UTC (rev 110517)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss xmlns="http://www.jboss.com/xml/ns/javaee"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee
+       http://www.jboss.org/j2ee/schema/jboss_5_1.xsd"
+             version="5.1">
+	
+	<enterprise-beans>
+		<session>
+			<ejb-name>EchoBean</ejb-name>
+			<jndi-name>JBAS-7231-BeanJNDINameFromJBossXml</jndi-name>
+		</session>
+	</enterprise-beans>
+	
+</jboss>	
\ No newline at end of file



More information about the jboss-cvs-commits mailing list