Author: alessio.soldano(a)jboss.com
Date: 2010-02-24 12:56:46 -0500 (Wed, 24 Feb 2010)
New Revision: 11680
Added:
projects/plugins/maven/jaxws-tools/trunk/pom.xml
projects/plugins/maven/jaxws-tools/trunk/src/
projects/plugins/maven/jaxws-tools/trunk/src/main/
projects/plugins/maven/jaxws-tools/trunk/src/main/java/
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractToolsMojo.java
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/TestWsConsumeMojo.java
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WsConsumeMojo.java
projects/plugins/maven/jaxws-tools/trunk/src/test/
projects/plugins/maven/jaxws-tools/trunk/src/test/java/
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/SetupScriptHelper.java
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsConsumeHelper.java
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/VerifyScriptHelper.java
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/settings.xml
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/invoker.properties
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom.xml
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/setup.bsh
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/test.wsdl
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/verify.bsh
Modified:
projects/plugins/maven/jaxws-tools/trunk/
Log:
[JBWS-2650] Adding first cut of maven plugin for WSConsume tool; simple integration test
against a sample wsdl working
Property changes on: projects/plugins/maven/jaxws-tools/trunk
___________________________________________________________________
Name: svn:ignore
+ bin
target
Added: projects/plugins/maven/jaxws-tools/trunk/pom.xml
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/pom.xml (rev 0)
+++ projects/plugins/maven/jaxws-tools/trunk/pom.xml 2010-02-24 17:56:46 UTC (rev 11680)
@@ -0,0 +1,91 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>JBoss Web Services - JAX-WS Tools Maven Plugin</name>
+ <groupId>org.jboss.ws.plugins.maven</groupId>
+ <artifactId>jaxws-tools-plugin</artifactId>
+ <packaging>maven-plugin</packaging>
+
+ <version>1.0.0-SNAPSHOT</version>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-parent</artifactId>
+ <version>1.0.4.GA</version>
+ </parent>
+
+ <!-- Source Control Management -->
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/jbossws/projects/plu...
+
<
developerConnection>scm:svn:https://svn.jboss.org/repos/jbossws/projec...
+
<
url>http://fisheye.jboss.com/viewrep/JBossWS/projects/plugins/maven/ja...
+ </scm>
+
+ <!-- Properties -->
+ <properties>
+ <jbossws.spi.version>1.3.0.Beta3</jbossws.spi.version>
+ <maven.project.version>2.0.4</maven.project.version>
+ <maven.plugin.api.version>2.0.4</maven.plugin.api.version>
+ <maven.invoker.plugin.version>1.5</maven.invoker.plugin.version>
+ </properties>
+
+ <!-- Dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-spi</artifactId>
+ <version>${jbossws.spi.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>${maven.project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>${maven.plugin.api.version}</version>
+ </dependency>
+ </dependencies>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-plugin-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <version>${maven.invoker.plugin.version}</version>
+ <configuration>
+
<projectsDirectory>src/test/resources/test-embedded</projectsDirectory>
+
<cloneProjectsTo>${project.build.directory}/test-embedded</cloneProjectsTo>
+ <pomIncludes>
+ <pomInclude>*/pom.xml</pomInclude>
+ </pomIncludes>
+
<settingsFile>src/test/resources/test-embedded/settings.xml</settingsFile>
+
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+ <preBuildHookScript>setup.bsh</preBuildHookScript>
+ <postBuildHookScript>verify.bsh</postBuildHookScript>
+ <addTestClassPath>true</addTestClassPath>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>install</goal>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Property changes on: projects/plugins/maven/jaxws-tools/trunk/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractToolsMojo.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractToolsMojo.java
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractToolsMojo.java 2010-02-24
17:56:46 UTC (rev 11680)
@@ -0,0 +1,99 @@
+/*
+ * 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.plugins.tools;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.project.MavenProject;
+
+/**
+ *
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 24-Feb-2010
+ *
+ */
+abstract class AbstractToolsMojo extends AbstractMojo
+{
+ /**
+ * @parameter expression="${project}"
+ * @readonly
+ */
+ protected MavenProject project;
+
+ /**
+ * Map of of plugin artifacts.
+ *
+ * @parameter expression="${plugin.artifactMap}"
+ * @readonly
+ */
+ private Map pluginArtifactMap;
+
+ /**
+ * Enables/Disables Java source generation.
+ *
+ * @parameter default-value="true"
+ */
+ protected Boolean generateSource;
+
+ /**
+ *
+ * @parameter default-value="false"
+ */
+ protected Boolean verbose;
+
+ /**
+ * Either ${build.outputDirectory} or ${build.testOutputDirectory}.
+ */
+ protected abstract File getDestDir();
+
+ /**
+ * Either ${project.compileClasspathElements} or ${project.testClasspathElements}
+ */
+ protected abstract List<String> getClasspath();
+
+ protected ClassLoader getMavenClasspathAwareClassLoader(ClassLoader parent)
+ {
+ List<String> classpath = getClasspath();
+ final int size = classpath.size();
+ URL[] urls = new URL[size];
+ for (int i=0; i < size; i++)
+ {
+ try
+ {
+ urls[i] = new File(classpath.get(i)).toURI().toURL();
+ }
+ catch (MalformedURLException mue)
+ {
+ getLog().warn("Skipping invalid classpath element: " +
classpath.get(i));
+ }
+ }
+ return new URLClassLoader(urls, parent);
+ }
+
+}
Property changes on:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractToolsMojo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java 2010-02-24
17:56:46 UTC (rev 11680)
@@ -0,0 +1,187 @@
+/*
+ * 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.plugins.tools;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.jboss.wsf.spi.tools.WSContractConsumer;
+
+/**
+ *
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 24-Feb-2010
+ *
+ */
+abstract class AbstractWsConsumeMojo extends AbstractToolsMojo
+{
+ /**
+ * The list of wsdl urls / files to consume
+ *
+ * @parameter
+ */
+ private List<String> wsdls;
+
+ /**
+ * Specifies the JAX-WS and JAXB binding files to use on import operations.
+ *
+ * @parameter
+ */
+ protected List<File> bindingFiles;
+
+ /**
+ * Sets the OASIS XML Catalog file to use for entity resolution.
+ *
+ * @parameter
+ */
+ private File catalog;
+
+ /**
+ * Sets the source directory. This directory will contain any generated Java source.
+ * If the directory does not exist, it will be created. If not specified,
+ * the output directory will be used instead.
+ *
+ * @parameter default-value="${project.build.directory}/wsconsume/java"
+ */
+ protected File sourceDirectory;
+
+ /**
+ * Enables/Disables SOAP 1.2 binding extension
+ *
+ * @parameter default-value="false"
+ */
+ protected Boolean extension;
+
+ protected Boolean noCompile = true; //let Maven compile the sources
+
+ /**
+ * Sets the target package for generated source. If not specified the default
+ * is based off of the XML namespace.
+ *
+ * @parameter
+ */
+ protected String targetPackage;
+
+ /**
+ * Sets the @(a)WebService.wsdlLocation and @(a)WebServiceClient.wsdlLocation attributes
to a custom value.
+ *
+ * @parameter
+ */
+ private String wsdlLocation;
+
+ /**
+ * Set the target JAX-WS specification target. Defaults to
<code>2.0</code>. Allowed values are <code>2.0</code>,
<code>2.1</code>
+ *
+ * @parameter
+ */
+ private String target;
+
+ public void execute() throws MojoExecutionException
+ {
+ Log log = getLog();
+ if (wsdls == null)
+ {
+ getLog().info("No wsdl URL / file specified, nothing to do.");
+ return;
+ }
+
+ if (verbose)
+ {
+ log.info("Classpath:");
+ for (String s : getClasspath())
+ {
+ log.info(" " + s);
+ }
+ }
+
+ ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+
Thread.currentThread().setContextClassLoader(getMavenClasspathAwareClassLoader(origLoader));
+ WSContractConsumer consumer = WSContractConsumer.newInstance();
+ setupConsumer(consumer);
+ for (String wsdl : wsdls)
+ {
+ try
+ {
+ consumer.consume(wsdl);
+ }
+ catch (MalformedURLException mue)
+ {
+ log.error("Skipping invalid wsdl reference: " + wsdl);
+ }
+ catch (Exception e)
+ {
+ throw new MojoExecutionException("Error while running
wsconsume", e);
+ }
+ }
+ project.addCompileSourceRoot(sourceDirectory.getAbsolutePath());
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(origLoader);
+ }
+ }
+
+ private void setupConsumer(WSContractConsumer consumer)
+ {
+ consumer.setAdditionalCompilerClassPath(new
LinkedList<String>(getClasspath()));
+ consumer.setMessageStream(System.out);
+ if (bindingFiles != null && !bindingFiles.isEmpty())
+ {
+ consumer.setBindingFiles(bindingFiles);
+ }
+ if (catalog != null)
+ {
+ consumer.setCatalog(catalog);
+ }
+ consumer.setExtension(extension);
+ consumer.setGenerateSource(generateSource);
+ consumer.setNoCompile(noCompile);
+ File outputDir = getDestDir();
+ if (outputDir != null)
+ {
+ consumer.setOutputDirectory(outputDir);
+ }
+ if (sourceDirectory != null)
+ {
+ consumer.setSourceDirectory(sourceDirectory);
+ }
+ if (target != null)
+ {
+ consumer.setTarget(target);
+ }
+ if (targetPackage != null)
+ {
+ consumer.setTargetPackage(targetPackage);
+ }
+ if (wsdlLocation != null)
+ {
+ consumer.setWsdlLocation(wsdlLocation);
+ }
+ }
+}
Property changes on:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/TestWsConsumeMojo.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/TestWsConsumeMojo.java
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/TestWsConsumeMojo.java 2010-02-24
17:56:46 UTC (rev 11680)
@@ -0,0 +1,62 @@
+/*
+ * 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.plugins.tools;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * Run wsconsume tool (for tests)
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 24-Feb-2010
+ */
+public class TestWsConsumeMojo extends WsConsumeMojo
+{
+ /**
+ * Sets the main output directory. If the directory does not exist, it will be
created.
+ *
+ * @parameter default-value="${project.build.testOutputDirectory}"
+ */
+ protected File outputDirectory;
+
+ /**
+ * Project test classpath.
+ *
+ * @parameter expression="${project.testClasspathElements}"
+ * @required
+ * @readonly
+ */
+ protected List<String> testClasspathElements;
+
+ @Override
+ protected File getDestDir()
+ {
+ return outputDirectory;
+ }
+
+ @Override
+ protected List<String> getClasspath()
+ {
+ return testClasspathElements;
+ }
+}
Property changes on:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/TestWsConsumeMojo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WsConsumeMojo.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WsConsumeMojo.java
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WsConsumeMojo.java 2010-02-24
17:56:46 UTC (rev 11680)
@@ -0,0 +1,67 @@
+/*
+ * 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.plugins.tools;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * Runs wsconsume tool
+ *
+ * @goal wsconsume
+ * @phase generate-sources
+ * @requiresDependencyResolution
+ * @description JBossWS WSConsume Maven Plugin.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 24-Feb-2010
+ */
+public class WsConsumeMojo extends AbstractWsConsumeMojo
+{
+ /**
+ * Sets the main output directory. If the directory does not exist, it will be
created.
+ *
+ * @parameter default-value="${project.build.outputDirectory}"
+ */
+ protected File outputDirectory;
+
+ /**
+ * Project classpath.
+ *
+ * @parameter expression="${project.compileClasspathElements}"
+ * @required
+ * @readonly
+ */
+ protected List<String> classpathElements;
+
+ @Override
+ protected File getDestDir()
+ {
+ return outputDirectory;
+ }
+
+ @Override
+ protected List<String> getClasspath()
+ {
+ return classpathElements;
+ }
+}
Property changes on:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WsConsumeMojo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/SetupScriptHelper.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/SetupScriptHelper.java
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/SetupScriptHelper.java 2010-02-24
17:56:46 UTC (rev 11680)
@@ -0,0 +1,47 @@
+/*
+ * 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.test.ws.plugins.tools.helpers;
+
+import java.io.File;
+import java.util.Map;
+
+/**
+ * Common interface for the beanshell setup script used by the Maven Invoker Plugin (see
test-embedded)
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 24-Feb-2010
+ *
+ */
+public interface SetupScriptHelper
+{
+
+ /**
+ * Perform the custom setup using the global variables defined by the Invoker Plugin
+ *
+ * @param basedir
+ * @param localRepositoryPath
+ * @param context
+ * @throws Exception
+ */
+ public void setup(File basedir, File localRepositoryPath, Map<?, ?> context)
throws Exception;
+
+}
Property changes on:
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/SetupScriptHelper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsConsumeHelper.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsConsumeHelper.java
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsConsumeHelper.java 2010-02-24
17:56:46 UTC (rev 11680)
@@ -0,0 +1,66 @@
+/*
+ * 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.test.ws.plugins.tools.helpers;
+
+import java.io.File;
+import java.util.Map;
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 24-Feb-2010
+ *
+ */
+public class TestWsConsumeHelper implements VerifyScriptHelper, SetupScriptHelper
+{
+ private Long lastModificationTime = null;
+
+ @Override
+ public boolean verify(File basedir, File localRepositoryPath, Map<?, ?> context)
throws Exception
+ {
+ File endpointFile = new File(basedir.getAbsolutePath() + File.separator +
"target" + File.separator + "wsconsume" + File.separator +
"java" +
+ File.separator + "foo" + File.separator + "bar" +
File.separator + "Endpoint.java");
+ if (!endpointFile.exists())
+ {
+ System.out.println(endpointFile + " not found!");
+ return false;
+ }
+ if (lastModificationTime != null && endpointFile.lastModified() ==
lastModificationTime)
+ {
+ System.out.println(endpointFile + " was not modified by the
plugin!");
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public void setup(File basedir, File localRepositoryPath, Map<?, ?> context)
throws Exception
+ {
+ File endpointFile = new File(basedir.getAbsolutePath() + File.separator +
"target" + File.separator + "wsconsume" + File.separator +
"java" +
+ File.separator + "foo" + File.separator + "bar" +
File.separator + "Endpoint.java");
+ if (endpointFile.exists())
+ {
+ this.lastModificationTime = endpointFile.lastModified();
+ }
+ }
+
+}
Property changes on:
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestWsConsumeHelper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/VerifyScriptHelper.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/VerifyScriptHelper.java
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/VerifyScriptHelper.java 2010-02-24
17:56:46 UTC (rev 11680)
@@ -0,0 +1,48 @@
+/*
+ * 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.test.ws.plugins.tools.helpers;
+
+import java.io.File;
+import java.util.Map;
+
+/**
+ * Common interface for the beanshell verify script used by the Maven Invoker Plugin (see
test-embedded)
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 24-Feb-2010
+ *
+ */
+public interface VerifyScriptHelper
+{
+
+ /**
+ * Perform the custom verification using the global variables defined by the Invoker
Plugin and return the result
+ *
+ * @param basedir
+ * @param localRepositoryPath
+ * @param context
+ * @throws Exception
+ * @return True if the verification succeeded, false otherwise
+ */
+ public boolean verify(File basedir, File localRepositoryPath, Map<?, ?> context)
throws Exception;
+
+}
Property changes on:
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/VerifyScriptHelper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/settings.xml
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/settings.xml
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/settings.xml 2010-02-24
17:56:46 UTC (rev 11680)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings>
+ <profiles>
+ <profile>
+ <id>test-embedded-repo</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <!-- This property allows the embedded tests to access the real local
repository instead of the isolated one -->
+ <invoker.repo.local>@localRepository(a)</invoker.repo.local>
+ </properties>
+ <repositories>
+ <repository>
+ <id>local.central</id>
+ <url>@localRepositoryUrl@</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>local.central</id>
+ <url>@localRepositoryUrl@</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ </profiles>
+</settings>
Property changes on:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/settings.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/invoker.properties
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/invoker.properties
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/invoker.properties 2010-02-24
17:56:46 UTC (rev 11680)
@@ -0,0 +1 @@
+invoker.goals = clean package
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom.xml
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom.xml
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom.xml 2010-02-24
17:56:46 UTC (rev 11680)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>testWsConsume</name>
+ <groupId>org.jboss.ws.plugins.maven.tests</groupId>
+ <artifactId>testWsConsume</artifactId>
+ <packaging>jar</packaging>
+ <version>@pom.version(a)</version>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <maxmem>256M</maxmem>
+ <fork>${compiler.fork}</fork>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.ws.plugins.maven</groupId>
+ <artifactId>jaxws-tools-plugin</artifactId>
+ <version>@pom.version(a)</version>
+ <configuration>
+ <wsdls>
+ <wsdl>${basedir}/test.wsdl</wsdl>
+ </wsdls>
+ <targetPackage>foo.bar</targetPackage>
+ <verbose>true</verbose>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>wsconsume</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.ws.native</groupId>
+ <artifactId>jbossws-native-client</artifactId>
+ <version>3.3.0.Beta4</version>
+ </dependency>
+ </dependencies>
+</project>
Property changes on:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/setup.bsh
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/setup.bsh
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/setup.bsh 2010-02-24
17:56:46 UTC (rev 11680)
@@ -0,0 +1,7 @@
+import java.io.*;
+import org.jboss.test.ws.plugins.tools.helpers.*;
+import java.util.*;
+import java.util.regex.*;
+
+TestWsConsumeHelper helper = new TestWsConsumeHelper();
+helper.setup(basedir, localRepositoryPath, context);
\ No newline at end of file
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/test.wsdl
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/test.wsdl
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/test.wsdl 2010-02-24
17:56:46 UTC (rev 11680)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Published by JAX-WS RI at
http://jax-ws.dev.java.net. RI's version is JAX-WS
RI 2.1.7-b01-. -->
+<!-- Generated by JAX-WS RI at
http://jax-ws.dev.java.net. RI's version is JAX-WS
RI 2.1.7-b01-. -->
+<definitions
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://webmethod.samples.jaxws.ws.test.jboss.org/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://webmethod.samples.jaxws.ws.test.jboss.org/&q...
name="EndpointService">
+<types/>
+<message name="echoString">
+<part name="arg0" type="xsd:string"/>
+</message>
+<message name="echoStringResponse">
+<part name="return" type="xsd:string"/>
+</message>
+<portType name="Endpoint">
+<operation name="echoString">
+<input message="tns:echoString"/>
+<output message="tns:echoStringResponse"/>
+</operation>
+</portType>
+<binding name="EndpointPortBinding" type="tns:Endpoint">
+<soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="rpc"/>
+<operation name="echoString">
+<soap:operation soapAction="urn:EchoString"/>
+<input>
+<soap:body use="literal"
namespace="http://webmethod.samples.jaxws.ws.test.jboss.org/"/>
+</input>
+<output>
+<soap:body use="literal"
namespace="http://webmethod.samples.jaxws.ws.test.jboss.org/"/>
+</output>
+</operation>
+</binding>
+<service name="EndpointService">
+<port name="EndpointPort" binding="tns:EndpointPortBinding">
+<soap:address location="http://127.0.0.1:8080/jaxws-samples-webmethod"/>
+</port>
+</service>
+</definitions>
\ No newline at end of file
Property changes on:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/test.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/verify.bsh
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/verify.bsh
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/verify.bsh 2010-02-24
17:56:46 UTC (rev 11680)
@@ -0,0 +1,16 @@
+import java.io.*;
+import org.jboss.test.ws.plugins.tools.helpers.*;
+import java.util.*;
+import java.util.regex.*;
+
+try
+{
+ TestWsConsumeHelper helper = new TestWsConsumeHelper();
+ return helper.verify(basedir, localRepositoryPath, context);
+
+}
+catch( Throwable t )
+{
+ t.printStackTrace();
+ return false;
+}