[jboss-cvs] JBossAS SVN: r108487 - in trunk/testsuite: imports and 6 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Oct 8 07:26:08 EDT 2010
Author: rsvoboda at redhat.com
Date: 2010-10-08 07:26:08 -0400 (Fri, 08 Oct 2010)
New Revision: 108487
Added:
trunk/testsuite/imports/sections/scripts.xml
trunk/testsuite/src/main/org/jboss/test/scripts/support/Echo.java
trunk/testsuite/src/main/org/jboss/test/scripts/support/EchoClient.java
trunk/testsuite/src/main/org/jboss/test/scripts/support/EchoJavaBean.java
trunk/testsuite/src/main/org/jboss/test/scripts/support/Hello.java
trunk/testsuite/src/main/org/jboss/test/scripts/support/HelloJavaBean.java
trunk/testsuite/src/main/org/jboss/test/scripts/test/WsclientTestCase.java
trunk/testsuite/src/main/org/jboss/test/scripts/test/WsconsumeTestCase.java
trunk/testsuite/src/main/org/jboss/test/scripts/test/WsprovideTestCase.java
trunk/testsuite/src/main/org/jboss/test/scripts/test/WstoolsTestCase.java
trunk/testsuite/src/resources/scripts/
trunk/testsuite/src/resources/scripts/BenchmarkWebService.wsdl
trunk/testsuite/src/resources/scripts/web.xml
trunk/testsuite/src/resources/scripts/wstools-config.xml
Modified:
trunk/testsuite/build.xml
trunk/testsuite/imports/test-jars.xml
trunk/testsuite/src/main/org/jboss/test/scripts/README.txt
trunk/testsuite/src/main/org/jboss/test/scripts/test/ScriptsTestBase.java
trunk/testsuite/src/main/org/jboss/test/scripts/test/ShutdownTestCase.java
trunk/testsuite/src/main/org/jboss/test/scripts/test/TwiddleTestCase.java
Log:
JBQA-3753 - tests for Web Services command line scripts (both WS Native and WS CXF stack)
- fixes for TwiddleTestCase (Windows), ScriptsTestBase and ShutdownTestCase
Modified: trunk/testsuite/build.xml
===================================================================
--- trunk/testsuite/build.xml 2010-10-08 11:25:17 UTC (rev 108486)
+++ trunk/testsuite/build.xml 2010-10-08 11:26:08 UTC (rev 108487)
@@ -3226,7 +3226,7 @@
</target>
<!-- script tests -->
- <target name="tests-scripts">
+ <target name="tests-scripts" depends="init">
<mkdir dir="${build.reports}"/>
<mkdir dir="${build.testlog}"/>
@@ -3277,13 +3277,14 @@
<fileset dir="${build.classes}">
<include name="**/test/scripts/test/TwiddleTestCase.class"/>
<include name="**/test/scripts/test/ProbeTestCase.class"/>
+ <include name="**/test/scripts/test/WsclientTestCase.class"/>
</fileset>
</batchtest>
</junit>
<server:stop name="scripts"/>
</target>
- <target name="tests-scripts-noserver">
+ <target name="tests-scripts-noserver" depends="init">
<mkdir dir="${build.reports}"/>
<mkdir dir="${build.testlog}"/>
@@ -3331,6 +3332,9 @@
<fileset dir="${build.classes}">
<include name="**/test/scripts/test/RunTestCase.class"/>
<include name="**/test/scripts/test/ShutdownTestCase.class"/>
+ <include name="**/test/scripts/test/WsconsumeTestCase.class"/>
+ <include name="**/test/scripts/test/WsprovideTestCase.class"/>
+ <include name="**/test/scripts/test/WstoolsTestCase.class"/>
</fileset>
</batchtest>
</junit>
Added: trunk/testsuite/imports/sections/scripts.xml
===================================================================
--- trunk/testsuite/imports/sections/scripts.xml (rev 0)
+++ trunk/testsuite/imports/sections/scripts.xml 2010-10-08 11:26:08 UTC (rev 108487)
@@ -0,0 +1,15 @@
+<project name="tests-scripts-jars">
+ <!-- webservice tests -->
+ <target name="_jars-scripts">
+ <mkdir dir="${build.lib}"/>
+
+ <echo message="Using target node: ${node0}"/>
+
+ <!-- jaxws-endpoint-servlet -->
+ <war warfile="${build.lib}/wsrunclient-test.war" webxml="${build.resources}/scripts/web.xml">
+ <classes dir="${build.classes}">
+ <include name="org/jboss/test/scripts/support/EchoJavaBean.class"/>
+ </classes>
+ </war>
+ </target>
+</project>
\ No newline at end of file
Modified: trunk/testsuite/imports/test-jars.xml
===================================================================
--- trunk/testsuite/imports/test-jars.xml 2010-10-08 11:25:17 UTC (rev 108486)
+++ trunk/testsuite/imports/test-jars.xml 2010-10-08 11:26:08 UTC (rev 108487)
@@ -62,8 +62,9 @@
<import file="sections/readahead.xml"/>
<import file="sections/refs.xml"/>
<import file="sections/retry.xml"/>
- <import file="sections/scoped.xml"/>
- <import file="sections/seam.xml"/>
+ <import file="sections/scoped.xml"/>
+ <import file="sections/scripts.xml"/>
+ <import file="sections/seam.xml"/>
<import file="sections/security.xml"/>
<import file="sections/securitymgr.xml"/>
<import file="sections/securityspi.xml"/>
@@ -128,7 +129,7 @@
_jars-invokers,
_jars-isolation,
_jars-jbossmessaging,
- _jars-jbossmessaging-cluster,
+ _jars-jbossmessaging-cluster,
_jars-jbossmx,
_jars-jbossts,
_jars-jbpm,
@@ -159,6 +160,7 @@
_jars-refs,
_jars-retry,
_jars-scoped,
+ _jars-scripts,
_jars-seam,
_jars-security,
_jars-securitymgr,
Modified: trunk/testsuite/src/main/org/jboss/test/scripts/README.txt
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/scripts/README.txt 2010-10-08 11:25:17 UTC (rev 108486)
+++ trunk/testsuite/src/main/org/jboss/test/scripts/README.txt 2010-10-08 11:26:08 UTC (rev 108487)
@@ -10,13 +10,14 @@
tests-scripts:
- starts a JBoss instance called 'scripts' which is based on 'all'
-- executes TwiddleTestCase and ProbeTestCase against the instance
+- executes TwiddleTestCase, ProbeTestCase and WsclientTestCase against the instance
- stops the JBoss instance
- the server is started and stopped using JBoss Test
tests-scripts-noserver:
- makes use of a JBoss instance 'scripts-noserver' which is based on 'default'
-- executes RunTestCase and ShutdownTestCase
+- executes RunTestCase, ShutdownTestCase, WsconsumeTestCase, WsprovideTestCase
+and WstoolsTestCase
- run.sh is used to start the servers
- JMX shutdown or shutdown.sh is used to stop the servers, depending on
the test case in question
Added: trunk/testsuite/src/main/org/jboss/test/scripts/support/Echo.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/scripts/support/Echo.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/scripts/support/Echo.java 2010-10-08 11:26:08 UTC (rev 108487)
@@ -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.scripts.support;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import javax.jws.WebService;
+import javax.jws.WebParam;
+
+ at WebService(targetNamespace = "http://org.jboss.ws/testsuite")
+public interface Echo extends Remote {
+ String echoString(@WebParam(name = "inputString") String inputString) throws RemoteException;
+}
Added: trunk/testsuite/src/main/org/jboss/test/scripts/support/EchoClient.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/scripts/support/EchoClient.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/scripts/support/EchoClient.java 2010-10-08 11:26:08 UTC (rev 108487)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.test.scripts.support;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.rmi.RemoteException;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+
+public class EchoClient
+{
+
+ private Echo getPort(String endpointURI) throws MalformedURLException
+ {
+ QName serviceName = new QName("http://org.jboss.ws/testsuite", "EchoService");
+ URL wsdlURL = new URL("http://localhost:8080/" + endpointURI + "?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ return service.getPort(Echo.class);
+ }
+
+ private void sayHello(String endpointURI) throws RemoteException, MalformedURLException
+ {
+ String helloWorld = "Hello world!";
+ Object retObj = getPort(endpointURI).echoString(helloWorld);
+ System.out.println(retObj);
+ }
+
+ public static void main(String[] args) throws Exception {
+
+ new EchoClient().sayHello("wsrunclient-test");
+
+ }
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/scripts/support/EchoJavaBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/scripts/support/EchoJavaBean.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/scripts/support/EchoJavaBean.java 2010-10-08 11:26:08 UTC (rev 108487)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.test.scripts.support;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+ at WebService(name = "Echo", serviceName = "EchoService", targetNamespace = "http://org.jboss.ws/testsuite")
+ at SOAPBinding(style = SOAPBinding.Style.RPC)
+public class EchoJavaBean {
+
+ @WebMethod
+ public String echoString(@WebParam(name = "inputString") String in0) {
+ return in0;
+ }
+}
Added: trunk/testsuite/src/main/org/jboss/test/scripts/support/Hello.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/scripts/support/Hello.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/scripts/support/Hello.java 2010-10-08 11:26:08 UTC (rev 108487)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.test.scripts.support;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+public interface Hello extends Remote
+{
+ public String echo(String in0) throws RemoteException;
+}
\ No newline at end of file
Added: trunk/testsuite/src/main/org/jboss/test/scripts/support/HelloJavaBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/scripts/support/HelloJavaBean.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/scripts/support/HelloJavaBean.java 2010-10-08 11:26:08 UTC (rev 108487)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.test.scripts.support;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+ at WebService(name = "Hello", serviceName = "HelloService", targetNamespace = "http://org.jboss.ws/testsuite")
+ at SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+public class HelloJavaBean {
+
+ @WebMethod
+ public String echoString(@WebParam(name = "inputString") String in0) {
+ return in0;
+ }
+}
Modified: trunk/testsuite/src/main/org/jboss/test/scripts/test/ScriptsTestBase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/scripts/test/ScriptsTestBase.java 2010-10-08 11:25:17 UTC (rev 108486)
+++ trunk/testsuite/src/main/org/jboss/test/scripts/test/ScriptsTestBase.java 2010-10-08 11:26:08 UTC (rev 108487)
@@ -21,19 +21,7 @@
*/
package org.jboss.test.scripts.test;
-import java.lang.InterruptedException ;
-import java.io.OutputStream ;
-import java.io.ByteArrayOutputStream ;
-import java.io.BufferedReader ;
-import java.io.InputStreamReader ;
-import java.io.PrintWriter ;
-import java.io.StringWriter ;
-import java.io.FileReader ;
-import java.io.FileWriter ;
-import java.io.File ;
-import java.io.FileInputStream ;
-import java.io.FileOutputStream ;
-import java.io.FileNotFoundException ;
+import java.io.File;
import java.io.IOException ;
import java.net.URL ;
@@ -57,11 +45,13 @@
public abstract class ScriptsTestBase extends JBossTestCase
{
public static final String SERVER_STARTED_MESSAGE = "Started in" ;
- public static final String SERVER_STOPPED_MESSAGE = "Shutdown complete" ;
+ public static final String SERVER_STOPPED_MESSAGE = "Stopped: JBossAS" ;
public static final String SERVER_HALT_MESSAGE = "Server halt" ;
public static final String SERVER_EXIT_MESSAGE = "Server exit" ;
public static final String SERVER_HALTED_MESSAGE = "halting the JVM now" ;
-
+
+ protected static final String FS = System.getProperty("file.separator"); // '/' on unix, '\' on windows
+
ShellScriptExecutor se = null ;
AsyncShellScriptExecutor ase = null ;
LogFileAssertionChecker errorLogChecker = null ;
@@ -356,6 +346,7 @@
String currentOutput = ase.getOutput() ;
if (currentOutput.indexOf(SERVER_STOPPED_MESSAGE) > -1 || currentOutput.indexOf(SERVER_HALTED_MESSAGE) > -1) {
serverStopped = true ;
+ break;
}
// wait for a sec
@@ -401,5 +392,14 @@
}
catch(InterruptedException e) {
}
- }
+ }
+ /**
+ * Checks if JBossWS CXF stack is installed
+ *
+ * @return true if JBossWS CXF stack is installed
+ */
+ protected boolean isCXFInstalled() {
+ final File cxfClientFile = new File(getDistDir() + FS + "client" + FS + "jbossws-cxf-client.jar");
+ return cxfClientFile.exists();
+ }
}
Modified: trunk/testsuite/src/main/org/jboss/test/scripts/test/ShutdownTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/scripts/test/ShutdownTestCase.java 2010-10-08 11:25:17 UTC (rev 108486)
+++ trunk/testsuite/src/main/org/jboss/test/scripts/test/ShutdownTestCase.java 2010-10-08 11:26:08 UTC (rev 108487)
@@ -24,18 +24,9 @@
import java.io.File ;
import java.io.IOException ;
-import java.lang.InterruptedException ;
-import java.net.URL ;
-import java.net.MalformedURLException ;
import javax.management.ObjectName ;
import javax.management.MalformedObjectNameException ;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.jboss.test.JBossTestSetup ;
-
/**
* Unit tests of shutdown.sh and shutdown.bat.
*
@@ -146,7 +137,7 @@
getAsyncShellScriptExecutor().assertOnOutputStream("Started in","Started string not found in command output") ;
// shutdown the server using the shutdown command
- String[] shutdownCommand = getShellCommand("shutdown", "-o " + getServerHost() + "-r 1090", "-S") ;
+ String[] shutdownCommand = getShellCommand("shutdown", "-o " + getServerHost() + " -r 1090", "-S") ;
getShellScriptExecutor().runShellCommand(shutdownCommand, envp, workingDir) ;
System.out.println("shutdown output = " + getShellScriptExecutor().getOutput()) ;
Modified: trunk/testsuite/src/main/org/jboss/test/scripts/test/TwiddleTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/scripts/test/TwiddleTestCase.java 2010-10-08 11:25:17 UTC (rev 108486)
+++ trunk/testsuite/src/main/org/jboss/test/scripts/test/TwiddleTestCase.java 2010-10-08 11:26:08 UTC (rev 108487)
@@ -23,10 +23,6 @@
package org.jboss.test.scripts.test;
import java.io.File ;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.jboss.test.JBossTestSetup ;
/**
* Unit tests of twiddle.sh and twiddle.bat.
@@ -261,7 +257,7 @@
// supply the command name prefix, any options as a string, and any args
String command = "twiddle" ;
String options = "-o " + getServerHost() + " -r 1090";
- String args = "query 'jboss.system:*'" ;
+ String args = "query \"jboss.system:*\"" ; // fix for Windows
String[] shellCommand = getShellCommand(command, options, args) ;
// set the environment if necessary
Added: trunk/testsuite/src/main/org/jboss/test/scripts/test/WsclientTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/scripts/test/WsclientTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/scripts/test/WsclientTestCase.java 2010-10-08 11:26:08 UTC (rev 108487)
@@ -0,0 +1,122 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009 Red Hat Middleware, Inc. 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.test.scripts.test;
+
+import java.io.File;
+import java.net.URL;
+import junit.framework.Test;
+
+/**
+ * Unit tests of wsrunclient.sh and wsrunclient.bat.
+ *
+ * @author Rostislav Svoboda
+ * @version $Revision: $
+ */
+public class WsclientTestCase extends ScriptsTestBase {
+ private static final URL classesDirUrl = Thread.currentThread().getContextClassLoader().getResource("");
+
+ /**
+ * Create a new WsclientTestCase.
+ *
+ * @param name
+ */
+ public WsclientTestCase(String name) {
+ super(name);
+ }
+
+ // WAR file from org.jboss.test.webservice.endpoint
+ public static Test suite() throws Exception {
+ return getDeploySetup(WsclientTestCase.class, "wsrunclient-test.war");
+ }
+
+ /**
+ * Prints out some basic info about the environment
+ */
+ public void testExecutionEnvironment() {
+ String os = isWindows() ? "Windows" : "non-Windows";
+ // dump out some basic config information
+ System.out.println("Testing run on " + os + " host");
+ System.out.println("Working directory: " + getBinDir());
+ System.out.println("Dist directory: " + getDistDir());
+ System.out.println("Log directory: " + getLogDir());
+ System.out.println("Server config: " + getServerConfig());
+ System.out.println("CXF installed: " + isCXFInstalled());
+ }
+
+ /**
+ * Tests run "help" command (no args)
+ *
+ * @throws Exception
+ */
+ public void testNoArgs() throws Exception {
+ String command = "wsrunclient";
+ String options = null;
+ String args = null;
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ // check assertions
+ getShellScriptExecutor().assertOnOutputStream("usage: wsrunclient", "usage string not found in command output");
+ }
+
+ /**
+ * Tests to run client
+ *
+ * @throws Exception
+ */
+ public void testRunClient() throws Exception {
+ String command = "wsrunclient";
+ // original package was org.jboss.test.ws.benchmark.jaxws.doclit
+ String options = "-classpath " + classesDirUrl.getFile();
+ String args = "org.jboss.test.scripts.support.EchoClient";
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ // check assertions
+ getShellScriptExecutor().assertOnOutputStream("Hello world!", "'Hello world!' string not found in command output");
+ }
+ /**
+ * Tests to run non exixting client
+ *
+ * @throws Exception
+ */
+ public void testRunNonExistingClient() throws Exception {
+ String command = "wsrunclient";
+ // original package was org.jboss.test.ws.benchmark.jaxws.doclit
+ String options = "-classpath " + classesDirUrl.getFile();
+ String args = "org.jboss.test.scripts.support.NonExistingClient";
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ getShellScriptExecutor().assertOnErrorStream("java.lang.ClassNotFoundException",
+ "'java.lang.ClassNotFoundException' string not found in error output");
+ }
+}
Added: trunk/testsuite/src/main/org/jboss/test/scripts/test/WsconsumeTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/scripts/test/WsconsumeTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/scripts/test/WsconsumeTestCase.java 2010-10-08 11:26:08 UTC (rev 108487)
@@ -0,0 +1,325 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009 Red Hat Middleware, Inc. 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.test.scripts.test;
+
+import java.io.File;
+import java.net.URL;
+
+/**
+ * Unit tests of wsconsume.sh and wsconsume.bat.
+ *
+ * @author Rostislav Svoboda
+ * @version $Revision: $
+ */
+public class WsconsumeTestCase extends ScriptsTestBase {
+
+ private static final URL wsdlFileUrl = Thread.currentThread().getContextClassLoader().getResource("scripts/BenchmarkWebService.wsdl");
+ private static final URL scriptsDirUrl = Thread.currentThread().getContextClassLoader().getResource("scripts");
+
+ /**
+ * Create a new WsconsumeTestCase.
+ *
+ * @param name
+ */
+ public WsconsumeTestCase(String name) {
+ super(name);
+ }
+
+ /**
+ * Prints out some basic info about the environment
+ */
+ public void testExecutionEnvironment() {
+ String os = isWindows() ? "Windows" : "non-Windows";
+ // dump out some basic config information
+ System.out.println("Testing run on " + os + " host");
+ System.out.println("Working directory: " + getBinDir());
+ System.out.println("Dist directory: " + getDistDir());
+ System.out.println("Log directory: " + getLogDir());
+ System.out.println("Server config: " + getServerConfig());
+ System.out.println("CXF installed: " + isCXFInstalled());
+ }
+
+ /**
+ * Tests run "help" command (no args)
+ *
+ * @throws Exception
+ */
+ public void testNoArgs() throws Exception {
+ String command = "wsconsume";
+ String options = null;
+ String args = "-h";
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ // check assertions
+ getShellScriptExecutor().assertOnOutputStream("usage: org.jboss.wsf.spi.tools.cmd.WSConsume",
+ "usage string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ }
+
+ /**
+ * Tests generate classes command
+ *
+ * @throws Exception
+ */
+ public void testGenerateClasses() throws Exception {
+ File outDir = new File(scriptsDirUrl.getFile() + FS + "wsconsume-classes-out");
+ if (!outDir.exists()) {
+ outDir.mkdir();
+ }
+
+ String command = "wsconsume";
+ // original package was org.jboss.test.ws.benchmark.jaxws.doclit
+ String options = "-p org.jboss.test.script -o " + outDir.getAbsolutePath();
+ String args = wsdlFileUrl.getFile();
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ // check assertions
+ if (isCXFInstalled()) {
+ getShellScriptExecutor().assertOnOutputStream("wsdl2java -compile", "'wsdl2java -compile' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ } else {
+ getShellScriptExecutor().assertOnOutputStream("parsing WSDL...", "'parsing WSDL...' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("generating code...", "'generating code...' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("compiling code...", "'compiling code...' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ }
+ //check files
+ File customerClassFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "Customer.class");
+ File getOrderClassFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "GetOrder.class");
+ File customerJavaFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "Customer.java");
+ File getOrderJavaFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "GetOrder.java");
+
+ assertTrue(customerClassFile.getAbsolutePath() + " doesn't exist", customerClassFile.exists());
+ assertTrue(getOrderClassFile.getAbsolutePath() + " doesn't exist", getOrderClassFile.exists());
+ assertFalse(customerJavaFile.getAbsolutePath() + " exists", customerJavaFile.exists());
+ assertFalse(getOrderJavaFile.getAbsolutePath() + " exists", getOrderJavaFile.exists());
+ }
+
+
+ //NATIVE issue (needs to have -k specified (no -n), when -o + -n java files in output directory )
+
+ /**
+ * Tests generate only sources command
+ *
+ * @throws Exception
+ */
+ public void testGenerateSources() throws Exception {
+ File outDir = new File(scriptsDirUrl.getFile() + FS + "wsconsume-sources-out");
+ if (!outDir.exists()) {
+ outDir.mkdir();
+ }
+
+ String command = "wsconsume";
+ String options = "-n -p org.jboss.test.script -s " + outDir.getAbsolutePath();
+ String args = wsdlFileUrl.getFile();
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ // check assertions
+ if (isCXFInstalled()) {
+ getShellScriptExecutor().assertOnOutputStream("wsdl2java", "'wsdl2java' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ } else {
+ getShellScriptExecutor().assertOnOutputStream("parsing WSDL...", "'parsing WSDL...' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("generating code...", "'generating code...' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ assertTrue("'compiling code...' string found in command output",
+ (getShellScriptExecutor().getOutput().indexOf("compiling code...") == -1));
+ }
+ //check files
+ File customerClassFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "Customer.class");
+ File getOrderClassFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "GetOrder.class");
+ File customerJavaFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "Customer.java");
+ File getOrderJavaFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "GetOrder.java");
+
+ assertFalse(customerClassFile.getAbsolutePath() + " exists", customerClassFile.exists());
+ assertFalse(getOrderClassFile.getAbsolutePath() + " exists", getOrderClassFile.exists());
+ assertTrue(customerJavaFile.getAbsolutePath() + " doesn't exist", customerJavaFile.exists());
+ assertTrue(getOrderJavaFile.getAbsolutePath() + " doesn't exist", getOrderJavaFile.exists());
+ }
+
+ /**
+ * Tests generate only sources command
+ *
+ * @throws Exception
+ */
+ public void testKeepSources() throws Exception {
+ File outDir = new File(scriptsDirUrl.getFile() + FS + "wsconsume-sources-keep-out");
+ if (!outDir.exists()) {
+ outDir.mkdir();
+ }
+
+ String command = "wsconsume";
+ String options = "-k -p org.jboss.test.script -s " + outDir.getAbsolutePath();
+ String args = wsdlFileUrl.getFile();
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ // check assertions
+ if (isCXFInstalled()) {
+ getShellScriptExecutor().assertOnOutputStream("wsdl2java", "'wsdl2java' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ } else {
+ getShellScriptExecutor().assertOnOutputStream("parsing WSDL...", "'parsing WSDL...' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("generating code...", "'generating code...' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("compiling code...", "'compiling code...' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ }
+ //check files
+ File customerJavaFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "Customer.java");
+ File getOrderJavaFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "GetOrder.java");
+ assertTrue(customerJavaFile.getAbsolutePath() + " doesn't exist", customerJavaFile.exists());
+ assertTrue(getOrderJavaFile.getAbsolutePath() + " doesn't exist", getOrderJavaFile.exists());
+ }
+
+ /**
+ * Tests generate classes and sources command
+ *
+ * @throws Exception
+ */
+ public void testGenerateBoth() throws Exception {
+ File outDir = new File(scriptsDirUrl.getFile() + FS + "wsconsume-both-out");
+ if (!outDir.exists()) {
+ outDir.mkdir();
+ }
+
+ String command = "wsconsume";
+ String options = "-k -p org.jboss.test.script -o " + outDir.getAbsolutePath();
+ String args = wsdlFileUrl.getFile();
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ // check assertions
+ if (!isCXFInstalled()) {
+ getShellScriptExecutor().assertOnOutputStream("parsing WSDL...", "'parsing WSDL...' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("generating code...", "'generating code...' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("compiling code...", "'compiling code...' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ }
+ //check files
+ File customerClassFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "Customer.class");
+ File getOrderClassFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "GetOrder.class");
+ File customerJavaFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "Customer.java");
+ File getOrderJavaFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "GetOrder.java");
+
+ assertTrue(customerClassFile.getAbsolutePath() + " doesn't exist", customerClassFile.exists());
+ assertTrue(getOrderClassFile.getAbsolutePath() + " doesn't exist", getOrderClassFile.exists());
+ assertTrue(customerJavaFile.getAbsolutePath() + " doesn't exist", customerJavaFile.exists());
+ assertTrue(getOrderJavaFile.getAbsolutePath() + " doesn't exist", getOrderJavaFile.exists());
+ }
+
+ /**
+ * Tests generate classes and sources command, each in separate directory
+ *
+ * @throws Exception
+ */
+ public void testGenerateBothSeparated() throws Exception {
+ File outClassesDir = new File(scriptsDirUrl.getFile() + FS + "wsconsume-separate-classes-out");
+ File outSourcesDir = new File(scriptsDirUrl.getFile() + FS + "wsconsume-separate-sources-out");
+ if (!outClassesDir.exists()) {
+ outClassesDir.mkdir();
+ }
+ if (!outSourcesDir.exists()) {
+ outSourcesDir.mkdir();
+ }
+
+ String command = "wsconsume";
+ String options = "-k -p org.jboss.test.script -o " + outClassesDir.getAbsolutePath()
+ + " -s " + outSourcesDir.getAbsolutePath();
+ String args = wsdlFileUrl.getFile();
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ // check assertions
+ if (!isCXFInstalled()) {
+ getShellScriptExecutor().assertOnOutputStream("parsing WSDL...", "'parsing WSDL...' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("generating code...", "'generating code...' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("compiling code...", "'compiling code...' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ }
+ //check files
+ File customerClassFile = new File(outClassesDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "Customer.class");
+ File getOrderClassFile = new File(outClassesDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "GetOrder.class");
+ File customerJavaFile = new File(outSourcesDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "Customer.java");
+ File getOrderJavaFile = new File(outSourcesDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "script" + FS + "GetOrder.java");
+
+ assertTrue(customerClassFile.getAbsolutePath() + " doesn't exist", customerClassFile.exists());
+ assertTrue(getOrderClassFile.getAbsolutePath() + " doesn't exist", getOrderClassFile.exists());
+ assertTrue(customerJavaFile.getAbsolutePath() + " doesn't exist", customerJavaFile.exists());
+ assertTrue(getOrderJavaFile.getAbsolutePath() + " doesn't exist", getOrderJavaFile.exists());
+ }
+
+ /**
+ * Tests generate classes command when wsdl doesn't exist
+ *
+ * @throws Exception
+ */
+ public void testNonExistingWsdl() throws Exception {
+ String command = "wsconsume";
+ String options = "-v -p org.jboss.test.script ";
+ String args = "NonExistingWsdl.wsdl";
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ if (isCXFInstalled()) {
+ assertTrue("'Failed to invoke WSDLToJava' string not found in command output:\n" + getShellScriptExecutor().getOutput(),
+ getShellScriptExecutor().getOutput().indexOf("Failed to invoke WSDLToJava") != -1);
+ } else {
+ assertTrue("'Failed to parse the WSDL' string not found in command output",
+ (getShellScriptExecutor().getOutput().indexOf("Failed to parse the WSDL") != -1));
+ assertTrue("'WsImport invocation failed' string not found in error output",
+ (getShellScriptExecutor().getError().indexOf("WsImport invocation failed") != -1));
+ }
+ }
+}
\ No newline at end of file
Added: trunk/testsuite/src/main/org/jboss/test/scripts/test/WsprovideTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/scripts/test/WsprovideTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/scripts/test/WsprovideTestCase.java 2010-10-08 11:26:08 UTC (rev 108487)
@@ -0,0 +1,279 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009 Red Hat Middleware, Inc. 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.test.scripts.test;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.net.URL;
+
+/**
+ * Unit tests of wsprovide.sh and wsprovide.bat.
+ *
+ * @author Rostislav Svoboda
+ * @version $Revision: $
+ */
+public class WsprovideTestCase extends ScriptsTestBase {
+
+ private static final URL classesDirUrl = Thread.currentThread().getContextClassLoader().getResource("");
+ private static final URL scriptsDirUrl = Thread.currentThread().getContextClassLoader().getResource("scripts");
+
+ /**
+ * Create a new WsprovideTestCase.
+ *
+ * @param name
+ */
+ public WsprovideTestCase(String name) {
+ super(name);
+ }
+
+ /**
+ * Prints out some basic info about the environment
+ */
+ public void testExecutionEnvironment() {
+ String os = isWindows() ? "Windows" : "non-Windows";
+ // dump out some basic config information
+ System.out.println("Testing run on " + os + " host");
+ System.out.println("Working directory: " + getBinDir());
+ System.out.println("Dist directory: " + getDistDir());
+ System.out.println("Log directory: " + getLogDir());
+ System.out.println("Server config: " + getServerConfig());
+ System.out.println("CXF installed: " + isCXFInstalled());
+ }
+
+ /**
+ * Tests run "help" command (no args)
+ *
+ * @throws Exception
+ */
+ public void testNoArgs() throws Exception {
+ String command = "wsprovide";
+ String options = null;
+ String args = "-h";
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ getShellScriptExecutor().assertOnOutputStream("usage: WSProvide", "usage string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ }
+
+ /**
+ * Tests basic command to generate request and response classes
+ *
+ * @throws Exception
+ */
+ public void testGenerateRequestResponseClasses() throws Exception {
+ File outDir = new File(scriptsDirUrl.getFile() + FS + "wsprovide-basic-out");
+ if (!outDir.exists()) {
+ outDir.mkdir();
+ }
+ String command = "wsprovide";
+ String options = "-c " + classesDirUrl.getFile() + " -o " + outDir.getAbsolutePath();
+ String args = "org.jboss.test.scripts.support.HelloJavaBean";
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ // check assertions
+ if (isCXFInstalled()) {
+ getShellScriptExecutor().assertOnOutputStream(args, "'" + args + "' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("java2ws", "'java2ws' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ } else {
+ getShellScriptExecutor().assertOnOutputStream("Output directory:", "'Output directory:' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("Writing Classes:", "'Writing Classes:' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ }
+ //check files
+ File echoClassFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "scripts" + FS + "support" + FS + "jaxws" + FS + "EchoString.class");
+ assertTrue(echoClassFile.getAbsolutePath() + " doesn't exist", echoClassFile.exists());
+ }
+
+ /**
+ * Tests basic command to generate WSDL file
+ *
+ * @throws Exception
+ */
+ public void testGenerateWSDL() throws Exception {
+ File outDir = new File(scriptsDirUrl.getFile() + FS + "wsprovide-wsdl-out");
+ if (!outDir.exists()) {
+ outDir.mkdir();
+ }
+ String command = "wsprovide";
+ String options = "-w -c " + classesDirUrl.getFile() + " -o " + outDir.getAbsolutePath();
+ String args = "org.jboss.test.scripts.support.HelloJavaBean";
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ // check assertions
+ if (!isCXFInstalled()) {
+ getShellScriptExecutor().assertOnOutputStream("Output directory:", "'Output directory:' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("Generating WSDL:", "'Generating WSDL:' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ }
+ //check files
+ File wsdlFile = new File(outDir.getAbsolutePath() + FS + "HelloService.wsdl");
+ assertTrue(wsdlFile.getAbsolutePath() + " doesn't exist", wsdlFile.exists());
+ }
+
+ /**
+ * Tests basic command to generate WSDL file with SOAP 1.2 binding extension
+ *
+ * @throws Exception
+ */
+ public void testGenerateWSDLWithExtension() throws Exception {
+ File outDir = new File(scriptsDirUrl.getFile() + FS + "wsprovide-wsdl-ext-out");
+ if (!outDir.exists()) {
+ outDir.mkdir();
+ }
+ String command = "wsprovide";
+ String options = "-w -e -c " + classesDirUrl.getFile() + " -o " + outDir.getAbsolutePath();
+ String args = "org.jboss.test.scripts.support.HelloJavaBean";
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ //check files
+ File wsdlFile = new File(outDir.getAbsolutePath() + FS + "HelloService.wsdl");
+ assertTrue(wsdlFile.getAbsolutePath() + " doesn't exist", wsdlFile.exists());
+
+ final BufferedReader inStream = new BufferedReader(new FileReader(wsdlFile));
+ String line = inStream.readLine();
+ boolean containsExtension = false;
+ while (line != null && !containsExtension) {
+ containsExtension = line.contains("soap12");
+ line = inStream.readLine();
+ }
+ assertTrue(wsdlFile.getAbsolutePath() + " doesn't doesn't contain SOAP 1.2 "
+ + "binding extension", containsExtension);
+ }
+
+ /**
+ * Tests basic command to generate and keep source files
+ *
+ * @throws Exception
+ */
+ public void testKeepSources() throws Exception {
+ File outDir = new File(scriptsDirUrl.getFile() + FS + "wsprovide-keep-sources-out");
+ if (!outDir.exists()) {
+ outDir.mkdir();
+ }
+ String command = "wsprovide";
+ String options = "-k -c " + classesDirUrl.getFile() + " -o " + outDir.getAbsolutePath();
+ String args = "org.jboss.test.scripts.support.HelloJavaBean";
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ // check assertions
+ if (!isCXFInstalled()) {
+ getShellScriptExecutor().assertOnOutputStream("Output directory:", "'Output directory:' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("Writing Source:", "'Writing Source:' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("Writing Classes:", "'Writing Classes:' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ }
+ //check files
+ File echoClassFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "scripts" + FS + "support" + FS + "jaxws" + FS + "EchoString.class");
+ File echoJavaFile = new File(outDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "scripts" + FS + "support" + FS + "jaxws" + FS + "EchoString.java");
+ assertTrue(echoClassFile.getAbsolutePath() + " doesn't exist", echoClassFile.exists());
+ assertTrue(echoJavaFile.getAbsolutePath() + " doesn't exist", echoJavaFile.exists());
+ }
+
+ /**
+ * Tests command to generate WSDL, support classes and keep source files.
+ * Each in separated directory.
+ *
+ * @throws Exception
+ */
+ public void testGenerateAllSeparated() throws Exception {
+ File outClassesDir = new File(scriptsDirUrl.getFile() + FS + "wsprovide-separate-classes-out");
+ File outSourcesDir = new File(scriptsDirUrl.getFile() + FS + "wsprovide-separate-sources-out");
+ File outResourcesDir = new File(scriptsDirUrl.getFile() + FS + "wsprovide-separate-resources-out");
+ if (!outClassesDir.exists()) {
+ outClassesDir.mkdir();
+ }
+ if (!outSourcesDir.exists()) {
+ outSourcesDir.mkdir();
+ }
+ if (!outResourcesDir.exists()) {
+ outResourcesDir.mkdir();
+ }
+
+ String command = "wsprovide";
+ String options = "-k -w -c " + classesDirUrl.getFile()
+ + " -o " + outClassesDir.getAbsolutePath()
+ + " -r " + outResourcesDir.getAbsolutePath()
+ + " -s " + outSourcesDir.getAbsolutePath();
+ String args = "org.jboss.test.scripts.support.HelloJavaBean";
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ // check assertions
+ if (!isCXFInstalled()) {
+ getShellScriptExecutor().assertOnOutputStream("Output directory:", "'Output directory:' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("Writing Source:", "'Writing Source:' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("Writing Classes:", "'Writing Classes:' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ getShellScriptExecutor().assertOnOutputStream("Generating WSDL:", "'Generating WSDL:' string not found in command output:\n" + getShellScriptExecutor().getOutput());
+ }
+ //check files
+ File echoClassFile = new File(outClassesDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "scripts" + FS + "support" + FS + "jaxws" + FS + "EchoString.class");
+ File echoJavaFile = new File(outSourcesDir.getAbsolutePath() + FS
+ + "org" + FS + "jboss" + FS + "test" + FS + "scripts" + FS + "support" + FS + "jaxws" + FS + "EchoString.java");
+ File wsdlFile = new File(outResourcesDir.getAbsolutePath() + FS + "HelloService.wsdl");
+
+ assertTrue(echoClassFile.getAbsolutePath() + " doesn't exist", echoClassFile.exists());
+ assertTrue(echoJavaFile.getAbsolutePath() + " doesn't exist", echoJavaFile.exists());
+ assertTrue(wsdlFile.getAbsolutePath() + " doesn't exist", wsdlFile.exists());
+ }
+
+ /**
+ * Tests basic command to generate support classes from non-existing class
+ *
+ * @throws Exception
+ */
+ public void testNonExistingClass() throws Exception {
+ String command = "wsprovide";
+ String options = "-k -c " + classesDirUrl.getFile();
+ String args = "org.jboss.test.scripts.support.NonExistingBean";
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+ assertTrue("'Could not load class' string not found in error output",
+ (getShellScriptExecutor().getError().indexOf("Could not load class") != -1));
+ }
+}
Added: trunk/testsuite/src/main/org/jboss/test/scripts/test/WstoolsTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/scripts/test/WstoolsTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/scripts/test/WstoolsTestCase.java 2010-10-08 11:26:08 UTC (rev 108487)
@@ -0,0 +1,128 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009 Red Hat Middleware, Inc. 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.test.scripts.test;
+
+import java.io.File;
+import java.net.URL;
+
+/**
+ * Unit tests of wstools.sh and wstools.bat.
+ *
+ * @author Rostislav Svoboda
+ * @version $Revision: $
+ */
+public class WstoolsTestCase extends ScriptsTestBase {
+
+ private static final URL configFileUrl = Thread.currentThread().getContextClassLoader().getResource("scripts/wstools-config.xml");
+ private static final URL scriptsDirUrl = Thread.currentThread().getContextClassLoader().getResource("scripts");
+ private static final URL classesDirUrl = Thread.currentThread().getContextClassLoader().getResource("");
+
+ /**
+ * Create a new WstoolsTestCase.
+ *
+ * @param name
+ */
+ public WstoolsTestCase(String name) {
+ super(name);
+ }
+
+ /**
+ * Prints out some basic info about the environment
+ */
+ public void testExecutionEnvironment() {
+ String os = isWindows() ? "Windows" : "non-Windows";
+ // dump out some basic config information
+ System.out.println("Testing run on " + os + " host");
+ System.out.println("Working directory: " + getBinDir());
+ System.out.println("Dist directory: " + getDistDir());
+ System.out.println("Log directory: " + getLogDir());
+ System.out.println("Server config: " + getServerConfig());
+ System.out.println("CXF installed: " + isCXFInstalled());
+ System.out.println("WSTools present: " + isWSToolsPresent());
+ }
+
+ private boolean isWSToolsPresent() {
+ final File wstoolsFile = new File(getDistDir() + FS + "bin" + FS + "wstools" + (isWindows() ? ".bat" : ".sh"));
+ return wstoolsFile.exists();
+ }
+
+ /**
+ * Tests run "help" command (no args)
+ *
+ * @throws Exception
+ */
+ public void testNoArgs() throws Exception {
+ if (isCXFInstalled() && !isWSToolsPresent()) {
+ System.out.println("Installed CXF and no WSTools command line script as expected (EAP 5.1.x) ");
+ return;
+ }
+ String command = "wstools";
+ String options = null;
+ String args = "-h";
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ // check assertions
+ getShellScriptExecutor().assertOnOutputStream("Usage: wstools", "usage string not found in command output");
+ }
+
+ /**
+ * Tests generate classes command
+ *
+ * @throws Exception
+ */
+ public void testGenerateClasses() throws Exception {
+ if (isCXFInstalled() && !isWSToolsPresent()) {
+ System.out.println("Installed CXF and no WSTools command line script as expected (EAP 5.1.x) ");
+ return;
+ }
+ File outDir = new File(scriptsDirUrl.getFile() + FS + "wstools-classes-out");
+ if (!outDir.exists()) {
+ outDir.mkdir();
+ }
+
+ String command = "wstools";
+ // original package was org.jboss.test.ws.benchmark.jaxws.doclit
+ String options = "-classpath " + classesDirUrl.getFile() + " -config " + configFileUrl.getFile() +
+ " -dest " + outDir.getAbsolutePath();
+ String args = null;
+ String[] shellCommand = getShellCommand(command, options, args);
+
+ String[] envp = null; // set the environment if necessary
+ File workingDir = new File(getBinDir()); // set the working directory
+ getShellScriptExecutor().runShellCommand(shellCommand, envp, workingDir);
+
+ // NO console output
+
+ //check files
+ File wsdlFile = new File(outDir.getAbsolutePath() + FS + "wsdl" + FS + "HelloService.wsdl");
+ File webservicesFile = new File(outDir.getAbsolutePath() + FS + "webservices.xml");
+ File mappingFile = new File(outDir.getAbsolutePath() + FS + "jaxrpc-mapping.xml");
+
+ assertTrue(wsdlFile.getAbsolutePath() + " doesn't exist", wsdlFile.exists());
+ assertTrue(webservicesFile.getAbsolutePath() + " doesn't exist", webservicesFile.exists());
+ assertTrue(mappingFile.getAbsolutePath() + " doesn't exist", mappingFile.exists());
+ }
+}
\ No newline at end of file
Added: trunk/testsuite/src/resources/scripts/BenchmarkWebService.wsdl
===================================================================
--- trunk/testsuite/src/resources/scripts/BenchmarkWebService.wsdl (rev 0)
+++ trunk/testsuite/src/resources/scripts/BenchmarkWebService.wsdl 2010-10-08 11:26:08 UTC (rev 108487)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<definitions name="BenchmarkWebService" targetNamespace="http://org.jboss.ws/benchmark" xmlns:tns="http://org.jboss.ws/benchmark" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns2="http://org.jboss.ws/benchmark/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+ <types>
+ <schema targetNamespace="http://org.jboss.ws/benchmark/types" xmlns:tns="http://org.jboss.ws/benchmark/types" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema">
+ <complexType name="echoArrayOfSimpleUserType">
+ <sequence>
+ <element name="arrayOfSimpleUserType_1" type="tns:SimpleUserType" nillable="true" minOccurs="0" maxOccurs="unbounded"/></sequence></complexType>
+ <complexType name="SimpleUserType">
+ <sequence>
+ <element name="f" type="float"/>
+ <element name="i" type="int"/>
+ <element name="s" type="string" nillable="true"/></sequence></complexType>
+ <complexType name="echoArrayOfSimpleUserTypeResponse">
+ <sequence>
+ <element name="result" type="tns:SimpleUserType" nillable="true" minOccurs="0" maxOccurs="unbounded"/></sequence></complexType>
+ <complexType name="echoSimpleType">
+ <sequence>
+ <element name="SimpleUserType_1" type="tns:SimpleUserType" nillable="true"/></sequence></complexType>
+ <complexType name="echoSimpleTypeResponse">
+ <sequence>
+ <element name="result" type="tns:SimpleUserType" nillable="true"/></sequence></complexType>
+ <complexType name="echoSynthetic">
+ <sequence>
+ <element name="Synthetic_1" type="tns:Synthetic" nillable="true"/></sequence></complexType>
+ <complexType name="Synthetic">
+ <sequence>
+ <element name="b" type="base64Binary" nillable="true"/>
+ <element name="s" type="string" nillable="true"/>
+ <element name="sut" type="tns:SimpleUserType" nillable="true"/></sequence></complexType>
+ <complexType name="echoSyntheticResponse">
+ <sequence>
+ <element name="result" type="tns:Synthetic" nillable="true"/></sequence></complexType>
+ <complexType name="getOrder">
+ <sequence>
+ <element name="int_1" type="int"/>
+ <element name="int_2" type="int"/>
+ </sequence>
+ </complexType>
+ <complexType name="getOrderResponse">
+ <sequence>
+ <element name="result" type="tns:Order" nillable="true"/>
+ </sequence>
+ </complexType>
+ <complexType name="Order">
+ <sequence>
+ <element name="customer" type="tns:Customer" nillable="true"/>
+ <element name="lineItems" type="tns:LineItem" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
+ <element name="orderDate" type="dateTime" nillable="true"/>
+ <element name="orderId" type="int"/>
+ <element name="orderStatus" type="int"/>
+ <element name="orderTotalAmount" type="float"/>
+ </sequence>
+ </complexType>
+ <complexType name="Customer">
+ <sequence>
+ <element name="billingAddress" type="tns:Address" nillable="true"/>
+ <element name="contactFirstName" type="string" nillable="true"/>
+ <element name="contactLastName" type="string" nillable="true"/>
+ <element name="contactPhone" type="string" nillable="true"/>
+ <element name="creditCardExpirationDate" type="string" nillable="true"/>
+ <element name="creditCardNumber" type="string" nillable="true"/>
+ <element name="customerId" type="int"/>
+ <element name="lastActivityDate" type="dateTime" nillable="true"/>
+ <element name="shippingAddress" type="tns:Address" nillable="true"/>
+ </sequence>
+ </complexType>
+ <complexType name="Address">
+ <sequence>
+ <element name="address1" type="string" nillable="true"/>
+ <element name="address2" type="string" nillable="true"/>
+ <element name="city" type="string" nillable="true"/>
+ <element name="firstName" type="string" nillable="true"/>
+ <element name="lastName" type="string" nillable="true"/>
+ <element name="state" type="string" nillable="true"/>
+ <element name="zip" type="string" nillable="true"/>
+ </sequence>
+ </complexType>
+ <complexType name="LineItem">
+ <sequence>
+ <element name="itemId" type="int"/>
+ <element name="orderId" type="int"/>
+ <element name="orderQuantity" type="int"/>
+ <element name="productDescription" type="string" nillable="true"/>
+ <element name="productId" type="int"/>
+ <element name="unitPrice" type="float"/>
+ </sequence>
+ </complexType>
+ <element name="echoArrayOfSimpleUserType" type="tns:echoArrayOfSimpleUserType"/>
+ <element name="echoArrayOfSimpleUserTypeResponse" type="tns:echoArrayOfSimpleUserTypeResponse"/>
+ <element name="echoSimpleType" type="tns:echoSimpleType"/>
+ <element name="echoSimpleTypeResponse" type="tns:echoSimpleTypeResponse"/>
+ <element name="echoSynthetic" type="tns:echoSynthetic"/>
+ <element name="echoSyntheticResponse" type="tns:echoSyntheticResponse"/>
+ <element name="getOrder" type="tns:getOrder"/>
+ <element name="getOrderResponse" type="tns:getOrderResponse"/>
+ </schema>
+ </types>
+
+ <message name="BenchmarkService_echoArrayOfSimpleUserType">
+ <part name="parameters" element="ns2:echoArrayOfSimpleUserType"/>
+ </message>
+ <message name="BenchmarkService_echoArrayOfSimpleUserTypeResponse">
+ <part name="result" element="ns2:echoArrayOfSimpleUserTypeResponse"/>
+ </message>
+ <message name="BenchmarkService_echoSimpleType">
+ <part name="parameters" element="ns2:echoSimpleType"/>
+ </message>
+ <message name="BenchmarkService_echoSimpleTypeResponse">
+ <part name="result" element="ns2:echoSimpleTypeResponse"/>
+ </message>
+ <message name="BenchmarkService_echoSynthetic">
+ <part name="parameters" element="ns2:echoSynthetic"/>
+ </message>
+ <message name="BenchmarkService_echoSyntheticResponse">
+ <part name="result" element="ns2:echoSyntheticResponse"/>
+ </message>
+ <message name="BenchmarkService_getOrder">
+ <part name="parameters" element="ns2:getOrder"/>
+ </message>
+ <message name="BenchmarkService_getOrderResponse">
+ <part name="result" element="ns2:getOrderResponse"/>
+ </message>
+
+ <portType name="BenchmarkService">
+ <operation name="echoArrayOfSimpleUserType">
+ <input message="tns:BenchmarkService_echoArrayOfSimpleUserType"/>
+ <output message="tns:BenchmarkService_echoArrayOfSimpleUserTypeResponse"/>
+ </operation>
+ <operation name="echoSimpleType">
+ <input message="tns:BenchmarkService_echoSimpleType"/>
+ <output message="tns:BenchmarkService_echoSimpleTypeResponse"/>
+ </operation>
+ <operation name="echoSynthetic">
+ <input message="tns:BenchmarkService_echoSynthetic"/>
+ <output message="tns:BenchmarkService_echoSyntheticResponse"/>
+ </operation>
+ <operation name="getOrder">
+ <input message="tns:BenchmarkService_getOrder"/>
+ <output message="tns:BenchmarkService_getOrderResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="BenchmarkServiceBinding" type="tns:BenchmarkService">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="echoArrayOfSimpleUserType">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/></input>
+ <output>
+ <soap:body use="literal"/></output>
+
+ </operation>
+ <operation name="echoSimpleType">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/></input>
+ <output>
+ <soap:body use="literal"/></output>
+
+ </operation>
+ <operation name="echoSynthetic">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/></input>
+ <output>
+ <soap:body use="literal"/></output>
+
+ </operation>
+ <operation name="getOrder">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/></input>
+ <output>
+ <soap:body use="literal"/></output>
+ </operation>
+
+ </binding>
+ <service name="BenchmarkWebService">
+ <port name="BenchmarkServicePort" binding="tns:BenchmarkServiceBinding">
+ <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
+ </port>
+ </service>
+</definitions>
Added: trunk/testsuite/src/resources/scripts/web.xml
===================================================================
--- trunk/testsuite/src/resources/scripts/web.xml (rev 0)
+++ trunk/testsuite/src/resources/scripts/web.xml 2010-10-08 11:26:08 UTC (rev 108487)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app 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"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>TestService</servlet-name>
+ <servlet-class>org.jboss.test.scripts.support.EchoJavaBean</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Added: trunk/testsuite/src/resources/scripts/wstools-config.xml
===================================================================
--- trunk/testsuite/src/resources/scripts/wstools-config.xml (rev 0)
+++ trunk/testsuite/src/resources/scripts/wstools-config.xml 2010-10-08 11:26:08 UTC (rev 108487)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration xmlns="http://www.jboss.org/jbossws-tools"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+ <java-wsdl>
+ <service name="HelloService" style="rpc" endpoint="org.jboss.test.scripts.support.Hello"/>
+ <namespaces target-namespace="http://org.jboss.ws/testsuite" type-namespace="http://org.jboss.ws/testsuite/types"/>
+ <mapping file="jaxrpc-mapping.xml"/>
+ <webservices servlet-link="HelloService"/>
+ </java-wsdl>
+</configuration>
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list