[jbossws-commits] JBossWS SVN: r5244 - in legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests: src/java/org/jboss/test/ws/tools and 3 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Mon Dec 10 07:44:21 EST 2007


Author: heiko.braun at jboss.com
Date: 2007-12-10 07:44:21 -0500 (Mon, 10 Dec 2007)
New Revision: 5244

Added:
   legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/java/org/jboss/test/ws/tools/scripts/
   legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java
   legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/
   legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/PhoneBook.wsdl
   legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/PhoneBook_PortType.java
   legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/jaxrpc-mapping.xml
   legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/wstools-config.xml
Modified:
   legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/build.xml
Log:
Fix JBPAPP-354

Modified: legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/build.xml
===================================================================
--- legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/build.xml	2007-12-10 12:40:30 UTC (rev 5243)
+++ legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/build.xml	2007-12-10 12:44:21 UTC (rev 5244)
@@ -498,7 +498,9 @@
     <mkdir dir="${tests.output.dir}/reports"/>
     <junit printsummary="yes" showoutput="yes" dir="${tests.output.dir}" haltonfailure="${haltonfailure}">
       <jvmarg value="-Djava.security.manager"/>
+      <sysproperty key="jdk.home" value="${env.JAVA_HOME}"/>
       <sysproperty key="build.testlog" value="${tests.output.dir}/log"/>
+      <sysproperty key="test.execution.dir" value="${tests.output.dir}"/>
       <sysproperty key="client.scenario" value="${client.scenario}"/>
       <sysproperty key="java.endorsed.dirs" value="${endorsed.dirs}"/>
       <sysproperty key="java.naming.provider.url" value="${node0.jndi.url}"/>
@@ -537,7 +539,9 @@
     <junit printsummary="yes" showoutput="yes" dir="${tests.output.dir}">
       <jvmarg line="${remote.debug.line}"/>
       <jvmarg value="-Djava.security.manager"/>
+      <sysproperty key="jdk.home" value="${env.JAVA_HOME}"/>
       <sysproperty key="build.testlog" value="${tests.output.dir}/log"/>
+      <sysproperty key="test.execution.dir" value="${tests.output.dir}"/>
       <sysproperty key="client.scenario" value="${client.scenario}"/>
       <sysproperty key="java.endorsed.dirs" value="${endorsed.dirs}"/>
       <sysproperty key="java.naming.provider.url" value="${node0.jndi.url}"/>

Added: legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java
===================================================================
--- legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java	                        (rev 0)
+++ legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java	2007-12-10 12:44:21 UTC (rev 5244)
@@ -0,0 +1,102 @@
+/*
+ * 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.tools.scripts;
+
+import junit.framework.TestCase;
+
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * JBWS-1793: Provide a test case for the tools scripts that reside under JBOSS_HOME/bin
+ * 
+ * @author Heiko.Braun at jboss.com
+ * @version $Revision$
+ */
+public class ScriptTestCase extends TestCase
+{
+   private String TOOLS_CONFIG = "resources/tools/scripts/wstools-config.xml";
+
+   private String JBOSS_HOME;
+   private String JDK_HOME;
+   private String TEST_EXEC_DIR;
+   private String OS;
+
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+
+      JBOSS_HOME = System.getProperty("jboss.home");
+      TEST_EXEC_DIR = System.getProperty("test.execution.dir");
+      JDK_HOME = System.getProperty("jdk.home");
+      OS = System.getProperty("os.name").toLowerCase();
+   }
+
+   public void testWSToolsFromCommandLine() throws Exception
+   {
+      if(isWindowsOS())
+      {
+         fail("This test has not been verified on windows");
+      }
+
+      // use absolute path for the output to be re-usable
+      String absToolsConfig= new File(TOOLS_CONFIG).getAbsolutePath();
+      String absOutput = new File("wstools/java").getAbsolutePath();
+
+      String command = JBOSS_HOME + "/bin/wstools.sh -config "+ absToolsConfig + " -dest "+absOutput;
+      Process p = executeCommand(command);
+
+      // check status code
+      assertStatusCode(p, "wstools");
+
+      File javaSource = new File("wstools/java/org/jboss/test/ws/jbws810/PhoneBookService.java");
+
+      assertTrue("Service endpoint interface not generated", javaSource.exists());
+   }
+
+   private Process executeCommand(String command)
+     throws IOException
+   {
+      // be verbose
+      System.out.println("cmd: " + command);
+      System.out.println("test execution dir: " + new File(TEST_EXEC_DIR).getAbsolutePath());
+      
+      Process p = Runtime.getRuntime().exec(
+        command,
+        new String[] {"JBOSS_HOME="+ JBOSS_HOME, "JAVA_HOME="+ JDK_HOME}
+      );
+      return p;
+   }
+
+   private void assertStatusCode(Process p, String s)
+     throws InterruptedException
+   {
+      // check status code
+      int status = p.waitFor();
+      assertTrue(s +" did exit with status " + status, status==0);
+   }
+   
+   private boolean isWindowsOS()
+   {
+      return ( (OS.indexOf("nt") > -1) || (OS.indexOf("windows") > -1 ));
+   }
+}


Property changes on: legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/PhoneBook.wsdl
===================================================================
--- legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/PhoneBook.wsdl	                        (rev 0)
+++ legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/PhoneBook.wsdl	2007-12-10 12:44:21 UTC (rev 5244)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws810' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws810/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws810' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+  <schema targetNamespace='http://test.jboss.org/ws/jbws810/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws810/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+
+   <simpleType name="Person">
+    <restriction base="string">
+     <maxLength value="20"/>
+    </restriction>
+   </simpleType>
+   
+   <simpleType name="TelephoneNumber">
+    <restriction base="string">
+     <maxLength value="20"/>
+    </restriction>
+   </simpleType>
+
+   <element name='lookup' type='tns:Person'/>
+   <element name='lookupResponse' type='tns:TelephoneNumber'/>
+  </schema>
+ </types>
+ <message name='PhoneBook_lookup'>
+  <part element='ns1:lookup' name='parameters'/>
+ </message>
+ <message name='PhoneBook_lookupResponse'>
+  <part element='ns1:lookupResponse' name='result'/>
+ </message>
+ <portType name='PhoneBook'>
+  <operation name='lookup'>
+   <input message='tns:PhoneBook_lookup'/>
+   <output message='tns:PhoneBook_lookupResponse'/>
+  </operation>
+ </portType>
+ <binding name='PhoneBookBinding' type='tns:PhoneBook'>
+  <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+  <operation name='lookup'>
+   <soap:operation soapAction=''/>
+   <input>
+    <soap:body use='literal'/>
+   </input>
+   <output>
+    <soap:body use='literal'/>
+   </output>
+  </operation>
+ </binding>
+ <service name='PhoneBook'>
+  <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
+   <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+  </port>
+ </service>
+</definitions>
\ No newline at end of file


Property changes on: legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/PhoneBook.wsdl
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/PhoneBook_PortType.java
===================================================================
--- legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/PhoneBook_PortType.java	                        (rev 0)
+++ legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/PhoneBook_PortType.java	2007-12-10 12:44:21 UTC (rev 5244)
@@ -0,0 +1,11 @@
+// This class was generated by the JAXRPC SI, do not edit.
+// Contents subject to change without notice.
+// JAX-RPC Standard Implementation (1.1.3, build R1)
+// Generated source version: 1.1.3
+
+package org.jboss.test.ws.jbws810;
+
+public interface PhoneBook_PortType extends java.rmi.Remote {
+    public java.lang.String lookup(java.lang.String parameters) throws 
+         java.rmi.RemoteException;
+}


Property changes on: legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/PhoneBook_PortType.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/jaxrpc-mapping.xml
===================================================================
--- legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/jaxrpc-mapping.xml	                        (rev 0)
+++ legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/jaxrpc-mapping.xml	2007-12-10 12:44:21 UTC (rev 5244)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee    http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
+  <package-mapping>
+    <package-type>org.jboss.test.ws.jbws810</package-type>
+    <namespaceURI>http://test.jboss.org/ws/jbws810</namespaceURI>
+  </package-mapping>
+  <service-interface-mapping>
+    <service-interface>org.jboss.test.ws.jbws810.PhoneBook_Service</service-interface>
+    <wsdl-service-name xmlns:serviceNS="http://test.jboss.org/ws/jbws810">serviceNS:PhoneBook</wsdl-service-name>
+    <port-mapping>
+      <port-name>PhoneBookPort</port-name>
+      <java-port-name>PhoneBookPort</java-port-name>
+    </port-mapping>
+  </service-interface-mapping>
+  <service-endpoint-interface-mapping>
+    <service-endpoint-interface>org.jboss.test.ws.jbws810.PhoneBook_PortType</service-endpoint-interface>
+    <wsdl-port-type xmlns:portTypeNS="http://test.jboss.org/ws/jbws810">portTypeNS:PhoneBook</wsdl-port-type>
+    <wsdl-binding xmlns:bindingNS="http://test.jboss.org/ws/jbws810">bindingNS:PhoneBookBinding</wsdl-binding>
+    <service-endpoint-method-mapping>
+      <java-method-name>lookup</java-method-name>
+      <wsdl-operation>lookup</wsdl-operation>
+      <method-param-parts-mapping>
+        <param-position>0</param-position>
+        <param-type>java.lang.String</param-type>
+        <wsdl-message-mapping>
+          <wsdl-message xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws810">wsdlMsgNS:PhoneBook_lookup</wsdl-message>
+          <wsdl-message-part-name>parameters</wsdl-message-part-name>
+          <parameter-mode>IN</parameter-mode>
+        </wsdl-message-mapping>
+      </method-param-parts-mapping>
+      <wsdl-return-value-mapping>
+        <method-return-value>java.lang.String</method-return-value>
+        <wsdl-message xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws810">wsdlMsgNS:PhoneBook_lookupResponse</wsdl-message>
+        <wsdl-message-part-name>result</wsdl-message-part-name>
+      </wsdl-return-value-mapping>
+    </service-endpoint-method-mapping>
+  </service-endpoint-interface-mapping>
+</java-wsdl-mapping>


Property changes on: legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/jaxrpc-mapping.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/wstools-config.xml
===================================================================
--- legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/wstools-config.xml	                        (rev 0)
+++ legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/wstools-config.xml	2007-12-10 12:44:21 UTC (rev 5244)
@@ -0,0 +1,5 @@
+<configuration>
+  <wsdl-java location="resources/tools/scripts/PhoneBook.wsdl" parameter-style="bare">
+    <mapping file="jaxrpc-mapping.xml"/>
+  </wsdl-java>
+</configuration>


Property changes on: legacy/branches/jbossws-1.2.1.GA_CP/jbossws-tests/src/resources/tools/scripts/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF




More information about the jbossws-commits mailing list