Author: richard.opalka(a)jboss.com
Date: 2011-04-18 10:25:35 -0400 (Mon, 18 Apr 2011)
New Revision: 14153
Added:
common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/AntTaskHelper.java
common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/SecurityActions.java
common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSConsumeTask.java
common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSProvideTask.java
common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/
common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/Log4JUtil.java
common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/Log4jOutputStream.java
common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/SecurityActions.java
common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/WSConsume.java
common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/WSProvide.java
Removed:
common-tools/trunk/src/main/java/org/jboss/wsf/
Modified:
common-tools/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdConsumeTestCase.java
common-tools/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdProvideTestCase.java
common-tools/trunk/src/test/resources/smoke/tools/consume-test.xml
common-tools/trunk/src/test/resources/smoke/tools/provide-test.xml
Log:
[JBWS-3273] refactoring jbossws commont tools packages
* org.jboss.wsf.spi.tools.ant -> org.jboss.ws.tools.ant
* org.jboss.wsf.spi.tools.cmd -> org.jboss.ws.tools.cmd
Added: common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/AntTaskHelper.java
===================================================================
--- common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/AntTaskHelper.java
(rev 0)
+++ common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/AntTaskHelper.java 2011-04-18
14:25:35 UTC (rev 14153)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.ws.tools.ant;
+
+import org.apache.tools.ant.types.CommandlineJava.SysProperties;
+import org.apache.tools.ant.types.Environment.Variable;
+
+/**
+ * Helper class for ANT tasks.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+final class AntTaskHelper
+{
+ /**
+ * Constructor.
+ */
+ private AntTaskHelper()
+ {
+ // forbidden constructor
+ }
+
+ /**
+ * Converts array of JVM arguments to ANT SysProperties object.
+ *
+ * @param arguments to be converted.
+ * @return ANT SysProperties object.
+ */
+ static SysProperties toSystemProperties(final String[] arguments)
+ {
+ final SysProperties retVal = new SysProperties();
+
+ if (arguments != null && arguments.length != 0)
+ {
+ for (final String argument : arguments)
+ {
+ if (argument.startsWith("-D"))
+ {
+ Variable var = AntTaskHelper.toVariable(argument);
+ retVal.addVariable(var);
+ }
+ }
+ }
+
+ return retVal;
+ }
+
+ /**
+ * Converts JVM property of format -Dkey=value to ANT Variable object.
+ *
+ * @param argument to be converted
+ * @return ANT Variable object
+ */
+ private static Variable toVariable(final String argument)
+ {
+ final Variable retVal = new Variable();
+ final int equalSignIndex = argument.indexOf('=');
+
+ if (equalSignIndex == -1)
+ {
+ final String key = argument.substring(2);
+ retVal.setKey(key);
+ }
+ else
+ {
+ final String key = argument.substring(2, equalSignIndex);
+ retVal.setKey(key);
+ final String value = argument.substring(equalSignIndex + 1);
+ retVal.setValue(value);
+ }
+
+ return retVal;
+ }
+}
Added: common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/SecurityActions.java
===================================================================
--- common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/SecurityActions.java
(rev 0)
+++
common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/SecurityActions.java 2011-04-18
14:25:35 UTC (rev 14153)
@@ -0,0 +1,137 @@
+/*
+ * 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.ws.tools.ant;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+/**
+ * Security actions for this package
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 19-Jun-2009
+ *
+ */
+final class SecurityActions
+{
+ /**
+ * Get context classloader.
+ *
+ * @return the current context classloader
+ */
+ static ClassLoader getContextClassLoader()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
{
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+
+ /**
+ * Set context classloader.
+ *
+ * @param cl the classloader
+ * @return previous context classloader
+ * @throws Throwable for any error
+ */
+ static ClassLoader setContextClassLoader(final ClassLoader cl)
+ {
+ if (System.getSecurityManager() == null)
+ {
+ ClassLoader result = Thread.currentThread().getContextClassLoader();
+ if (cl != null)
+ Thread.currentThread().setContextClassLoader(cl);
+ return result;
+ }
+ else
+ {
+ try
+ {
+ return AccessController.doPrivileged(new
PrivilegedExceptionAction<ClassLoader>() {
+ public ClassLoader run() throws Exception
+ {
+ try
+ {
+ ClassLoader result =
Thread.currentThread().getContextClassLoader();
+ if (cl != null)
+ Thread.currentThread().setContextClassLoader(cl);
+ return result;
+ }
+ catch (Exception e)
+ {
+ throw e;
+ }
+ catch (Error e)
+ {
+ throw e;
+ }
+ catch (Throwable e)
+ {
+ throw new RuntimeException("Error setting context
classloader", e);
+ }
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw new RuntimeException("Error running privileged action",
e.getCause());
+ }
+ }
+ }
+
+ /**
+ * Get classloader from class.
+ *
+ * @param clazz the class
+ * @return class's classloader
+ */
+ static ClassLoader getClassLoader(final Class<?> clazz)
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return clazz.getClassLoader();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
{
+ public ClassLoader run()
+ {
+ return clazz.getClassLoader();
+ }
+ });
+ }
+ }
+
+}
Added: common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSConsumeTask.java
===================================================================
--- common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSConsumeTask.java
(rev 0)
+++ common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSConsumeTask.java 2011-04-18
14:25:35 UTC (rev 14153)
@@ -0,0 +1,366 @@
+/*
+ * 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.ws.tools.ant;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tools.ant.AntClassLoader;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.ExecuteJava;
+import org.apache.tools.ant.taskdefs.LogOutputStream;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.CommandlineJava;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.CommandlineJava.SysProperties;
+import org.jboss.wsf.spi.tools.WSContractConsumer;
+
+/**
+ * Ant task which consumes a Web Service contract.
+ *
+ * <table border="1">
+ * <tr align="left" BGCOLOR="#CCCCFF"
CLASS="TableHeadingColor"><th>Attribute</th><th>Description</th><th>Default</th></tr>
+ * <tr><td>fork</td><td>Whether or not to run the generation
task in a separate VM.</td><td>true</td></tr>
+ * <tr><td>keep</td><td>Keep/Enable Java source code
generation.</td><td>false</td></tr>
+ * <tr><td>catalog</td><td> Oasis XML Catalog file for entity
resolution</td><td>none</td></tr>
+ * <tr><td>package</td><td> The target Java package for
generated code.</td><td>generated</td></tr>
+ * <tr><td>binding</td><td>A JAX-WS or JAXB binding
file</td><td>none</td></tr>
+ * <tr><td>wsdlLocation</td><td>Value to use for
@(a)WebService.wsdlLocation</td><td>generated</td></tr>
+ * <tr><td>destdir</td><td>The output directory for generated
artifacts.</td><td>"output"</td></tr>
+ * <tr><td>sourcedestdir</td><td>The output directory for Java
source.</td><td>value of destdir</td></tr>
+ * <tr><td>extension</td><td>Enable SOAP 1.2 binding
extension.</td><td>false</td></tr>
+ * <tr><td>target</td><td>The JAX-WS specification target.
Allowed values are 2.0, 2.1 and 2.2</td><td></td></tr>
+ * <tr><td>verbose</td><td>Enables more informational output
about cmd progress.</td><td>false</td><tr>
+ * <tr><td>wsdl*</td><td>The WSDL file or
URL</td><td>n/a</td><tr>
+ * </table>
+ * <b>* = required.</b>
+ *
+ * <p>Example:
+ *
+ * <pre>
+ * <WSConsumeTask
+ * fork="true"
+ * verbose="true"
+ * destdir="output"
+ * sourcedestdir="gen-src"
+ * keep="true"
+ * wsdllocation="handEdited.wsdl"
+ * wsdl="foo.wsdl">
+ * <binding dir="binding-files"
includes="*.xml" excludes="bad.xml"/>
+ * </wsimport>
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public class WSConsumeTask extends Task
+{
+ private CommandlineJava command = new CommandlineJava();
+ private String wsdl;
+ private File destdir;
+ private File sourcedestdir;
+ private List<File> bindingFiles = new ArrayList<File>();
+ private File catalog;
+ private String wsdlLocation;
+ private String targetPackage;
+ private boolean keep;
+ private boolean extension;
+ private boolean verbose;
+ private boolean fork;
+ private boolean debug;
+ private boolean nocompile;
+ private boolean additionalHeaders;
+ private String target;
+
+ // Not actually used right now
+ public void setDebug(boolean debug)
+ {
+ this.debug = debug;
+ }
+
+ public Commandline.Argument createJvmarg()
+ {
+ return command.createVmArgument();
+ }
+
+ public void setBinding(File bindingFile)
+ {
+ bindingFiles.add(bindingFile);
+ }
+
+ public void setCatalog(File catalog)
+ {
+ this.catalog = catalog;
+ }
+
+ public void setDestdir(File destdir)
+ {
+ this.destdir = destdir;
+ }
+
+ public void setFork(boolean fork)
+ {
+ this.fork = fork;
+ }
+
+ public void setKeep(boolean keep)
+ {
+ this.keep = keep;
+ }
+
+ public void setExtension(boolean extension)
+ {
+ this.extension = extension;
+ }
+
+ public void setAdditionalHeaders(boolean additionalHeaders)
+ {
+ this.additionalHeaders = additionalHeaders;
+ }
+
+ public void setSourcedestdir(File sourcedestdir)
+ {
+ this.sourcedestdir = sourcedestdir;
+ }
+
+ public void setTarget(String target)
+ {
+ this.target = target;
+ }
+
+ public void setPackage(String targetPackage)
+ {
+ this.targetPackage = targetPackage;
+ }
+
+ public void setVerbose(boolean verbose)
+ {
+ this.verbose = verbose;
+ }
+
+ public void setNoCompile(boolean nocompile)
+ {
+ this.nocompile = nocompile;
+ }
+
+ public void setWsdl(String wsdl)
+ {
+ this.wsdl = wsdl;
+ }
+
+ public void setWsdlLocation(String wsdlLocation)
+ {
+ this.wsdlLocation = wsdlLocation;
+ }
+
+ public void addConfiguredBinding(FileSet fs)
+ {
+ DirectoryScanner ds = fs.getDirectoryScanner(getProject());
+ File baseDir = ds.getBasedir();
+ for (String file : ds.getIncludedFiles())
+ {
+ bindingFiles.add(new File(baseDir, file));
+ }
+ }
+
+ public void executeNonForked()
+ {
+ ClassLoader prevCL = SecurityActions.getContextClassLoader();
+ ClassLoader antLoader = SecurityActions.getClassLoader(this.getClass());
+ SecurityActions.setContextClassLoader(antLoader);
+ try
+ {
+ WSContractConsumer consumer = WSContractConsumer.newInstance();
+ consumer.setGenerateSource(keep);
+ consumer.setExtension(extension);
+ consumer.setAdditionalHeaders(additionalHeaders);
+ consumer.setNoCompile(nocompile);
+ if (destdir != null)
+ consumer.setOutputDirectory(destdir);
+ if (sourcedestdir != null)
+ consumer.setSourceDirectory(sourcedestdir);
+ if (targetPackage != null)
+ consumer.setTargetPackage(targetPackage);
+ if (wsdlLocation != null)
+ consumer.setWsdlLocation(wsdlLocation);
+ if (catalog != null)
+ {
+ if (catalog.exists() && catalog.isFile())
+ {
+ consumer.setCatalog(catalog);
+ }
+ else
+ {
+ log("Catalog file not found: " + catalog, Project.MSG_WARN);
+ }
+ }
+ if (bindingFiles != null && bindingFiles.size() > 0)
+ consumer.setBindingFiles(bindingFiles);
+ if (target != null)
+ consumer.setTarget(target);
+
+ log("Consuming wsdl: " + wsdl, Project.MSG_INFO);
+
+ if (verbose)
+ {
+ consumer.setMessageStream(new PrintStream(new LogOutputStream(this,
Project.MSG_INFO)));
+ }
+
+ try
+ {
+ consumer.setAdditionalCompilerClassPath(getTaskClassPathStrings());
+ consumer.consume(wsdl);
+ }
+ catch (Throwable e)
+ {
+ throw new BuildException(e, getLocation());
+ }
+ }
+ finally
+ {
+ SecurityActions.setContextClassLoader(prevCL);
+ }
+ }
+
+ public void execute() throws BuildException
+ {
+ if (wsdl == null)
+ throw new BuildException("The wsdl attribute must be specified!",
getLocation());
+
+ if (fork)
+ executeForked();
+ else executeNonForked();
+ }
+
+ private Path getTaskClassPath()
+ {
+ // Why is everything in the Ant API a big hack???
+ ClassLoader cl = SecurityActions.getClassLoader(this.getClass());
+ if (cl instanceof AntClassLoader)
+ {
+ return new Path(getProject(), ((AntClassLoader)cl).getClasspath());
+ }
+
+ return new Path(getProject());
+ }
+
+ private List<String> getTaskClassPathStrings()
+ {
+ // Why is everything in the Ant API a big hack???
+ List<String> strings = new ArrayList<String>();
+ ClassLoader cl = SecurityActions.getClassLoader(this.getClass());
+ if (cl instanceof AntClassLoader)
+ {
+ for (String string :
((AntClassLoader)cl).getClasspath().split(File.pathSeparator))
+ strings.add(string);
+ }
+
+ return strings;
+ }
+
+ private void executeForked() throws BuildException
+ {
+ command.setClassname(org.jboss.ws.tools.cmd.WSConsume.class.getName());
+
+ Path path = command.createClasspath(getProject());
+ path.append(getTaskClassPath());
+
+ if (keep)
+ command.createArgument().setValue("-k");
+
+ if (extension)
+ command.createArgument().setValue("-e");
+
+ if (additionalHeaders)
+ command.createArgument().setValue("-a");
+
+ for (File file : bindingFiles)
+ {
+ command.createArgument().setValue("-b");
+ command.createArgument().setFile(file);
+ }
+
+ if (catalog != null)
+ {
+ command.createArgument().setValue("-c");
+ command.createArgument().setFile(catalog);
+ }
+
+ if (targetPackage != null)
+ {
+ command.createArgument().setValue("-p");
+ command.createArgument().setValue(targetPackage);
+ }
+
+ if (wsdlLocation != null)
+ {
+ command.createArgument().setValue("-w");
+ command.createArgument().setValue(wsdlLocation);
+ }
+
+ if (destdir != null)
+ {
+ command.createArgument().setValue("-o");
+ command.createArgument().setFile(destdir);
+ }
+
+ if (sourcedestdir != null)
+ {
+ command.createArgument().setValue("-s");
+ command.createArgument().setFile(sourcedestdir);
+ }
+
+ if (target != null)
+ {
+ command.createArgument().setValue("-t");
+ command.createArgument().setValue(target);
+ }
+
+ if (verbose)
+ command.createArgument().setValue("-v");
+
+ command.createArgument().setValue(wsdl);
+
+ log("Consuming wsdl: " + wsdl, Project.MSG_INFO);
+
+ if (verbose)
+ log("Command invoked: " + command.getJavaCommand().toString());
+
+ ExecuteJava execute = new ExecuteJava();
+ execute.setClasspath(path);
+ execute.setJavaCommand(command.getJavaCommand());
+
+ // propagate system properties (useful e.g. for endorsing)
+ String[] arguments = command.getVmCommand().getArguments();
+ SysProperties properties = AntTaskHelper.toSystemProperties(arguments);
+ execute.setSystemProperties(properties);
+
+ if (execute.fork(this) != 0)
+ throw new BuildException("Could not invoke WSConsumeTask",
getLocation());
+ }
+}
Added: common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSProvideTask.java
===================================================================
--- common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSProvideTask.java
(rev 0)
+++ common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSProvideTask.java 2011-04-18
14:25:35 UTC (rev 14153)
@@ -0,0 +1,331 @@
+/*
+ * 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.ws.tools.ant;
+
+import org.apache.tools.ant.AntClassLoader;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.ExecuteJava;
+import org.apache.tools.ant.taskdefs.LogOutputStream;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.CommandlineJava;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.Reference;
+import org.apache.tools.ant.types.CommandlineJava.SysProperties;
+import org.apache.tools.ant.types.Environment.Variable;
+import org.jboss.wsf.spi.tools.WSContractProvider;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.URLClassLoader;
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.util.StringTokenizer;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * Ant task which invokes provides a Web Service contract and portable JAX-WS wrapper
classes.
+ *
+ * <table border="1">
+ * <tr align="left" BGCOLOR="#CCCCFF"
CLASS="TableHeadingColor"><th>Attribute</th><th>Description</th><th>Default</th></tr>
+ * <tr><td>fork</td><td>Whether or not to run the generation
task in a separate VM.</td><td>true</td></tr>
+ * <tr><td>keep</td><td>Keep/Enable Java source code
generation.</td><td>false</td></tr>
+ * <tr><td>destdir</td><td>The output directory for generated
artifacts.</td><td>"output"</td></tr>
+ * <tr><td>resourcedestdir</td><td>The output directory for
resource artifacts (WSDL/XSD).</td><td>value of destdir</td></tr>
+ * <tr><td>sourcedestdir</td><td>The output directory for Java
source.</td><td>value of destdir</td></tr>
+ * <tr><td>genwsdl</td><td>Whether or not to generate
WSDL.</td><td>false</td><tr>
+ * <tr><td>extension</td><td>Enable SOAP 1.2 binding
extension.</td><td>false</td></tr>
+ * <tr><td>verbose</td><td>Enables more informational output
about cmd progress.</td><td>false</td><tr>
+ * <tr><td>sei</td><td>Service Endpoint
Implementation.</td><td></td><tr>
+ * <tr><td>classpath</td><td>The classpath that contains the
service endpoint implementation.</td><td>""</tr>
+ * </table>
+ * <b>* = required.</b>
+ *
+ * <p>Example:
+ *
+ * <pre>
+ * <target name="test-wsproivde"
depends="init">
+ * <taskdef name="WSProvideTask"
classname="org.jboss.ws.tools.ant.WSProvideTask">
+ * <classpath refid="core.classpath"/>
+ * </taskdef>
+ * <WSProvideTask
+ * fork="false"
+ * keep="true"
+ * destdir="out"
+ * resourcedestdir="out-resource"
+ * sourcedestdir="out-source"
+ * genwsdl="true"
+ * extension="true"
+ * verbose="true"
+ *
sei="org.jboss.test.ws.jaxws.jsr181.soapbinding.DocWrappedServiceImpl">
+ * <classpath>
+ * <pathelement
path="${tests.output.dir}/classes"/>
+ * </classpath>
+ * </WSProvideTask>
+ * </target>
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public class WSProvideTask extends Task
+{
+ private Path classpath = new Path(getProject());
+ private CommandlineJava command = new CommandlineJava();
+ private String sei;
+ private File destdir;
+ private File resourcedestdir;
+ private File sourcedestdir;
+ private boolean keep;
+ private boolean extension;
+ private boolean genwsdl;
+ private boolean verbose;
+ private boolean fork;
+ private boolean debug;
+
+ // Not actually used right now
+ public void setDebug(boolean debug)
+ {
+ this.debug = debug;
+ }
+
+ public Commandline.Argument createJvmarg()
+ {
+ return command.createVmArgument();
+ }
+
+ public void setClasspath(Path classpath)
+ {
+ this.classpath = classpath;
+ }
+
+ public void setClasspathRef(Reference ref)
+ {
+ createClasspath().setRefid(ref);
+ }
+
+ public Path createClasspath()
+ {
+ return classpath;
+ }
+
+ public void setDestdir(File destdir)
+ {
+ this.destdir = destdir;
+ }
+
+ public void setExtension(boolean extension)
+ {
+ this.extension = extension;
+ }
+
+ public void setProtocol(String protocol)
+ {
+ if (protocol != null)
+ {
+ this.extension = protocol.toLowerCase().indexOf("Xsoap1.2") != -1;
+ }
+ }
+
+ public void setKeep(boolean keep)
+ {
+ this.keep = keep;
+ }
+
+ public void setSei(String sei)
+ {
+ this.sei = sei;
+ }
+
+ public void setFork(boolean fork)
+ {
+ this.fork = fork;
+ }
+
+ public void setResourcedestdir(File resourcedestdir)
+ {
+ this.resourcedestdir = resourcedestdir;
+ }
+
+ public void setSourcedestdir(File sourcedestdir)
+ {
+ this.sourcedestdir = sourcedestdir;
+ }
+
+ public void setVerbose(boolean verbose)
+ {
+ this.verbose = verbose;
+ }
+
+ public void setGenwsdl(boolean genwsdl)
+ {
+ this.genwsdl = genwsdl;
+ }
+
+ private ClassLoader getClasspathLoader(ClassLoader parent)
+ {
+ AntClassLoader antLoader = new AntClassLoader(parent, getProject(), classpath, false);
+
+ // It's necessary to wrap it into an URLLoader in order to extract that
information
+ // within the actual provider impl.
+ // See SunRIProviderImpl for instance
+ List<URL> urls = new ArrayList<URL>();
+ StringTokenizer tok = new StringTokenizer(antLoader.getClasspath(), File.separator);
+ while(tok.hasMoreTokens())
+ {
+ try
+ {
+ String path = tok.nextToken();
+ if(!path.startsWith("file://"))
+ path = "file://"+path;
+
+ urls.add(new URL(path));
+ }
+ catch (MalformedURLException e)
+ {
+ throw new IllegalArgumentException("Failed to wrap classloader", e);
+ }
+
+ }
+
+ ClassLoader wrapper = new URLClassLoader(urls.toArray(new URL[0]), antLoader);
+ return wrapper;
+ }
+
+ public void executeNonForked()
+ {
+ ClassLoader prevCL = SecurityActions.getContextClassLoader();
+ ClassLoader antLoader = SecurityActions.getClassLoader(this.getClass());
+ SecurityActions.setContextClassLoader(antLoader);
+ try
+ {
+ WSContractProvider gen = WSContractProvider.newInstance(
+ getClasspathLoader(antLoader)
+ );
+ if (verbose)
+ gen.setMessageStream(new PrintStream(new LogOutputStream(this,
Project.MSG_INFO)));
+ gen.setGenerateSource(keep);
+ gen.setGenerateWsdl(genwsdl);
+ gen.setExtension(extension);
+
+ if (destdir != null)
+ gen.setOutputDirectory(destdir);
+ if (resourcedestdir != null)
+ gen.setResourceDirectory(resourcedestdir);
+ if (sourcedestdir != null)
+ gen.setSourceDirectory(sourcedestdir);
+
+ log("Generating from endpoint: " + sei, Project.MSG_INFO);
+
+ gen.provide(sei);
+ }
+ catch(Throwable t)
+ {
+ throw new BuildException(t, getLocation());
+ }
+ finally
+ {
+ SecurityActions.setContextClassLoader(prevCL);
+ }
+ }
+
+ public void execute() throws BuildException
+ {
+ if (sei == null)
+ throw new BuildException("The sei attribute must be specified!",
getLocation());
+
+ if (fork)
+ executeForked();
+ else
+ executeNonForked();
+ }
+
+ private Path getTaskClassPath()
+ {
+ // Why is everything in the Ant API a big hack???
+ ClassLoader cl = this.getClass().getClassLoader();
+ if (cl instanceof AntClassLoader)
+ {
+ return new Path(getProject(), ((AntClassLoader)cl).getClasspath());
+ }
+
+ return new Path(getProject());
+ }
+
+ private void executeForked() throws BuildException
+ {
+ command.setClassname(org.jboss.ws.tools.cmd.WSProvide.class.getName());
+
+ Path path = command.createClasspath(getProject());
+ path.append(getTaskClassPath());
+ path.append(classpath);
+
+ if (keep)
+ command.createArgument().setValue("-k");
+
+ if (genwsdl)
+ command.createArgument().setValue("-w");
+
+ if (extension)
+ command.createArgument().setValue("-e");
+
+ if (destdir != null)
+ {
+ command.createArgument().setValue("-o");
+ command.createArgument().setFile(destdir);
+ }
+ if (resourcedestdir != null)
+ {
+ command.createArgument().setValue("-r");
+ command.createArgument().setFile(resourcedestdir);
+ }
+ if (sourcedestdir != null)
+ {
+ command.createArgument().setValue("-s");
+ command.createArgument().setFile(sourcedestdir);
+ }
+
+ if (!verbose)
+ command.createArgument().setValue("-q");
+
+ // Always dump traces
+ command.createArgument().setValue("-t");
+ command.createArgument().setValue(sei);
+
+ if (verbose)
+ log("Command invoked: " + command.getJavaCommand().toString());
+
+ ExecuteJava execute = new ExecuteJava();
+ execute.setClasspath(path);
+ execute.setJavaCommand(command.getJavaCommand());
+
+ // propagate system properties (useful e.g. for endorsing)
+ String[] arguments = command.getVmCommand().getArguments();
+ SysProperties properties = AntTaskHelper.toSystemProperties(arguments);
+ execute.setSystemProperties(properties);
+
+ if (execute.fork(this) != 0)
+ throw new BuildException("Could not invoke WSProvideTask",
getLocation());
+ }
+}
Added: common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/Log4JUtil.java
===================================================================
--- common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/Log4JUtil.java
(rev 0)
+++ common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/Log4JUtil.java 2011-04-18
14:25:35 UTC (rev 14153)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.ws.tools.cmd;
+
+import java.net.URL;
+
+import org.apache.log4j.helpers.Loader;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 10-Jun-2010
+ *
+ */
+final class Log4JUtil
+{
+ public static final String LOG4J_CONFIGURATION = "log4j.configuration";
+ public static final String LOG4J_PROPERTIES = "log4j.properties";
+
+ private Log4JUtil()
+ {
+ // forbidden instantiation
+ }
+
+ /**
+ * Returns true if a log4j configuration can be found given the current environment.
+ * See
http://logging.apache.org/log4j/1.2/manual.html (Default Initialization
Procedure)
+ * @return
+ */
+ public static boolean isLog4jConfigurationAvailable()
+ {
+ String log4jConfiguration = System.getProperty(LOG4J_CONFIGURATION);
+ String resource = log4jConfiguration != null ? log4jConfiguration :
LOG4J_PROPERTIES;
+ URL url = null;
+ try
+ {
+ url = new URL(resource);
+ }
+ catch (Exception e1)
+ {
+ try
+ {
+ url = Loader.getResource(resource);
+ }
+ catch (Exception e2)
+ {
+ //ignore
+ }
+ }
+ return url != null;
+ }
+}
Added: common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/Log4jOutputStream.java
===================================================================
--- common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/Log4jOutputStream.java
(rev 0)
+++
common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/Log4jOutputStream.java 2011-04-18
14:25:35 UTC (rev 14153)
@@ -0,0 +1,220 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.ws.tools.cmd;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import org.apache.log4j.Category;
+import org.apache.log4j.Priority;
+
+/**
+ * An OutputStream that flushes out to a Category.<p>
+ * A simple port of <a href="mailto://Jim.Moore@rocketmail.com">Jim
Moore</a>'s
+ * LoggingOutputStream contribution to log4j.
+ *
+ * Note that no data is written out to the Category until the stream is
+ * flushed or closed.<p>
+ *
+ * Example:<pre>
+ * // make sure everything sent to System.err is logged
+ * System.setErr(new PrintStream(new LoggingOutputStream(Category.getRoot(),
Priority.WARN), true));
+ *
+ * // make sure everything sent to System.out is also logged
+ * System.setOut(new PrintStream(new LoggingOutputStream(Category.getRoot(),
Priority.INFO), true));
+ * </pre>
+ *
+ */
+final class Log4jOutputStream extends OutputStream
+{
+ protected static final String LINE_SEPERATOR =
System.getProperty("line.separator");
+
+ /**
+ * Used to maintain the contract of {@link #close()}.
+ */
+ protected boolean hasBeenClosed = false;
+
+ /**
+ * The internal buffer where data is stored.
+ */
+ protected byte[] buf;
+
+ /**
+ * The number of valid bytes in the buffer. This value is always
+ * in the range <tt>0</tt> through <tt>buf.length</tt>;
elements
+ * <tt>buf[0]</tt> through <tt>buf[count-1]</tt> contain
valid
+ * byte data.
+ */
+ protected int count;
+
+ /**
+ * Remembers the size of the buffer for speed.
+ */
+ private int bufLength;
+
+ /**
+ * The default number of bytes in the buffer. =2048
+ */
+ public static final int DEFAULT_BUFFER_LENGTH = 2048;
+
+ /**
+ * The category to write to.
+ */
+ protected Category category;
+
+ /**
+ * The priority to use when writing to the Category.
+ */
+ protected Priority priority;
+
+ @SuppressWarnings("unused")
+ private Log4jOutputStream()
+ {
+ // illegal
+ }
+
+ /**
+ * Creates the LoggingOutputStream to flush to the given Category.
+ *
+ * @param cat the Category to write to
+ *
+ * @param priority the Priority to use when writing to the Category
+ *
+ * @exception IllegalArgumentException
+ * if cat == null or priority == null
+ */
+ public Log4jOutputStream(Category cat, Priority priority) throws
IllegalArgumentException
+ {
+ if (cat == null)
+ {
+ throw new IllegalArgumentException("cat == null");
+ }
+ if (priority == null)
+ {
+ throw new IllegalArgumentException("priority == null");
+ }
+
+ this.priority = priority;
+ category = cat;
+ bufLength = DEFAULT_BUFFER_LENGTH;
+ buf = new byte[DEFAULT_BUFFER_LENGTH];
+ count = 0;
+ }
+
+ /**
+ * Closes this output stream and releases any system resources
+ * associated with this stream. The general contract of
<code>close</code>
+ * is that it closes the output stream. A closed stream cannot perform
+ * output operations and cannot be reopened.
+ */
+ public void close()
+ {
+ flush();
+ hasBeenClosed = true;
+ }
+
+ /**
+ * Writes the specified byte to this output stream. The general
+ * contract for <code>write</code> is that one byte is written
+ * to the output stream. The byte to be written is the eight
+ * low-order bits of the argument <code>b</code>. The 24
+ * high-order bits of <code>b</code> are ignored.
+ *
+ * @param b the <code>byte</code> to write
+ *
+ * @exception IOException
+ * if an I/O error occurs. In particular,
+ * an <code>IOException</code> may be thrown if the
+ * output stream has been closed.
+ */
+ public void write(final int b) throws IOException
+ {
+ if (hasBeenClosed)
+ {
+ throw new IOException("The stream has been closed.");
+ }
+
+ // don't log nulls
+ if (b == 0)
+ {
+ return;
+ }
+
+ // would this be writing past the buffer?
+ if (count == bufLength)
+ {
+ // grow the buffer
+ final int newBufLength = bufLength + DEFAULT_BUFFER_LENGTH;
+ final byte[] newBuf = new byte[newBufLength];
+
+ System.arraycopy(buf, 0, newBuf, 0, bufLength);
+
+ buf = newBuf;
+ bufLength = newBufLength;
+ }
+
+ buf[count] = (byte)b;
+ count++;
+ }
+
+ /**
+ * Flushes this output stream and forces any buffered output bytes
+ * to be written out. The general contract of <code>flush</code> is
+ * that calling it is an indication that, if any bytes previously
+ * written have been buffered by the implementation of the output
+ * stream, such bytes should immediately be written to their
+ * intended destination.
+ */
+ public void flush()
+ {
+ if (count == 0)
+ {
+ return;
+ }
+
+ // don't print out blank lines; flushing from PrintStream puts out these
+ if (count == LINE_SEPERATOR.length())
+ {
+ if (((char)buf[0]) == LINE_SEPERATOR.charAt(0) && ((count == 1) || //
<- Unix & Mac, -> Windows
+ ((count == 2) && ((char)buf[1]) == LINE_SEPERATOR.charAt(1))))
+ {
+ reset();
+ return;
+ }
+ }
+
+ final byte[] theBytes = new byte[count];
+
+ System.arraycopy(buf, 0, theBytes, 0, count);
+
+ category.log(priority, new String(theBytes));
+
+ reset();
+ }
+
+ private void reset()
+ {
+ // not resetting the buffer -- assuming that if it grew that it
+ // will likely grow similarly again
+ count = 0;
+ }
+
+}
Added: common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/SecurityActions.java
===================================================================
--- common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/SecurityActions.java
(rev 0)
+++
common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/SecurityActions.java 2011-04-18
14:25:35 UTC (rev 14153)
@@ -0,0 +1,177 @@
+/*
+ * 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.ws.tools.cmd;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+/**
+ * Security actions for this package
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 19-Jun-2009
+ *
+ */
+class SecurityActions
+{
+ /**
+ * Get context classloader.
+ *
+ * @return the current context classloader
+ */
+ static ClassLoader getContextClassLoader()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
{
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+
+ /**
+ * Set context classloader.
+ *
+ * @param classLoader the classloader
+ */
+ static void setContextClassLoader(final ClassLoader classLoader)
+ {
+ if (System.getSecurityManager() == null)
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ }
+ else
+ {
+ AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ return null;
+ }
+ });
+ }
+ }
+
+ static ClassLoader getModulesClassLoader()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return getModulesClassLoaderInternal();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
{
+ public ClassLoader run()
+ {
+ return getModulesClassLoaderInternal();
+ }
+ });
+ }
+ }
+
+ private static ClassLoader getModulesClassLoaderInternal()
+ {
+ // TODO: use SPI class loader facade, not reflection!
+ try {
+ Class<?> moduleClass =
Class.forName("org.jboss.modules.Module");
+ Class<?> moduleIdentifierClass =
Class.forName("org.jboss.modules.ModuleIdentifier");
+ Class<?> moduleLoaderClass =
Class.forName("org.jboss.modules.ModuleLoader");
+ Object moduleLoader =
moduleClass.getMethod("getBootModuleLoader").invoke(null);
+ Object moduleIdentifier = moduleIdentifierClass.getMethod("create",
String.class).invoke(null, "org.jboss.as.webservices.server.integration");
+ Object module = moduleLoaderClass.getMethod("loadModule",
moduleIdentifierClass).invoke(moduleLoader, moduleIdentifier);
+ return
(ClassLoader)moduleClass.getMethod("getClassLoader").invoke(module);
+ } catch (Exception e) {
+ //ignore, JBoss Modules might not be available at all
+ return null;
+ }
+ }
+
+ /**
+ * Load a class using the provided classloader
+ *
+ * @param name
+ * @return
+ * @throws PrivilegedActionException
+ */
+ static Class<?> loadClass(final ClassLoader cl, final String name) throws
PrivilegedActionException, ClassNotFoundException
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return cl.loadClass(name);
+ }
+ else
+ {
+ return AccessController.doPrivileged(new
PrivilegedExceptionAction<Class<?>>() {
+ public Class<?> run() throws PrivilegedActionException
+ {
+ try
+ {
+ return cl.loadClass(name);
+ }
+ catch (Exception e)
+ {
+ throw new PrivilegedActionException(e);
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ * Get a system property
+ *
+ * @param name
+ * @param defaultValue
+ * @return
+ */
+ static String getSystemProperty(final String name, final String defaultValue)
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return System.getProperty(name, defaultValue);
+ }
+ else
+ {
+ PrivilegedAction<String> action = new PrivilegedAction<String>() {
+ public String run()
+ {
+ return System.getProperty(name, defaultValue);
+ }
+ };
+ return AccessController.doPrivileged(action);
+ }
+ }
+}
Added: common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/WSConsume.java
===================================================================
--- common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/WSConsume.java
(rev 0)
+++ common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/WSConsume.java 2011-04-18
14:25:35 UTC (rev 14153)
@@ -0,0 +1,333 @@
+/*
+ * 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.ws.tools.cmd;
+
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.Level;
+
+import org.jboss.wsf.spi.tools.WSContractConsumer;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * WSConsumeTask is a cmd line tool that generates portable JAX-WS artifacts
+ * from a WSDL file.
+ *
+ * <pre>
+ * usage: WSConsumeTask [options] <wsdl-url>
+ * options:
+ * <table>
+ * <tr><td>-h, --help </td><td>Show this
help message</td></tr>
+ * <tr><td>-b, --binding=<file> </td><td>One
or more JAX-WS or JAXB binding files</td></tr>
+ * <tr><td>-k, --keep
</td><td>Keep/Generate Java source</td></tr>
+ * <tr><td>-c, --catalog=<file>
</td><td>Oasis XML Catalog file for entity resolution</td></tr>
+ * <tr><td>-p, --package=<name> </td><td>The
target package for generated source</td></tr>
+ * <tr><td>-w, --wsdlLocation=<loc>
</td><td>Value to use for @(a)WebService.wsdlLocation</td></tr>
+ * <tr><td>-o, --output=<directory> </td><td>The
directory to put generated artifacts</td></tr>
+ * <tr><td>-s, --source=<directory> </td><td>The
directory to put Java source</td></tr>
+ * <tr><td>-t, --target=<2.0|2.1|2.2></td><td>The
target specification target</td></tr>
+ * <tr><td>-n, --nocompile </td><td>Do not
compile generated sources</td></tr>
+ * <tr><td>-q, --quiet </td><td>Be somewhat
more quiet</td></tr>
+ * <tr><td>-v, --verbose </td><td>Show full
exception stack traces</td></tr>
+ * <tr><td>-l, --load-consumer </td><td>Load the
consumer and exit (debug utility)</td></tr>
+ * <tr><td>-e, --extension </td><td>Enable SOAP
1.2 binding extension</td></tr>
+ * <tr><td>-a, --additionalHeaders </td><td>Enable SOAP
1.2 binding extension</td></tr>
+ * </table>
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ */
+public class WSConsume
+{
+ private static final ClassLoader MODULES_LOADER =
SecurityActions.getModulesClassLoader();
+ private List<File> bindingFiles = new ArrayList<File>();
+ private File outputDir = new File("output");
+ private boolean generateSource;
+ private File catalog;
+ private String targetPackage;
+ private String wsdlLocation;
+ private boolean quiet;
+ private boolean verbose;
+ private boolean loadConsumer;
+ private boolean extension;
+ private boolean additionalHeaders;
+ private boolean noCompile;
+ private File sourceDir;
+ private String target;
+
+ public static final String PROGRAM_NAME =
SecurityActions.getSystemProperty("program.name", WSConsume.class.getName());
+
+ public static void main(String[] args)
+ {
+ if (MODULES_LOADER != null)
+ {
+ final ClassLoader origLoader = SecurityActions.getContextClassLoader();
+ try
+ {
+ SecurityActions.setContextClassLoader(MODULES_LOADER);
+ mainInternal(args);
+ }
+ finally
+ {
+ SecurityActions.setContextClassLoader(origLoader);
+ }
+ }
+ else
+ {
+ mainInternal(args);
+ }
+ }
+
+ private static void mainInternal(final String[] args)
+ {
+ WSConsume importer = new WSConsume();
+ URL wsdl = importer.parseArguments(args);
+ System.exit(importer.importServices(wsdl));
+ }
+
+ private URL parseArguments(String[] args)
+ {
+ String shortOpts = "b:c:p:w:o:s:t:khqvlnea";
+ LongOpt[] longOpts =
+ {
+ new LongOpt("binding", LongOpt.REQUIRED_ARGUMENT, null, 'b'),
+ new LongOpt("catalog", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
+ new LongOpt("package", LongOpt.REQUIRED_ARGUMENT, null, 'p'),
+ new LongOpt("wsdlLocation", LongOpt.REQUIRED_ARGUMENT, null,
'w'),
+ new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
+ new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
+ new LongOpt("target", LongOpt.REQUIRED_ARGUMENT, null, 't'),
+ new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
+ new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
+ new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
+ new LongOpt("verbose", LongOpt.NO_ARGUMENT, null, 'v'),
+ new LongOpt("nocompile", LongOpt.NO_ARGUMENT, null, 'n'),
+ new LongOpt("extension", LongOpt.NO_ARGUMENT, null, 'e'),
+ new LongOpt("additionalHeaders", LongOpt.NO_ARGUMENT, null,
'a'),
+ new LongOpt("load-consumer", LongOpt.NO_ARGUMENT, null, 'l'),
+ };
+
+ Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
+ int c;
+ while ((c = getopt.getopt()) != -1)
+ {
+ switch (c)
+ {
+ case 'b':
+ bindingFiles.add(new File(getopt.getOptarg()));
+ break;
+ case 'k':
+ generateSource = true;
+ break;
+ case 'c':
+ catalog = new File(getopt.getOptarg());
+ break;
+ case 'p':
+ targetPackage = getopt.getOptarg();
+ break;
+ case 'w':
+ wsdlLocation = getopt.getOptarg();
+ break;
+ case 'o':
+ outputDir = new File(getopt.getOptarg());
+ break;
+ case 's':
+ sourceDir = new File(getopt.getOptarg());
+ break;
+ case 't':
+ target = getopt.getOptarg();
+ break;
+ case 'q':
+ quiet = true;
+ break;
+ case 'v':
+ verbose = true;
+ break;
+ case 'l':
+ loadConsumer = true;
+ break;
+ case 'e':
+ extension = true;
+ break;
+ case 'a':
+ additionalHeaders = true;
+ break;
+ case 'n':
+ noCompile = true;
+ break;
+ case 'h':
+ printHelp();
+ System.exit(0);
+ case '?':
+ System.exit(1);
+ }
+ }
+
+ // debug output
+ if(loadConsumer)
+ {
+ WSContractConsumer importer = WSContractConsumer.newInstance();
+ System.out.println("WSContractConsumer instance: " +
importer.getClass().getCanonicalName());
+ System.exit(0);
+ }
+
+ int wsdlPos = getopt.getOptind();
+ if (wsdlPos >= args.length)
+ {
+ System.err.println("Error: WSDL URL was not specified!");
+ printHelp();
+ System.exit(1);
+ }
+
+ URL url = null;
+ try
+ {
+ try
+ {
+ url = new URL(args[wsdlPos]);
+ }
+ catch (MalformedURLException e)
+ {
+ File file = new File(args[wsdlPos]);
+ url = file.toURI().toURL();
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ System.err.println("Error: Invalid URI: " + args[wsdlPos]);
+ System.exit(1);
+ }
+
+ return url;
+ }
+
+
+ private int importServices(URL wsdl)
+ {
+ WSContractConsumer consumer = WSContractConsumer.newInstance();
+
+ consumer.setGenerateSource(generateSource);
+ consumer.setOutputDirectory(outputDir);
+ consumer.setExtension(extension);
+ consumer.setAdditionalHeaders(additionalHeaders);
+ if (sourceDir != null)
+ consumer.setSourceDirectory(sourceDir);
+
+ if (! quiet)
+ {
+ PrintStream ps;
+ if (Log4JUtil.isLog4jConfigurationAvailable())
+ {
+ ps = new PrintStream(new
Log4jOutputStream(Logger.getLogger("WSConsume"), Level.INFO));
+ }
+ else
+ {
+ ps = System.out;
+ ps.println("Could not find log4j.xml configuration, logging to
console.\n");
+ }
+ consumer.setMessageStream(ps);
+ }
+
+ if (catalog != null)
+ {
+ if (catalog.exists() && catalog.isFile())
+ {
+ consumer.setCatalog(catalog);
+ }
+ else
+ {
+ System.err.println("Warning: catalog file not found: " + catalog);
+ }
+ }
+
+ if (targetPackage != null)
+ consumer.setTargetPackage(targetPackage);
+
+ if (wsdlLocation != null)
+ consumer.setWsdlLocation(wsdlLocation);
+
+ if (bindingFiles != null && bindingFiles.size() > 0)
+ consumer.setBindingFiles(bindingFiles);
+
+ if(target!=null)
+ consumer.setTarget(target);
+
+ if (noCompile)
+ consumer.setNoCompile(noCompile);
+
+ try
+ {
+ consumer.consume(wsdl);
+ return 0;
+ }
+ catch (Throwable t)
+ {
+ System.err.println("Error: Could not import. (use --verbose to see full
traces)");
+ if (!verbose)
+ {
+ String message = t.getMessage();
+ if (message == null)
+ message = t.getClass().getSimpleName();
+ System.err.println("Error: " + message);
+ }
+ else
+ {
+ t.printStackTrace(System.err);
+ }
+
+ }
+
+ return 1;
+ }
+
+ private static void printHelp()
+ {
+ PrintStream out = System.out;
+ out.println("WSConsumeTask is a cmd line tool that generates portable JAX-WS
artifacts from a WSDL file.\n");
+ out.println("usage: " + PROGRAM_NAME + " [options]
<wsdl-url>\n");
+ out.println("options: ");
+ out.println(" -h, --help Show this help message");
+ out.println(" -b, --binding=<file> One or more JAX-WS or JAXB
binding files ");
+ out.println(" -k, --keep Keep/Generate Java
source");
+ out.println(" -c --catalog=<file> Oasis XML Catalog file for
entity resolution");
+ out.println(" -p --package=<name> The target package for
generated source");
+ out.println(" -w --wsdlLocation=<loc> Value to use for
@WebService.wsdlLocation");
+ out.println(" -o, --output=<directory> The directory to put
generated artifacts");
+ out.println(" -s, --source=<directory> The directory to put Java
source");
+ out.println(" -t, --target=<2.0|2.1|2.2> The JAX-WS specification
target");
+ out.println(" -q, --quiet Be somewhat more quiet");
+ out.println(" -v, --verbose Show full exception stack
traces");
+ out.println(" -l, --load-consumer Load the consumer and exit (debug
utility)");
+ out.println(" -e, --extension Enable SOAP 1.2 binding
extension");
+ out.println(" -a, --additionalHeaders Enable processing of implicit
SOAP headers");
+ out.println(" -n, --nocompile Do not compile generated
sources");
+ out.flush();
+ }
+}
Added: common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/WSProvide.java
===================================================================
--- common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/WSProvide.java
(rev 0)
+++ common-tools/trunk/src/main/java/org/jboss/ws/tools/cmd/WSProvide.java 2011-04-18
14:25:35 UTC (rev 14153)
@@ -0,0 +1,267 @@
+/*
+ * 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.ws.tools.cmd;
+
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.Level;
+
+import org.jboss.wsf.spi.tools.WSContractProvider;
+
+/**
+ * WSProvideTask is a cmd line tool that generates portable JAX-WS artifacts
+ * for a service endpoint implementation.
+ *
+ * <pre>
+ * usage: WSProvideTask [options] <endpoint class name>
+ * options:
+ * <table>
+ * <tr><td>-h, --help </td><td>Show this
help message</td></tr>
+ * <tr><td>-k, --keep
</td><td>Keep/Generate Java source</td></tr>
+ * <tr><td>-w, --wsdl </td><td>Enable WSDL
file generation</td></tr>
+ * <tr><td>-c, --classpath=<path< </td><td>The
classpath that contains the endpoint</td></tr>
+ * <tr><td>-o, --output=<directory> </td><td>The
directory to put generated artifacts</td></tr>
+ * <tr><td>-r, --resource=<directory></td><td>The
directory to put resource artifacts</td></tr>
+ * <tr><td>-s, --source=<directory> </td><td>The
directory to put Java source</td></tr>
+ * <tr><td>-q, --quiet </td><td>Be somewhat
more quiet</td></tr>
+ * <tr><td>-t, --show-traces </td><td>Show full
exception stack traces</td></tr>
+ * <tr><td>-l, --load-provider </td><td>Load the
provider and exit (debug utility)</td></tr>
+ * <tr><td>-e, --extension </td><td>Enable SOAP
1.2 binding extension</td></tr>
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ */
+public class WSProvide
+{
+ private static final ClassLoader MODULES_LOADER =
SecurityActions.getModulesClassLoader();
+ private ClassLoader loader = MODULES_LOADER != null ? MODULES_LOADER :
SecurityActions.getContextClassLoader();
+ private File outputDir = new File("output");
+ private boolean generateSource;
+ private boolean generateWsdl;
+ private boolean extension;
+ private boolean quiet;
+ private boolean showTraces;
+ private boolean loadProvider;
+ private File resourceDir;
+ private File sourceDir;
+
+ public static final String PROGRAM_NAME =
SecurityActions.getSystemProperty("program.name",
WSProvide.class.getSimpleName());
+
+ public static void main(String[] args)
+ {
+ WSProvide generate = new WSProvide();
+ String endpoint = generate.parseArguments(args);
+ System.exit(generate.generate(endpoint));
+ }
+
+ private String parseArguments(String[] args)
+ {
+ String shortOpts = "hwko:r:s:c:qtle";
+ LongOpt[] longOpts =
+ {
+ new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
+ new LongOpt("wsdl", LongOpt.NO_ARGUMENT, null, 'w'),
+ new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
+ new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
+ new LongOpt("resource", LongOpt.REQUIRED_ARGUMENT, null,
'r'),
+ new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
+ new LongOpt("classpath", LongOpt.REQUIRED_ARGUMENT, null,
'c'),
+ new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
+ new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'),
+ new LongOpt("load-provider", LongOpt.NO_ARGUMENT, null, 'l'),
+ new LongOpt("extension", LongOpt.NO_ARGUMENT, null, 'e'),
+ };
+
+ Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
+ int c;
+ while ((c = getopt.getopt()) != -1)
+ {
+ switch (c)
+ {
+ case 'k':
+ generateSource = true;
+ break;
+ case 's':
+ sourceDir = new File(getopt.getOptarg());
+ break;
+ case 'r':
+ resourceDir = new File(getopt.getOptarg());
+ break;
+ case 'w':
+ generateWsdl = true;
+ break;
+ case 't':
+ showTraces = true;
+ break;
+ case 'o':
+ outputDir = new File(getopt.getOptarg());
+ break;
+ case 'q':
+ quiet = true;
+ break;
+ case 'c':
+ processClassPath(getopt.getOptarg());
+ break;
+ case 'l':
+ loadProvider = true;
+ break;
+ case 'e':
+ extension = true;
+ break;
+ case 'h':
+ printHelp();
+ System.exit(0);
+ case '?':
+ System.exit(1);
+ }
+ }
+
+ // debug output
+ if(loadProvider)
+ {
+ WSContractProvider gen = WSContractProvider.newInstance(loader);
+ System.out.println("WSContractProvider instance: " +
gen.getClass().getCanonicalName());
+ System.exit(0);
+ }
+
+ int endpointPos = getopt.getOptind();
+ if (endpointPos >= args.length)
+ {
+ System.err.println("Error: endpoint implementation was not
specified!");
+ printHelp();
+ System.exit(1);
+ }
+
+ return args[endpointPos];
+ }
+
+
+ private int generate(String endpoint)
+ {
+ try
+ {
+ SecurityActions.loadClass(loader, endpoint);
+ }
+ catch (Exception e)
+ {
+ System.err.println("Error: Could not load class [" + endpoint +
"]. Did you specify a valid --classpath?");
+ return 1;
+ }
+
+ WSContractProvider gen = WSContractProvider.newInstance(loader);
+ gen.setGenerateWsdl(generateWsdl);
+ gen.setGenerateSource(generateSource);
+ gen.setOutputDirectory(outputDir);
+ gen.setExtension(extension);
+ if (resourceDir != null)
+ gen.setResourceDirectory(resourceDir);
+ if (sourceDir != null)
+ gen.setSourceDirectory(sourceDir);
+
+ if (! quiet)
+ {
+ PrintStream ps;
+ if (Log4JUtil.isLog4jConfigurationAvailable())
+ {
+ ps = new PrintStream(new
Log4jOutputStream(Logger.getLogger("WSProvide"), Level.INFO));
+ }
+ else
+ {
+ ps = System.out;
+ ps.println("Could not find log4j.xml configuration, logging to
console.\n");
+ }
+ gen.setMessageStream(ps);
+ }
+
+ try
+ {
+ gen.provide(endpoint);
+ return 0;
+ }
+ catch (Throwable t)
+ {
+ System.err.println("Error: Could not generate. (use --show-traces to see
full traces)");
+ if (!showTraces)
+ {
+ String message = t.getMessage();
+ if (message == null)
+ message = t.getClass().getSimpleName();
+ System.err.println("Error: " + message);
+ }
+ else
+ {
+ t.printStackTrace(System.err);
+ }
+
+ }
+
+ return 1;
+ }
+
+ private void processClassPath(String classPath)
+ {
+ String[] entries = classPath.split(File.pathSeparator);
+ List<URL> urls= new ArrayList<URL>(entries.length);
+ for (String entry : entries)
+ {
+ try
+ {
+ urls.add(new File(entry).toURI().toURL());
+ }
+ catch (MalformedURLException e)
+ {
+ System.err.println("Error: a classpath entry was malformed: " +
entry);
+ }
+ }
+ loader = new URLClassLoader(urls.toArray(new URL[0]), loader);
+ }
+
+ private static void printHelp()
+ {
+ PrintStream out = System.out;
+ out.println("WSProvideTask generates portable JAX-WS artifacts for an endpoint
implementation.\n");
+ out.println("usage: " + PROGRAM_NAME + " [options] <endpoint
class name>\n");
+ out.println("options: ");
+ out.println(" -h, --help Show this help message");
+ out.println(" -k, --keep Keep/Generate Java
source");
+ out.println(" -w, --wsdl Enable WSDL file
generation");
+ out.println(" -c, --classpath=<path> The classpath that contains
the endpoint");
+ out.println(" -o, --output=<directory> The directory to put
generated artifacts");
+ out.println(" -r, --resource=<directory> The directory to put
resource artifacts");
+ out.println(" -s, --source=<directory> The directory to put Java
source");
+ out.println(" -e, --extension Enable SOAP 1.2 binding
extension");
+ out.println(" -q, --quiet Be somewhat more quiet");
+ out.println(" -t, --show-traces Show full exception stack
traces");
+ out.println(" -l, --load-provider Load the provider and exit (debug
utility)");
+ out.flush();
+ }
+}
Modified:
common-tools/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdConsumeTestCase.java
===================================================================
---
common-tools/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdConsumeTestCase.java 2011-04-18
14:23:41 UTC (rev 14152)
+++
common-tools/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdConsumeTestCase.java 2011-04-18
14:25:35 UTC (rev 14153)
@@ -21,7 +21,7 @@
*/
package org.jboss.test.wsf.spi.tools;
-import org.jboss.wsf.spi.tools.cmd.WSConsume;
+import org.jboss.ws.tools.cmd.WSConsume;
/**
* Test the command line interface to WSConsume.
Modified:
common-tools/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdProvideTestCase.java
===================================================================
---
common-tools/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdProvideTestCase.java 2011-04-18
14:23:41 UTC (rev 14152)
+++
common-tools/trunk/src/test/java/org/jboss/test/wsf/spi/tools/CmdProvideTestCase.java 2011-04-18
14:25:35 UTC (rev 14153)
@@ -21,7 +21,7 @@
*/
package org.jboss.test.wsf.spi.tools;
-import org.jboss.wsf.spi.tools.cmd.WSProvide;
+import org.jboss.ws.tools.cmd.WSProvide;
/**
* @author Heiko.Braun(a)jboss.com
Modified: common-tools/trunk/src/test/resources/smoke/tools/consume-test.xml
===================================================================
--- common-tools/trunk/src/test/resources/smoke/tools/consume-test.xml 2011-04-18 14:23:41
UTC (rev 14152)
+++ common-tools/trunk/src/test/resources/smoke/tools/consume-test.xml 2011-04-18 14:25:35
UTC (rev 14153)
@@ -9,7 +9,7 @@
<property name="spi.dir" value="@SPI_DIR@"/>
<!-- Define the JAX-WS wsconsume task -->
- <taskdef name="wsconsume"
classname="org.jboss.wsf.spi.tools.ant.WSConsumeTask">
+ <taskdef name="wsconsume"
classname="org.jboss.ws.tools.ant.WSConsumeTask">
<classpath>
<pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
</classpath>
@@ -19,4 +19,4 @@
<wsconsume wsdl="Service.wsdl" verbose="true"/>
</target>
-</project>
\ No newline at end of file
+</project>
Modified: common-tools/trunk/src/test/resources/smoke/tools/provide-test.xml
===================================================================
--- common-tools/trunk/src/test/resources/smoke/tools/provide-test.xml 2011-04-18 14:23:41
UTC (rev 14152)
+++ common-tools/trunk/src/test/resources/smoke/tools/provide-test.xml 2011-04-18 14:25:35
UTC (rev 14153)
@@ -9,7 +9,7 @@
<property name="spi.dir" value="@SPI_DIR@"/>
<!-- Define the JAX-WS wsconsume task -->
- <taskdef name="wsprovide"
classname="org.jboss.wsf.spi.tools.ant.WSProvideTask">
+ <taskdef name="wsprovide"
classname="org.jboss.ws.tools.ant.WSProvideTask">
<classpath>
<pathelement location="${spi.dir}/output/lib/jbossws-spi.jar"/>
</classpath>
@@ -30,4 +30,4 @@
</classpath>
</wsprovide>
</target>
-</project>
\ No newline at end of file
+</project>