[jbossws-commits] JBossWS SVN: r6281 - in stack/native/trunk: src/test/java/org/jboss/test/ws/jaxws and 4 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Tue Apr 8 11:30:42 EDT 2008


Author: thomas.diesler at jboss.com
Date: 2008-04-08 11:30:42 -0400 (Tue, 08 Apr 2008)
New Revision: 6281

Added:
   stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/
   stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java
   stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestClient.java
   stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestEndpoint.java
   stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestEndpointImpl.java
   stack/native/trunk/src/test/resources/jaxws/jbws1666/
   stack/native/trunk/src/test/resources/jaxws/jbws1666/WEB-INF/
   stack/native/trunk/src/test/resources/jaxws/jbws1666/WEB-INF/web.xml
Modified:
   stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
Log:
Move jbws1666 to native

Modified: stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/trunk/ant-import-tests/build-jars-jaxws.xml	2008-04-08 15:25:49 UTC (rev 6280)
+++ stack/native/trunk/ant-import-tests/build-jars-jaxws.xml	2008-04-08 15:30:42 UTC (rev 6281)
@@ -162,6 +162,13 @@
       </classes>
     </war>
     
+    <!-- jaxws-jbws1666 -->
+    <war destfile="${tests.output.dir}/libs/jaxws-jbws1666.war" webxml="${tests.output.dir}/resources/jaxws/jbws1666/WEB-INF/web.xml">
+      <classes dir="${tests.output.dir}/classes">
+        <include name="org/jboss/test/ws/jaxws/jbws1666/TestEndpointImpl.class"/>
+      </classes>
+    </war>
+    
   	<!-- jaxws-jbws1814 -->
     <war warfile="${tests.output.dir}/libs/jaxws-jbws1814.war" webxml="${tests.output.dir}/resources/jaxws/jbws1814/WEB-INF/web.xml">
       <classes dir="${tests.output.dir}/classes">

Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java	                        (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java	2008-04-08 15:30:42 UTC (rev 6281)
@@ -0,0 +1,98 @@
+/*
+ * 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.jbws1666;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.InputStreamReader;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+import org.jboss.wsf.common.IOUtils;
+
+/**
+ * [JBWS-1666] Simplify jbosws jar dependencies
+ * 
+ * http://jira.jboss.org/jira/browse/JBWS-1666
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 14-Jun-2007
+ */
+public class JBWS1666TestCase extends JBossWSTest
+{
+   public static Test suite()
+   {
+      return new JBossWSTestSetup(JBWS1666TestCase.class, "jaxws-jbws1666.war");
+   }
+
+   public void testPortAccess() throws Exception
+   {
+      String resStr = TestClient.testPortAccess(getServerHost());
+      assertEquals(TestClient.REQ_STR, resStr);
+   }
+
+   public void testClientAccess() throws Exception
+   {
+      File javaFile = new File (System.getProperty("java.home") + "/bin/java");
+      String javaCmd = javaFile.exists() ? javaFile.getCanonicalPath() : "java";
+      
+      String jbh = System.getProperty("jboss.home");
+      String jbc = jbh + "/client";
+      String jbl = jbh + "/lib";
+      
+      // Setup the classpath - do not modify this lightheartedly. 
+      // Maybe you should extend the Class-Path in the MANIFEST instead.
+      StringBuffer cp = new StringBuffer("./classes");
+      cp.append(":" + jbc + "/jbossws-client.jar");
+      if (isTargetJBoss50())
+      {
+         cp.append(":" + jbc + "/jboss-common-core.jar");
+         cp.append(":" + jbc + "/jboss-logging-spi.jar");
+      }
+      else
+      {
+         cp.append(":" + jbc + "/jboss-common-client.jar");
+      }
+
+      Runtime rt = Runtime.getRuntime();
+
+      String command = javaCmd + " -Djava.endorsed.dirs=" + jbl + "/endorsed -cp " + cp + " " + TestClient.class.getName() + " " + getServerHost();
+      Process proc = rt.exec(command);
+      int status = proc.waitFor();
+      if (status == 0)
+      {
+         BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
+         String resStr = br.readLine();
+         assertEquals(TestClient.REQ_STR, resStr);
+      }
+      else
+      {
+         ByteArrayOutputStream baos = new ByteArrayOutputStream();
+         IOUtils.copyStream(baos, proc.getErrorStream());
+         String errStr = new String(baos.toByteArray());
+         fail(errStr);
+      }
+   }
+}


Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestClient.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestClient.java	                        (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestClient.java	2008-04-08 15:30:42 UTC (rev 6281)
@@ -0,0 +1,51 @@
+/*
+ * 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.jbws1666;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+public class TestClient
+{
+   public static final String REQ_STR = "Hello World!";
+
+   public static String testPortAccess(String serverHost) throws Exception
+   {
+      URL wsdlURL = new URL("http://" + serverHost + ":8080/jaxws-jbws1666?wsdl");
+
+      QName serviceName = new QName("http://org.jboss.ws/jbws1666", "TestEndpointImplService");
+      Service service = Service.create(wsdlURL, serviceName);
+      TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
+
+      String resStr = port.echo(REQ_STR);
+      return resStr;
+   }
+
+   public static void main(String[] args) throws Exception
+   {
+      String serverHost = args[0];
+      String resStr = testPortAccess(serverHost);
+      System.out.println(resStr);
+   }
+}


Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestClient.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestEndpoint.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestEndpoint.java	                        (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestEndpoint.java	2008-04-08 15:30:42 UTC (rev 6281)
@@ -0,0 +1,32 @@
+/*
+ * 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.jbws1666;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+ at WebService(name = "TestEndpoint", targetNamespace = "http://org.jboss.ws/jbws1666")
+ at SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface TestEndpoint
+{
+   String echo(String input);
+}


Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestEndpoint.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestEndpointImpl.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestEndpointImpl.java	                        (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestEndpointImpl.java	2008-04-08 15:30:42 UTC (rev 6281)
@@ -0,0 +1,37 @@
+/*
+  * 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.jbws1666;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+ at WebService(name = "TestEndpoint", targetNamespace = "http://org.jboss.ws/jbws1666")
+ at SOAPBinding(style = SOAPBinding.Style.RPC)
+public class TestEndpointImpl
+{
+   @WebMethod
+   public String echo(String input)
+   {
+      return input;
+   }
+}


Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestEndpointImpl.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: stack/native/trunk/src/test/resources/jaxws/jbws1666/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/jbws1666/WEB-INF/web.xml	                        (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/jbws1666/WEB-INF/web.xml	2008-04-08 15:30:42 UTC (rev 6281)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+  
+  <servlet>
+    <servlet-name>TestEndpoint</servlet-name>
+    <servlet-class>org.jboss.test.ws.jaxws.jbws1666.TestEndpointImpl</servlet-class>
+  </servlet>
+  
+  <servlet-mapping>
+    <servlet-name>TestEndpoint</servlet-name>
+    <url-pattern>/*</url-pattern>
+  </servlet-mapping>
+</web-app>
\ No newline at end of file


Property changes on: stack/native/trunk/src/test/resources/jaxws/jbws1666/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF




More information about the jbossws-commits mailing list