Author: alessio.soldano(a)jboss.com
Date: 2013-02-13 09:45:18 -0500 (Wed, 13 Feb 2013)
New Revision: 17310
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/main/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint3.java
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint4.java
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsProvideMojo.java
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractProviderParams.java
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/ArgumentTest.java
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-argument/wsprovide-plugin-config.xml
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-cxf.xml
Log:
[JBWS-3546] Applying patch from Rebecca Searls
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsProvideMojo.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsProvideMojo.java 2013-02-13
12:04:40 UTC (rev 17309)
+++
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsProvideMojo.java 2013-02-13
14:45:18 UTC (rev 17310)
@@ -66,7 +66,15 @@
* @required
*/
private String endpointClass;
-
+
+ /**
+ * Sets the soap:address to be used for the generated port in the wsdl.
+ *
+ * @parameter
+ */
+ private String portSoapAddress;
+
+
public void execute() throws MojoExecutionException
{
Log log = getLog();
@@ -101,6 +109,7 @@
params.setSourceDirectory(sourceDirectory);
params.setFork(fork);
params.setArgLine(argLine);
+ params.setPortSoapAddress(portSoapAddress);
WSContractDelegate delegate = new WSContractDelegate(getLog());
delegate.runProvider(params);
@@ -136,4 +145,9 @@
{
return endpointClass;
}
+
+ public String getPortSoapAddress()
+ {
+ return portSoapAddress;
+ }
}
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java 2013-02-13
12:04:40 UTC (rev 17309)
+++
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java 2013-02-13
14:45:18 UTC (rev 17310)
@@ -258,6 +258,10 @@
{
commandList.add("-e");
}
+ if(params.getPortSoapAddress() != null){
+ commandList.add("-a");
+ commandList.add(params.getPortSoapAddress());
+ }
commandList.add(params.getEndpointClass());
StringBuilder command = new StringBuilder();
for (String s : commandList)
@@ -353,6 +357,10 @@
{
callMethod(providerClass, provider, "setSourceDirectory",
params.getSourceDirectory());
}
+ if (params.getPortSoapAddress() != null)
+ {
+ callMethod(providerClass, provider, "setPortSoapAddress",
params.getPortSoapAddress());
+ }
}
}
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractProviderParams.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractProviderParams.java 2013-02-13
12:04:40 UTC (rev 17309)
+++
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractProviderParams.java 2013-02-13
14:45:18 UTC (rev 17310)
@@ -37,6 +37,7 @@
private File resourceDirectory;
private File sourceDirectory;
private String argLine;
+ private String portSoapAddress;
public boolean isFork()
{
@@ -118,4 +119,13 @@
{
this.sourceDirectory = sourceDirectory;
}
+
+ public String getPortSoapAddress()
+ {
+ return portSoapAddress;
+ }
+ public void setPortSoapAddress(String portSoapAddress)
+ {
+ this.portSoapAddress = portSoapAddress;
+ }
}
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/ArgumentTest.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/ArgumentTest.java 2013-02-13
12:04:40 UTC (rev 17309)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/ArgumentTest.java 2013-02-13
14:45:18 UTC (rev 17310)
@@ -91,6 +91,7 @@
assertThat(mojo.getClasspathElements(), hasItems(new String[] { "cp1",
"cp2" }));
assertTrue(mojo.isFork());
assertEquals("-Dfoo=bar", mojo.getArgLine());
+ assertEquals("http://someHost:somePort", mojo.getPortSoapAddress());
}
}
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-argument/wsprovide-plugin-config.xml
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-argument/wsprovide-plugin-config.xml 2013-02-13
12:04:40 UTC (rev 17309)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-argument/wsprovide-plugin-config.xml 2013-02-13
14:45:18 UTC (rev 17310)
@@ -15,6 +15,7 @@
<sourceDirectory>source</sourceDirectory>
<endpointClass>endpoint</endpointClass>
<extension>true</extension>
+ <portSoapAddress>http://someHost:somePort</portSoapAddress>
<verbose>true</verbose>
<fork>true</fork>
<argLine>-Dfoo=bar</argLine>
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-cxf.xml
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-cxf.xml 2013-02-13
12:04:40 UTC (rev 17309)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/pom-cxf.xml 2013-02-13
14:45:18 UTC (rev 17310)
@@ -62,6 +62,29 @@
<generateWsdl>true</generateWsdl>
</configuration>
</execution>
+ <execution>
+ <id>Third execution</id>
+ <goals>
+ <goal>wsprovide</goal>
+ </goals>
+ <configuration>
+
<endpointClass>org.jboss.test.ws.plugins.tools.wsprovide.TestEndpoint3</endpointClass>
+ <generateWsdl>true</generateWsdl>
+ <fork>true</fork>
+
<portSoapAddress>http://someHost:somePort</portSoapAddress>
+ </configuration>
+ </execution>
+ <execution>
+ <id>Fourth execution</id>
+ <goals>
+ <goal>wsprovide-test</goal>
+ </goals>
+ <configuration>
+
<endpointClass>org.jboss.test.ws.plugins.tools.wsprovide.TestEndpoint4</endpointClass>
+ <generateWsdl>true</generateWsdl>
+
<portSoapAddress>http://someHost:somePort</portSoapAddress>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/main/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint3.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/main/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint3.java
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/main/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint3.java 2013-02-13
14:45:18 UTC (rev 17310)
@@ -0,0 +1,40 @@
+/*
+ * 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.wsprovide;
+
+import javax.jws.WebService;
+
+/**
+ * A simple test endpoint service implementation
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 25-Feb-2010
+ *
+ */
+@WebService
+public class TestEndpoint3
+{
+ public String test(String s)
+ {
+ return s;
+ }
+}
\ No newline at end of file
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint4.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint4.java
(rev 0)
+++
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsProvide/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint4.java 2013-02-13
14:45:18 UTC (rev 17310)
@@ -0,0 +1,40 @@
+/*
+ * 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.wsprovide;
+
+import javax.jws.WebService;
+
+/**
+ * A simple test endpoint service implementation
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 26-Feb-2010
+ *
+ */
+@WebService
+public class TestEndpoint4
+{
+ public String test(String s)
+ {
+ return s;
+ }
+}
\ No newline at end of file