[jbossws-commits] JBossWS SVN: r1623 - in trunk/src: main/java/org/jboss/ws/integration/jboss50 test/ant test/java/org/jboss/test/ws/jaxws/eardeployment test/resources/jaxws/eardeployment/META-INF test/resources/jaxws/eardeployment/WEB-INF

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Mon Dec 11 08:03:44 EST 2006


Author: thomas.diesler at jboss.com
Date: 2006-12-11 08:03:37 -0500 (Mon, 11 Dec 2006)
New Revision: 1623

Added:
   trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java
   trunk/src/test/resources/jaxws/eardeployment/META-INF/jboss-app.xml
   trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/
Removed:
   trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarEjb3TestCase.java
   trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarJseTestCase.java
   trunk/src/test/resources/jaxws/eardeployment/META-INF/wsdl/
Modified:
   trunk/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java
   trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java
   trunk/src/test/ant/build-jars-jaxws.xml
Log:
Get context-root from jboss-app.xml

Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java	2006-12-11 11:06:03 UTC (rev 1622)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java	2006-12-11 13:03:37 UTC (rev 1623)
@@ -95,11 +95,9 @@
       }
       else
       {
-         Set<? extends WebMetaData> allMetaData = unit.getAllMetaData(WebMetaData.class);
-         if (allMetaData.size() > 0)
+         if (unit.getAllMetaData(WebMetaData.class).size() > 0)
          {
-            metaData = allMetaData.iterator().next();
-            metaData = WebMetaDataAdaptor.buildUnifiedWebMetaData((WebMetaData)metaData);
+            metaData = WebMetaDataAdaptor.buildUnifiedWebMetaData(unit);
          }
       }
       return metaData;

Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java	2006-12-11 11:06:03 UTC (rev 1622)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/WebMetaDataAdaptor.java	2006-12-11 13:03:37 UTC (rev 1623)
@@ -28,7 +28,13 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployment.J2eeApplicationMetaData;
+import org.jboss.deployment.J2eeModuleMetaData;
+import org.jboss.metadata.ApplicationMetaData;
 import org.jboss.metadata.WebMetaData;
 import org.jboss.metadata.WebSecurityMetaData;
 import org.jboss.metadata.WebSecurityMetaData.WebResourceCollection;
@@ -47,8 +53,14 @@
  */
 public class WebMetaDataAdaptor
 {
-   public static UnifiedWebMetaData buildUnifiedWebMetaData(WebMetaData wmd)
+   public static UnifiedWebMetaData buildUnifiedWebMetaData(DeploymentUnit unit)
    {
+      Set<? extends WebMetaData> wmdSet = unit.getAllMetaData(WebMetaData.class);
+      if (wmdSet.size() < 1)
+         throw new IllegalStateException("Deployment unit does not contain web meta data");
+      
+      WebMetaData wmd = wmdSet.iterator().next();
+      
       UnifiedWebMetaData umd = new UnifiedWebMetaData();
       umd.setContextRoot(wmd.getContextRoot());
       umd.setServletMappings(getServletMappings(wmd));

Modified: trunk/src/test/ant/build-jars-jaxws.xml
===================================================================
--- trunk/src/test/ant/build-jars-jaxws.xml	2006-12-11 11:06:03 UTC (rev 1622)
+++ trunk/src/test/ant/build-jars-jaxws.xml	2006-12-11 13:03:37 UTC (rev 1623)
@@ -53,6 +53,15 @@
         <include name="org/jboss/test/ws/jaxws/eardeployment/EJB3Bean.class"/>
       </fileset>
     </jar>
+    <jar jarfile="${build.tests.dir}/libs/jaxws-eardeployment.ear">
+      <fileset dir="${build.tests.dir}/libs">
+        <include name="jaxws-eardeployment.jar"/>
+        <include name="jaxws-eardeployment.war"/>
+      </fileset>
+      <metainf dir="${build.tests.dir}/resources/jaxws/eardeployment/META-INF">
+        <include name="jboss-app.xml"/>
+      </metainf>
+    </jar>
     
     <!-- jaxws-endpoint-servlet -->
     <war warfile="${build.tests.dir}/libs/jaxws-endpoint-servlet.war" webxml="${build.tests.dir}/resources/jaxws/endpoint/WEB-INF/web.xml">

Deleted: trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarEjb3TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarEjb3TestCase.java	2006-12-11 11:06:03 UTC (rev 1622)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarEjb3TestCase.java	2006-12-11 13:03:37 UTC (rev 1623)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * 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.ws.jaxws.eardeployment;
-
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.Test;
-
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.JBossWSTestSetup;
-
-/**
- * Test ear deployment
- *
- * @author Thomas.Diesler at jboss.org
- * @since 08-Dec-2006
- */
-public class EarEjb3TestCase extends JBossWSTest
-{
-   public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/earejb3/EJB3Bean";
-
-   public static Test suite()
-   {
-      return JBossWSTestSetup.newTestSetup(EarEjb3TestCase.class, "jaxws-eardeployment.jar");
-   }
-
-   public void testWebService() throws Exception
-   {
-      URL wsdlURL = new URL (TARGET_ENDPOINT_ADDRESS + "?wsdl");
-      QName serviceName = new QName("http://eardeployment.jaxws.ws.test.jboss.org/", "TestEndpointService");
-      TestEndpointService service = new TestEndpointService(wsdlURL, serviceName);
-      TestEndpoint port = service.getTestEndpointPort();
-      
-      String helloWorld = "Hello world!";
-      String retObj = port.echo(helloWorld);
-      assertEquals(helloWorld, retObj);
-   }
-}

Deleted: trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarJseTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarJseTestCase.java	2006-12-11 11:06:03 UTC (rev 1622)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarJseTestCase.java	2006-12-11 13:03:37 UTC (rev 1623)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * 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.ws.jaxws.eardeployment;
-
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.Test;
-
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.JBossWSTestSetup;
-
-/**
- * Test ear deployment
- *
- * @author Thomas.Diesler at jboss.org
- * @since 29-Apr-2005
- */
-public class EarJseTestCase extends JBossWSTest
-{
-   public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-eardeployment/JSEBean";
-
-   public static Test suite()
-   {
-      return JBossWSTestSetup.newTestSetup(EarJseTestCase.class, "jaxws-eardeployment.war");
-   }
-
-   public void testWebService() throws Exception
-   {
-      URL wsdlURL = new URL (TARGET_ENDPOINT_ADDRESS + "?wsdl");
-      QName serviceName = new QName("http://eardeployment.jaxws.ws.test.jboss.org/", "TestEndpointService");
-      TestEndpointService service = new TestEndpointService(wsdlURL, serviceName);
-      TestEndpoint port = service.getTestEndpointPort();
-      
-      String helloWorld = "Hello world!";
-      String retObj = port.echo(helloWorld);
-      assertEquals(helloWorld, retObj);
-   }
-}

Copied: trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java (from rev 1622, trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarEjb3TestCase.java)
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarEjb3TestCase.java	2006-12-11 11:06:03 UTC (rev 1622)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java	2006-12-11 13:03:37 UTC (rev 1623)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * 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.ws.jaxws.eardeployment;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+
+/**
+ * Test ear deployment
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 08-Dec-2006
+ */
+public class EarTestCase extends JBossWSTest
+{
+   public static Test suite()
+   {
+      return JBossWSTestSetup.newTestSetup(EarTestCase.class, "jaxws-eardeployment.ear");
+   }
+
+   public void testEJB3Endpoint() throws Exception
+   {
+      URL wsdlURL = new URL ("http://" + getServerHost() + ":8080/earejb3/EJB3Bean?wsdl");
+      QName serviceName = new QName("http://eardeployment.jaxws.ws.test.jboss.org/", "TestEndpointService");
+      TestEndpointService service = new TestEndpointService(wsdlURL, serviceName);
+      TestEndpoint port = service.getTestEndpointPort();
+      
+      String helloWorld = "Hello world!";
+      String retObj = port.echo(helloWorld);
+      assertEquals(helloWorld, retObj);
+   }
+
+   public void testJSEEndpoint() throws Exception
+   {
+      URL wsdlURL = new URL ("http://" + getServerHost() + ":8080/earjse/JSEBean?wsdl");
+      QName serviceName = new QName("http://eardeployment.jaxws.ws.test.jboss.org/", "TestEndpointService");
+      TestEndpointService service = new TestEndpointService(wsdlURL, serviceName);
+      TestEndpoint port = service.getTestEndpointPort();
+      
+      String helloWorld = "Hello world!";
+      String retObj = port.echo(helloWorld);
+      assertEquals(helloWorld, retObj);
+   }
+}

Added: trunk/src/test/resources/jaxws/eardeployment/META-INF/jboss-app.xml
===================================================================
--- trunk/src/test/resources/jaxws/eardeployment/META-INF/jboss-app.xml	2006-12-11 11:06:03 UTC (rev 1622)
+++ trunk/src/test/resources/jaxws/eardeployment/META-INF/jboss-app.xml	2006-12-11 13:03:37 UTC (rev 1623)
@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+
+<!DOCTYPE jboss-app
+    PUBLIC "-//JBoss//DTD Java EE Application 5.0///EN"
+    "http://www.jboss.org/j2ee/dtd/jboss-app_5_0.dtd">
+
+<jboss-app>
+  <module>
+    <web>
+      <web-uri>jaxws-eardeployment.war</web-uri>
+      <context-root>/earjse</context-root>
+    </web>
+  </module>
+</jboss-app>


Property changes on: trunk/src/test/resources/jaxws/eardeployment/META-INF/jboss-app.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Copied: trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl (from rev 1622, trunk/src/test/resources/jaxws/eardeployment/META-INF/wsdl)




More information about the jbossws-commits mailing list