JBossWS SVN: r13010 - framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-09-23 04:07:06 -0400 (Thu, 23 Sep 2010)
New Revision: 13010
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EJB3Client.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientTwo.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/ServletClient.java
Log:
[JBMETA-298] repairing test case to be in sync with JavaDoc requirements
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EJB3Client.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EJB3Client.java 2010-09-23 07:53:01 UTC (rev 13009)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EJB3Client.java 2010-09-23 08:07:06 UTC (rev 13010)
@@ -41,9 +41,13 @@
@WebServiceRef(name = "service1", value = EndpointService.class, type = EndpointService.class, wsdlLocation = "META-INF/wsdl/Endpoint.wsdl")
// Test multiple on type
-@WebServiceRefs( {
- @WebServiceRef(name = "service2", value = EndpointService.class, type = EndpointService.class),
- @WebServiceRef(name = "port1", value = EndpointService.class, type = Endpoint.class) })
+@WebServiceRefs
+(
+ {
+ @WebServiceRef(name = "service2", value = EndpointService.class, type = EndpointService.class),
+ @WebServiceRef(name = "port1", value = EndpointService.class, type = Endpoint.class)
+ }
+)
public class EJB3Client implements EJB3Remote
{
// Provide logging
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java 2010-09-23 07:53:01 UTC (rev 13009)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java 2010-09-23 08:07:06 UTC (rev 13010)
@@ -39,9 +39,13 @@
@WebServiceRef(name = "service1", value = EndpointService.class, type = EndpointService.class, wsdlLocation = "META-INF/wsdl/Endpoint.wsdl")
// Test multiple on type
-@WebServiceRefs( {
- @WebServiceRef(name = "service2", value = EndpointService.class),
- @WebServiceRef(name = "port1", value = EndpointService.class, type = Endpoint.class) })
+@WebServiceRefs
+(
+ {
+ @WebServiceRef(name = "service2", value = EndpointService.class, type = EndpointService.class),
+ @WebServiceRef(name = "port1", value = EndpointService.class, type = Endpoint.class)
+ }
+)
public class EndpointClientOne
{
// Provide logging
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientTwo.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientTwo.java 2010-09-23 07:53:01 UTC (rev 13009)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientTwo.java 2010-09-23 08:07:06 UTC (rev 13010)
@@ -35,17 +35,22 @@
import org.jboss.logging.Logger;
import org.jboss.test.ws.jaxws.samples.webserviceref.Endpoint;
import org.jboss.test.ws.jaxws.samples.webserviceref.EndpointService;
-//import org.jboss.ws.core.ConfigProvider;
-//Test on type
+// Test on type
@WebServiceRef(name = "Service1", type = EndpointService.class)
// Test multiple on type
-@WebServiceRefs( { @WebServiceRef(name = "Service2"), @WebServiceRef(name = "Port1", type = Endpoint.class) })
+@WebServiceRefs
+(
+ {
+ @WebServiceRef(name = "Service2", type = EndpointService.class),
+ @WebServiceRef(name = "Port1", type = Endpoint.class)
+ }
+)
public class EndpointClientTwo
{
// provide logging
private static final Logger log = Logger.getLogger(EndpointClientTwo.class);
-
+
// Test on field
@WebServiceRef(name = "Service3")
static Service service3;
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/ServletClient.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/ServletClient.java 2010-09-23 07:53:01 UTC (rev 13009)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/ServletClient.java 2010-09-23 08:07:06 UTC (rev 13010)
@@ -35,18 +35,22 @@
import org.jboss.logging.Logger;
-//Test on type with wsdlLocation
+// Test on type with wsdlLocation
@WebServiceRef(name = "service1", value = EndpointService.class, type = EndpointService.class, wsdlLocation = "WEB-INF/wsdl/Endpoint.wsdl")
// Test multiple on type
-@WebServiceRefs( {
- @WebServiceRef(name = "service2", value = EndpointService.class, type = EndpointService.class),
- @WebServiceRef(name = "port1", value = EndpointService.class, type = Endpoint.class) })
+@WebServiceRefs
+(
+ {
+ @WebServiceRef(name = "service2", value = EndpointService.class, type = EndpointService.class),
+ @WebServiceRef(name = "port1", value = EndpointService.class, type = Endpoint.class)
+ }
+)
public class ServletClient extends HttpServlet
{
// Provide logging
private static Logger log = Logger.getLogger(ServletClient.class);
-
+
// Test on field with name
@WebServiceRef(name = "EndpointService3")
public EndpointService service3;
13 years, 7 months
JBossWS SVN: r13009 - framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-09-23 03:53:01 -0400 (Thu, 23 Sep 2010)
New Revision: 13009
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EJB3Client.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientTwo.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/ServletClient.java
Log:
[JBMETA-298] repairing test case to be in sync with JavaDoc requirements
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EJB3Client.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EJB3Client.java 2010-09-22 17:58:54 UTC (rev 13008)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EJB3Client.java 2010-09-23 07:53:01 UTC (rev 13009)
@@ -38,11 +38,11 @@
@Stateless
// Test on type with wsdlLocation
-@WebServiceRef(name = "service1", value = EndpointService.class, wsdlLocation = "META-INF/wsdl/Endpoint.wsdl")
+@WebServiceRef(name = "service1", value = EndpointService.class, type = EndpointService.class, wsdlLocation = "META-INF/wsdl/Endpoint.wsdl")
// Test multiple on type
@WebServiceRefs( {
- @WebServiceRef(name = "service2", value = EndpointService.class),
+ @WebServiceRef(name = "service2", value = EndpointService.class, type = EndpointService.class),
@WebServiceRef(name = "port1", value = EndpointService.class, type = Endpoint.class) })
public class EJB3Client implements EJB3Remote
{
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java 2010-09-22 17:58:54 UTC (rev 13008)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientOne.java 2010-09-23 07:53:01 UTC (rev 13009)
@@ -36,7 +36,7 @@
import org.jboss.test.ws.jaxws.samples.webserviceref.Endpoint;
// Test on type with wsdlLocation
-@WebServiceRef(name = "service1", value = EndpointService.class, wsdlLocation = "META-INF/wsdl/Endpoint.wsdl")
+@WebServiceRef(name = "service1", value = EndpointService.class, type = EndpointService.class, wsdlLocation = "META-INF/wsdl/Endpoint.wsdl")
// Test multiple on type
@WebServiceRefs( {
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientTwo.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientTwo.java 2010-09-22 17:58:54 UTC (rev 13008)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/EndpointClientTwo.java 2010-09-23 07:53:01 UTC (rev 13009)
@@ -38,7 +38,7 @@
//import org.jboss.ws.core.ConfigProvider;
//Test on type
-@WebServiceRef(name = "Service1")
+@WebServiceRef(name = "Service1", type = EndpointService.class)
// Test multiple on type
@WebServiceRefs( { @WebServiceRef(name = "Service2"), @WebServiceRef(name = "Port1", type = Endpoint.class) })
public class EndpointClientTwo
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/ServletClient.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/ServletClient.java 2010-09-22 17:58:54 UTC (rev 13008)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/ServletClient.java 2010-09-23 07:53:01 UTC (rev 13009)
@@ -36,11 +36,11 @@
import org.jboss.logging.Logger;
//Test on type with wsdlLocation
-@WebServiceRef(name = "service1", value = EndpointService.class, wsdlLocation = "WEB-INF/wsdl/Endpoint.wsdl")
+@WebServiceRef(name = "service1", value = EndpointService.class, type = EndpointService.class, wsdlLocation = "WEB-INF/wsdl/Endpoint.wsdl")
// Test multiple on type
@WebServiceRefs( {
- @WebServiceRef(name = "service2", value = EndpointService.class),
+ @WebServiceRef(name = "service2", value = EndpointService.class, type = EndpointService.class),
@WebServiceRef(name = "port1", value = EndpointService.class, type = Endpoint.class) })
public class ServletClient extends HttpServlet
{
13 years, 7 months
JBossWS SVN: r13008 - in framework/trunk/testsuite/test: java/org/jboss/test/ws/jaxws/jbws3131 and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-22 13:58:54 -0400 (Wed, 22 Sep 2010)
New Revision: 13008
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3131/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3131/JBWS3131TestCase.java
framework/trunk/testsuite/test/resources/jaxws/jbws3131/
framework/trunk/testsuite/test/resources/jaxws/jbws3131/NfeStatusServico2.wsdl
framework/trunk/testsuite/test/resources/jaxws/jbws3131/NfeStatusServico21.wsdl
Log:
[JBWS-3131] Adding testcase
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3131/JBWS3131TestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3131/JBWS3131TestCase.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3131/JBWS3131TestCase.java 2010-09-22 17:58:54 UTC (rev 13008)
@@ -0,0 +1,85 @@
+/*
+ * 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.jaxws.jbws3131;
+
+import java.io.IOException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
+
+import org.jboss.wsf.test.JBossWSTest;
+
+public class JBWS3131TestCase extends JBossWSTest
+{
+ private URL WSDLUrl;
+ private URL changedWSDLUrl;
+ private Service service;
+ private Service serviceChanged;
+
+ public void setUp() throws IOException
+ {
+ WSDLUrl = getResourceURL("jaxws/jbws3131/NfeStatusServico2.wsdl");
+ changedWSDLUrl = getResourceURL("jaxws/jbws3131/NfeStatusServico21.wsdl");
+
+ QName serviceName = new QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2", "NfeStatusServico2");
+ service = Service.create(WSDLUrl, serviceName);
+
+ serviceName = new QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2", "NfeStatusServico2");
+ serviceChanged = Service.create(changedWSDLUrl, serviceName);
+ }
+
+ public void testSOAP11OnOriginalWSDL() throws IOException
+ {
+ QName portName = new QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2", "NfeStatusServico2Soap");
+ Dispatch<Source> dispatch = service.createDispatch(portName, Source.class, Mode.MESSAGE);
+ String bindingID = dispatch.getBinding().getBindingID();
+ assertEquals("http://schemas.xmlsoap.org/wsdl/soap/http", bindingID);
+ }
+
+ public void testSOAP12OnOriginalWSDL() throws IOException
+ {
+ QName portName = new QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2", "NfeStatusServico2Soap12");
+ Dispatch<Source> dispatch = service.createDispatch(portName, Source.class, Mode.MESSAGE);
+ String bindingID = dispatch.getBinding().getBindingID();
+ assertEquals("http://www.w3.org/2003/05/soap/bindings/HTTP/", bindingID);
+ }
+
+ public void testSOAP11OnChangedWSDL() throws IOException
+ {
+ QName portName = new QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2", "NfeStatusServico2Soap1");
+ Dispatch<Source> dispatch = serviceChanged.createDispatch(portName, Source.class, Mode.MESSAGE);
+ String bindingID = dispatch.getBinding().getBindingID();
+ assertEquals("http://schemas.xmlsoap.org/wsdl/soap/http", bindingID);
+ }
+
+ public void testSOAP12OnChangedWSDL() throws IOException
+ {
+ QName portName = new QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2", "NfeStatusServico2Soap12");
+ Dispatch<Source> dispatch = serviceChanged.createDispatch(portName, Source.class, Mode.MESSAGE);
+ String bindingID = dispatch.getBinding().getBindingID();
+ assertEquals("http://www.w3.org/2003/05/soap/bindings/HTTP/", bindingID);
+ }
+}
\ No newline at end of file
Added: framework/trunk/testsuite/test/resources/jaxws/jbws3131/NfeStatusServico2.wsdl
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws3131/NfeStatusServico2.wsdl (rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws3131/NfeStatusServico2.wsdl 2010-09-22 17:58:54 UTC (rev 13008)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2">
+ <s:element name="nfeDadosMsg">
+ <s:complexType mixed="true">
+ <s:sequence>
+ <s:any />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="nfeStatusServicoNF2Result">
+ <s:complexType mixed="true">
+ <s:sequence>
+ <s:any />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="nfeCabecMsg" type="tns:nfeCabecMsg" />
+ <s:complexType name="nfeCabecMsg">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="versaoDados" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="cUF" type="s:string" />
+ </s:sequence>
+ <s:anyAttribute />
+ </s:complexType>
+ </s:schema>
+ </wsdl:types>
+ <wsdl:message name="nfeStatusServicoNF2SoapIn">
+ <wsdl:part name="nfeDadosMsg" element="tns:nfeDadosMsg" />
+ </wsdl:message>
+ <wsdl:message name="nfeStatusServicoNF2SoapOut">
+ <wsdl:part name="nfeStatusServicoNF2Result" element="tns:nfeStatusServicoNF2Result" />
+ </wsdl:message>
+ <wsdl:message name="nfeStatusServicoNF2nfeCabecMsg">
+ <wsdl:part name="nfeCabecMsg" element="tns:nfeCabecMsg" />
+ </wsdl:message>
+ <wsdl:portType name="NfeStatusServico2Soap">
+ <wsdl:operation name="nfeStatusServicoNF2">
+ <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Serviço destinado à consulta do status do serviço prestado pela Sefaz Virtual do Ambiente Nacional</wsdl:documentation>
+ <wsdl:input message="tns:nfeStatusServicoNF2SoapIn" />
+ <wsdl:output message="tns:nfeStatusServicoNF2SoapOut" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="NfeStatusServico2Soap" type="tns:NfeStatusServico2Soap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="nfeStatusServicoNF2">
+ <soap:operation soapAction="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2/nfeStatusServic..." style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ <soap:header message="tns:nfeStatusServicoNF2nfeCabecMsg" part="nfeCabecMsg" use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="NfeStatusServico2Soap12" type="tns:NfeStatusServico2Soap">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="nfeStatusServicoNF2">
+ <soap12:operation soapAction="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2/nfeStatusServic..." style="document" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ <soap12:header message="tns:nfeStatusServicoNF2nfeCabecMsg" part="nfeCabecMsg" use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="NfeStatusServico2">
+ <wsdl:port name="NfeStatusServico2Soap" binding="tns:NfeStatusServico2Soap">
+ <soap:address location="https://hom.nfe.fazenda.gov.br/SCAN/NfeStatusServico2/NfeStatusServico2.asmx" />
+ </wsdl:port>
+ <wsdl:port name="NfeStatusServico2Soap12" binding="tns:NfeStatusServico2Soap12">
+ <soap12:address location="https://hom.nfe.fazenda.gov.br/SCAN/NfeStatusServico2/NfeStatusServico2.asmx" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
Added: framework/trunk/testsuite/test/resources/jaxws/jbws3131/NfeStatusServico21.wsdl
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws3131/NfeStatusServico21.wsdl (rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws3131/NfeStatusServico21.wsdl 2010-09-22 17:58:54 UTC (rev 13008)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2">
+ <s:element name="nfeDadosMsg">
+ <s:complexType mixed="true">
+ <s:sequence>
+ <s:any />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="nfeStatusServicoNF2Result">
+ <s:complexType mixed="true">
+ <s:sequence>
+ <s:any />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="nfeCabecMsg" type="tns:nfeCabecMsg" />
+ <s:complexType name="nfeCabecMsg">
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="versaoDados" type="s:string" />
+ <s:element minOccurs="0" maxOccurs="1" name="cUF" type="s:string" />
+ </s:sequence>
+ <s:anyAttribute />
+ </s:complexType>
+ </s:schema>
+ </wsdl:types>
+ <wsdl:message name="nfeStatusServicoNF2SoapIn">
+ <wsdl:part name="nfeDadosMsg" element="tns:nfeDadosMsg" />
+ </wsdl:message>
+ <wsdl:message name="nfeStatusServicoNF2SoapOut">
+ <wsdl:part name="nfeStatusServicoNF2Result" element="tns:nfeStatusServicoNF2Result" />
+ </wsdl:message>
+ <wsdl:message name="nfeStatusServicoNF2nfeCabecMsg">
+ <wsdl:part name="nfeCabecMsg" element="tns:nfeCabecMsg" />
+ </wsdl:message>
+ <wsdl:portType name="NfeStatusServico2Soap">
+ <wsdl:operation name="nfeStatusServicoNF2">
+ <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Serviço destinado à consulta do status do serviço prestado pela Sefaz Virtual do Ambiente Nacional</wsdl:documentation>
+ <wsdl:input message="tns:nfeStatusServicoNF2SoapIn" />
+ <wsdl:output message="tns:nfeStatusServicoNF2SoapOut" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="NfeStatusServico2Soap" type="tns:NfeStatusServico2Soap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="nfeStatusServicoNF2">
+ <soap:operation soapAction="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2/nfeStatusServic..." style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ <soap:header message="tns:nfeStatusServicoNF2nfeCabecMsg" part="nfeCabecMsg" use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="NfeStatusServico2Soap12" type="tns:NfeStatusServico2Soap">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="nfeStatusServicoNF2">
+ <soap12:operation soapAction="http://www.portalfiscal.inf.br/nfe/wsdl/NfeStatusServico2/nfeStatusServic..." style="document" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ <soap12:header message="tns:nfeStatusServicoNF2nfeCabecMsg" part="nfeCabecMsg" use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="NfeStatusServico2">
+ <wsdl:port name="NfeStatusServico2Soap1" binding="tns:NfeStatusServico2Soap">
+ <soap:address location="https://hom.nfe.fazenda.gov.br/SCAN/NfeStatusServico2/NfeStatusServico2.asmx" />
+ </wsdl:port>
+ <wsdl:port name="NfeStatusServico2Soap12" binding="tns:NfeStatusServico2Soap12">
+ <soap12:address location="https://hom.nfe.fazenda.gov.br/SCAN/NfeStatusServico2/NfeStatusServico2.asmx" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
13 years, 7 months
JBossWS SVN: r13007 - stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-22 12:46:32 -0400 (Wed, 22 Sep 2010)
New Revision: 13007
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
Log:
[JBWS-3034] Prevent index out of bound exception
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2010-09-22 16:45:37 UTC (rev 13006)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2010-09-22 16:46:32 UTC (rev 13007)
@@ -255,7 +255,8 @@
String resourcePath = packagePath + "/" + filepath;
while (filepath.startsWith("../"))
{
- packagePath = packagePath.substring(0, packagePath.lastIndexOf('/'));
+ int endIndex = packagePath.lastIndexOf("/");
+ packagePath = packagePath.substring(0, endIndex != -1 ? endIndex : 0);
filepath = filepath.substring(3);
resourcePath = packagePath + '/' + filepath;
}
13 years, 7 months
JBossWS SVN: r13006 - in framework/trunk/testsuite/test: java/org/jboss/test/ws/jaxws and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-22 12:45:37 -0400 (Wed, 22 Sep 2010)
New Revision: 13006
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/Endpoint.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/EndpointImpl.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/JBWS3034TestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/ServerSOAPHandler.java
framework/trunk/testsuite/test/resources/jaxws/jbws3034/
framework/trunk/testsuite/test/resources/jaxws/jbws3034/WEB-INF/
framework/trunk/testsuite/test/resources/jaxws/jbws3034/WEB-INF/jboss-web.xml
framework/trunk/testsuite/test/resources/jaxws/jbws3034/WEB-INF/web.xml
framework/trunk/testsuite/test/resources/jaxws/jbws3034/handlers.xml
Modified:
framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
Log:
[JBWS-3034] Adding testcase
Modified: framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2010-09-22 14:10:35 UTC (rev 13005)
+++ framework/trunk/testsuite/test/ant-import/build-jars-jaxws.xml 2010-09-22 16:45:37 UTC (rev 13006)
@@ -1008,6 +1008,21 @@
</webinf>
</war>
+ <!-- jaxws-jbws3034 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws3034.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws3034/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws3034/Endpoint.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws3034/EndpointImpl.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws3034/ServerSOAPHandler.class"/>
+ </classes>
+ <classes dir="${tests.output.dir}/test-resources/jaxws/jbws3034">
+ <include name="handlers.xml" />
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/jbws3034/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ </war>
+
<!-- jaxws-jbws3041 -->
<war warfile="${tests.output.dir}/test-libs/jaxws-jbws3041.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws3041/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/Endpoint.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/Endpoint.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/Endpoint.java 2010-09-22 16:45:37 UTC (rev 13006)
@@ -0,0 +1,30 @@
+/*
+ * 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.jaxws.jbws3034;
+import javax.jws.WebService;
+@WebService(name = "Endpoint", targetNamespace = "http://ws.jboss.org/jbws3034")
+public interface Endpoint
+{
+
+ public String echo(final String message);
+
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/EndpointImpl.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/EndpointImpl.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/EndpointImpl.java 2010-09-22 16:45:37 UTC (rev 13006)
@@ -0,0 +1,36 @@
+/*
+ * 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.jaxws.jbws3034;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+
+@WebService(name = "Endpoint", portName = "EndpointPort", serviceName="EndpointService", targetNamespace = "http://ws.jboss.org/jbws3034", endpointInterface = "org.jboss.test.ws.jaxws.jbws3034.Endpoint")
+@HandlerChain(file = "../../../../../../handlers.xml")
+public class EndpointImpl implements Endpoint
+{
+ public String echo(final String message)
+ {
+ return message;
+ }
+
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/JBWS3034TestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/JBWS3034TestCase.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/JBWS3034TestCase.java 2010-09-22 16:45:37 UTC (rev 13006)
@@ -0,0 +1,59 @@
+/*
+ * 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.jaxws.jbws3034;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+public class JBWS3034TestCase extends JBossWSTest
+{
+
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws3034";
+
+ private static Endpoint port;
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(JBWS3034TestCase.class, "jaxws-jbws3034.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ Service service = Service.create(wsdlURL, new QName("http://ws.jboss.org/jbws3034", "EndpointService"));
+ port = service.getPort(new QName("http://ws.jboss.org/jbws3034", "EndpointPort"), Endpoint.class);
+ }
+
+ public void testCall() throws Exception
+ {
+ String response = port.echo("testJBWS3034");
+ assertEquals("PutByServerSOAPHandler", response);
+ }
+}
\ No newline at end of file
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/ServerSOAPHandler.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/ServerSOAPHandler.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws3034/ServerSOAPHandler.java 2010-09-22 16:45:37 UTC (rev 13006)
@@ -0,0 +1,72 @@
+/*
+ * 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.jaxws.jbws3034;
+
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.wsf.common.handler.GenericSOAPHandler;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class ServerSOAPHandler extends GenericSOAPHandler<LogicalMessageContext>
+{
+ @Override
+ protected boolean handleOutbound(final MessageContext msgContext)
+ {
+ try
+ {
+ SOAPMessageContext smc = (SOAPMessageContext) msgContext;
+ SOAPMessage message = smc.getMessage();
+
+ SOAPBody body = message.getSOAPBody();
+ Document document = body.extractContentAsDocument();
+ NodeList nodes = document.getChildNodes();
+ for (int i = 0; i < nodes.getLength(); i++)
+ {
+ Node current = nodes.item(i);
+
+ NodeList childNodes = current.getChildNodes();
+ for (int j = 0; j < childNodes.getLength(); j++)
+ {
+ Node currentChildNode = childNodes.item(j);
+ if ("return".equals(currentChildNode.getLocalName()))
+ {
+ currentChildNode.setTextContent("PutByServerSOAPHandler");
+ }
+ }
+ }
+ body.addDocument(document);
+ message.saveChanges();
+ }
+ catch (SOAPException e)
+ {
+ throw new RuntimeException(e);
+ }
+ return true;
+ }
+}
Added: framework/trunk/testsuite/test/resources/jaxws/jbws3034/WEB-INF/jboss-web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws3034/WEB-INF/jboss-web.xml (rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws3034/WEB-INF/jboss-web.xml 2010-09-22 16:45:37 UTC (rev 13006)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+ <context-root>/jaxws-jbws3034</context-root>
+</jboss-web>
\ No newline at end of file
Added: framework/trunk/testsuite/test/resources/jaxws/jbws3034/WEB-INF/web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws3034/WEB-INF/web.xml (rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws3034/WEB-INF/web.xml 2010-09-22 16:45:37 UTC (rev 13006)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <servlet>
+ <servlet-name>Endpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws3034.EndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Endpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Added: framework/trunk/testsuite/test/resources/jaxws/jbws3034/handlers.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws3034/handlers.xml (rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws3034/handlers.xml 2010-09-22 16:45:37 UTC (rev 13006)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ns1="http://org.jboss.ws/jaxws/samples/logicalhandler"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
+
+ <handler-chain>
+ <handler>
+ <handler-name>ServerSOAPHandler</handler-name>
+ <handler-class>org.jboss.test.ws.jaxws.jbws3034.ServerSOAPHandler</handler-class>
+ </handler>
+ </handler-chain>
+
+</handler-chains>
\ No newline at end of file
13 years, 7 months
JBossWS SVN: r13005 - in projects/plugins/maven/jaxws-tools/trunk: src/main/java/org/jboss/ws/plugins/tools and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-22 10:10:35 -0400 (Wed, 22 Sep 2010)
New Revision: 13005
Modified:
projects/plugins/maven/jaxws-tools/trunk/pom.xml
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/WSContractConsumerParams.java
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.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/wsconsume-plugin-config.xml
Log:
[JBWS-3132] Adding additionalHeaders support
Modified: projects/plugins/maven/jaxws-tools/trunk/pom.xml
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/pom.xml 2010-09-22 12:32:30 UTC (rev 13004)
+++ projects/plugins/maven/jaxws-tools/trunk/pom.xml 2010-09-22 14:10:35 UTC (rev 13005)
@@ -25,7 +25,7 @@
<!-- Properties -->
<properties>
- <jbossws.spi.version>1.3.0.GA</jbossws.spi.version>
+ <jbossws.spi.version>1.4.0.Beta2</jbossws.spi.version>
<maven.project.version>2.0.11</maven.project.version>
<maven.plugin.api.version>2.0.4</maven.plugin.api.version>
<maven.invoker.plugin.version>1.5</maven.invoker.plugin.version>
Modified: 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 2010-09-22 12:32:30 UTC (rev 13004)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java 2010-09-22 14:10:35 UTC (rev 13005)
@@ -59,8 +59,16 @@
* @parameter
*/
private File catalog;
-
+
/**
+ * Enables or disables processing of implicit SOAP headers (i.e. SOAP headers
+ * defined in the wsdl:binding but not wsdl:portType section.) Default is false.
+ *
+ * @parameter default-value="false"
+ */
+ protected Boolean additionalHeaders;
+
+ /**
* Sets the source directory. This directory will contain any generated Java source.
* If the directory does not exist, it will be created.
*
@@ -120,6 +128,7 @@
params.setAdditionalCompilerClassPath(new LinkedList<String>(getClasspathElements()));
params.setBindingFiles(bindingFiles);
params.setCatalog(catalog);
+ params.setAdditionalHeaders(additionalHeaders);
params.setExtension(extension);
params.setGenerateSource(generateSource);
params.setLoader(loader);
@@ -190,4 +199,9 @@
{
return target;
}
+
+ public Boolean isAdditionalHeaders()
+ {
+ return additionalHeaders;
+ }
}
Modified: projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractConsumerParams.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractConsumerParams.java 2010-09-22 12:32:30 UTC (rev 13004)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractConsumerParams.java 2010-09-22 14:10:35 UTC (rev 13005)
@@ -31,6 +31,7 @@
private List<String> additionalCompilerClassPath;
private List<String> bindingFiles;
private File catalog;
+ private boolean additionalHeaders;
private boolean extension;
private boolean generateSource;
private boolean noCompile;
@@ -41,6 +42,14 @@
private String wsdlLocation;
private String argLine;
+ public boolean isAdditionalHeaders()
+ {
+ return additionalHeaders;
+ }
+ public void setAdditionalHeaders(boolean additionalHeaders)
+ {
+ this.additionalHeaders = additionalHeaders;
+ }
public String getArgLine()
{
return argLine;
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 2010-09-22 12:32:30 UTC (rev 13004)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java 2010-09-22 14:10:35 UTC (rev 13005)
@@ -209,6 +209,10 @@
{
commandList.add("-n");
}
+ if (params.isAdditionalHeaders())
+ {
+ commandList.add("-a");
+ }
commandList.add(wsdl);
StringBuilder command = new StringBuilder();
for (String s : commandList)
@@ -277,6 +281,7 @@
{
callMethod(consumerClass, consumer, "setCatalog", params.getCatalog());
}
+ callMethod(consumerClass, consumer, "setAdditionalHeaders", params.isAdditionalHeaders());
callMethod(consumerClass, consumer, "setExtension", params.isExtension());
callMethod(consumerClass, consumer, "setGenerateSource", params.isGenerateSource());
callMethod(consumerClass, consumer, "setNoCompile", params.isNoCompile());
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 2010-09-22 12:32:30 UTC (rev 13004)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/ArgumentTest.java 2010-09-22 14:10:35 UTC (rev 13005)
@@ -62,6 +62,7 @@
assertEquals("wl", mojo.getWsdlLocation());
assertEquals("source", mojo.getSourceDirectory().getName());
assertTrue(mojo.isVerbose());
+ assertTrue(mojo.isAdditionalHeaders());
assertThat(mojo.getBindingFiles(), hasItems(new String[] { "b1" }));
assertThat(mojo.getClasspathElements(), hasItems(new String[] { "cp1", "cp2" }));
assertThat(mojo.getWsdls(), hasItems(new String[] { "w1", "w2" }));
Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-argument/wsconsume-plugin-config.xml
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-argument/wsconsume-plugin-config.xml 2010-09-22 12:32:30 UTC (rev 13004)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-argument/wsconsume-plugin-config.xml 2010-09-22 14:10:35 UTC (rev 13005)
@@ -17,6 +17,7 @@
<bindingFiles>
<bindingFile>b1</bindingFile>
</bindingFiles>
+ <additionalHeaders>true</additionalHeaders>
<catalog>catalog</catalog>
<sourceDirectory>source</sourceDirectory>
<targetPackage>tp</targetPackage>
13 years, 7 months
JBossWS SVN: r13004 - projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-22 08:32:30 -0400 (Wed, 22 Sep 2010)
New Revision: 13004
Added:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/MavenLogStreamConsumer.java
Modified:
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/AbstractWsProvideMojo.java
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java
Log:
Use proper logger and leverage CommandLineUtils for fork mode
Modified: 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 2010-09-22 09:21:56 UTC (rev 13003)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java 2010-09-22 12:32:30 UTC (rev 13004)
@@ -131,7 +131,7 @@
params.setWsdlLocation(wsdlLocation);
params.setArgLine(argLine);
params.setFork(fork);
- WSContractDelegate delegate = new WSContractDelegate();
+ WSContractDelegate delegate = new WSContractDelegate(getLog());
for (String wsdl : wsdls)
{
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 2010-09-22 09:21:56 UTC (rev 13003)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsProvideMojo.java 2010-09-22 12:32:30 UTC (rev 13004)
@@ -102,7 +102,7 @@
params.setFork(fork);
params.setArgLine(argLine);
- WSContractDelegate delegate = new WSContractDelegate();
+ WSContractDelegate delegate = new WSContractDelegate(getLog());
delegate.runProvider(params);
updateProjectSourceRoots();
Added: projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/MavenLogStreamConsumer.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/MavenLogStreamConsumer.java (rev 0)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/MavenLogStreamConsumer.java 2010-09-22 12:32:30 UTC (rev 13004)
@@ -0,0 +1,65 @@
+/*
+ * 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 org.apache.maven.plugin.logging.Log;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+/**
+ * A StreamConsumer that redirects logs to the maven log system
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 22-Sep-2010
+ */
+public class MavenLogStreamConsumer implements StreamConsumer
+{
+
+ public static enum Type {
+ OUTPUT, ERROR
+ }
+ private final Type type;
+ private final Log log;
+
+ public MavenLogStreamConsumer(Log log, Type type)
+ {
+ this.log = log;
+ this.type = type;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.codehaus.plexus.util.cli.StreamConsumer#consumeLine(java.lang.String)
+ */
+ public void consumeLine(String line)
+ {
+ if (Type.ERROR.equals(type))
+ {
+ log.error(line);
+ }
+ else
+ {
+ log.info(line);
+ }
+ }
+
+}
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 2010-09-22 09:21:56 UTC (rev 13003)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java 2010-09-22 12:32:30 UTC (rev 13004)
@@ -29,12 +29,21 @@
import java.util.LinkedList;
import java.util.List;
-import org.codehaus.plexus.util.Os;
+import org.apache.maven.plugin.logging.Log;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+import org.jboss.ws.plugins.tools.MavenLogStreamConsumer.Type;
public class WSContractDelegate
{
private static final PrintStream PS = System.out;
+ private Log log;
+ public WSContractDelegate(Log log)
+ {
+ this.log = log;
+ }
+
public void runProvider(WSContractProviderParams params) throws Exception
{
if (params.isFork())
@@ -68,9 +77,15 @@
List<String> commandList = initCommandList(params.getArgLine(), classpath, "org.jboss.wsf.spi.tools.cmd.WSProvide");
String commandLine = getProviderCommandLine(commandList, params);
- System.out.println("*oooooooooooooooooooooooooo* commandline: ***" + commandLine +"*oooooooooooooooooooo*");
- Process p = Runtime.getRuntime().exec(commandLine);
- int result = p.waitFor();
+ if (log.isDebugEnabled())
+ {
+ log.debug("Running command line: " + commandLine);
+ }
+
+ MavenLogStreamConsumer out = new MavenLogStreamConsumer(log, Type.OUTPUT);
+ MavenLogStreamConsumer err = new MavenLogStreamConsumer(log, Type.ERROR);
+ int result = CommandLineUtils.executeCommandLine(new Commandline(commandLine), out, err);
+
if (result != 0)
{
throw new Exception("Process terminated with code " + result);
@@ -104,9 +119,15 @@
List<String> commandList = initCommandList(params.getArgLine(), params.getAdditionalCompilerClassPath(), "org.jboss.wsf.spi.tools.cmd.WSConsume");
String commandLine = getConsumerCommandLine(commandList, params, wsdl);
- System.out.println("************** commandline: ***" + commandLine +"***");
- Process p = Runtime.getRuntime().exec(commandLine);
- int result = p.waitFor();
+ if (log.isDebugEnabled())
+ {
+ log.debug("Running command line: " + commandLine);
+ }
+
+ MavenLogStreamConsumer out = new MavenLogStreamConsumer(log, Type.OUTPUT);
+ MavenLogStreamConsumer err = new MavenLogStreamConsumer(log, Type.ERROR);
+ int result = CommandLineUtils.executeCommandLine(new Commandline(commandLine), out, err);
+
if (result != 0)
{
throw new Exception("Process terminated with code " + result);
@@ -116,17 +137,6 @@
private static List<String> initCommandList(String argLine, List<String> classpath, String toolClass)
{
List<String> commandList = new ArrayList<String>();
- if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
- {
- if ( Os.isFamily( Os.FAMILY_WIN9X ) )
- {
- commandList.add("command.com /c");
- }
- else
- {
- commandList.add("cmd.exe /c");
- }
- }
commandList.add("java");
if (argLine != null)
{
13 years, 7 months
JBossWS SVN: r13003 - in projects/plugins/maven/jaxws-tools/trunk/src/test: resources/test-argument and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-22 05:21:56 -0400 (Wed, 22 Sep 2010)
New Revision: 13003
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/resources/test-argument/wsconsume-plugin-config.xml
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/testWsConsume/pom-cxf.xml
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom-metro.xml
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom.xml
Log:
[JBWS-3130] Further tests
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 2010-09-22 08:58:12 UTC (rev 13002)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/ArgumentTest.java 2010-09-22 09:21:56 UTC (rev 13003)
@@ -65,6 +65,8 @@
assertThat(mojo.getBindingFiles(), hasItems(new String[] { "b1" }));
assertThat(mojo.getClasspathElements(), hasItems(new String[] { "cp1", "cp2" }));
assertThat(mojo.getWsdls(), hasItems(new String[] { "w1", "w2" }));
+ assertTrue(mojo.isFork());
+ assertEquals("-Dfoo=bar", mojo.getArgLine());
}
@Test
@@ -86,6 +88,8 @@
assertEquals("source", mojo.getSourceDirectory().getName());
assertTrue(mojo.isVerbose());
assertThat(mojo.getClasspathElements(), hasItems(new String[] { "cp1", "cp2" }));
+ assertTrue(mojo.isFork());
+ assertEquals("-Dfoo=bar", mojo.getArgLine());
}
}
Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-argument/wsconsume-plugin-config.xml
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-argument/wsconsume-plugin-config.xml 2010-09-22 08:58:12 UTC (rev 13002)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-argument/wsconsume-plugin-config.xml 2010-09-22 09:21:56 UTC (rev 13003)
@@ -24,6 +24,8 @@
<target>t</target>
<extension>true</extension>
<verbose>true</verbose>
+ <fork>true</fork>
+ <argLine>-Dfoo=bar</argLine>
</configuration>
</plugin>
</plugins>
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 2010-09-22 08:58:12 UTC (rev 13002)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-argument/wsprovide-plugin-config.xml 2010-09-22 09:21:56 UTC (rev 13003)
@@ -16,6 +16,8 @@
<endpointClass>endpoint</endpointClass>
<extension>true</extension>
<verbose>true</verbose>
+ <fork>true</fork>
+ <argLine>-Dfoo=bar</argLine>
</configuration>
</plugin>
</plugins>
Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom-cxf.xml
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom-cxf.xml 2010-09-22 08:58:12 UTC (rev 13002)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom-cxf.xml 2010-09-22 09:21:56 UTC (rev 13003)
@@ -58,6 +58,7 @@
<targetPackage>foo.bar2</targetPackage>
<sourceDirectory>${project.build.directory}/generated/java-sources</sourceDirectory>
<extension>true</extension>
+ <fork>true</fork>
</configuration>
</execution>
<execution>
@@ -82,6 +83,7 @@
<wsdl>${basedir}/test.wsdl</wsdl>
<wsdl>${basedir}/test2.wsdl</wsdl>
</wsdls>
+ <fork>true</fork>
</configuration>
</execution>
</executions>
Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom-metro.xml
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom-metro.xml 2010-09-22 08:58:12 UTC (rev 13002)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom-metro.xml 2010-09-22 09:21:56 UTC (rev 13003)
@@ -58,6 +58,7 @@
<targetPackage>foo.bar2</targetPackage>
<sourceDirectory>${project.build.directory}/generated/java-sources</sourceDirectory>
<extension>true</extension>
+ <fork>true</fork>
</configuration>
</execution>
<execution>
@@ -82,6 +83,7 @@
<wsdl>${basedir}/test.wsdl</wsdl>
<wsdl>${basedir}/test2.wsdl</wsdl>
</wsdls>
+ <fork>true</fork>
</configuration>
</execution>
</executions>
Modified: 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 2010-09-22 08:58:12 UTC (rev 13002)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testWsConsume/pom.xml 2010-09-22 09:21:56 UTC (rev 13003)
@@ -59,6 +59,7 @@
<targetPackage>foo.bar2</targetPackage>
<sourceDirectory>${project.build.directory}/generated/java-sources</sourceDirectory>
<extension>true</extension>
+ <fork>true</fork>
</configuration>
</execution>
<execution>
@@ -83,6 +84,7 @@
<wsdl>${basedir}/test.wsdl</wsdl>
<wsdl>${basedir}/test2.wsdl</wsdl>
</wsdls>
+ <fork>true</fork>
</configuration>
</execution>
</executions>
13 years, 7 months
JBossWS SVN: r13002 - in projects/plugins/maven/jaxws-tools/trunk/src: test/java/org/jboss/test/ws/plugins/tools/helpers and 20 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-22 04:58:12 -0400 (Wed, 22 Sep 2010)
New Revision: 13002
Added:
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/main/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/main/java/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/main/java/org/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/main/java/org/jboss/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/main/java/org/jboss/test/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/main/java/org/jboss/test/ws/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/main/java/org/jboss/test/ws/plugins/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/main/java/org/jboss/test/ws/plugins/tools/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/main/java/org/jboss/test/ws/plugins/tools/wsprovide/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/main/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint.java
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/test/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/test/java/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/test/java/org/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/test/java/org/jboss/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/test/java/org/jboss/test/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/test/java/org/jboss/test/ws/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/test/java/org/jboss/test/ws/plugins/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/test/java/org/jboss/test/ws/plugins/tools/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint2.java
Modified:
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/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/helpers/TestEndorseHelper.java
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom-cxf.xml
projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom.xml
Log:
[JBWS-3130] Adding fork mode support to wsprovide maven plugin too
Modified: 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 2010-09-22 06:42:01 UTC (rev 13001)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractToolsMojo.java 2010-09-22 08:58:12 UTC (rev 13002)
@@ -86,7 +86,7 @@
*/
protected abstract void updateProjectSourceRoots();
- protected ClassLoader getMavenClasspathAwareClassLoader(ClassLoader parent)
+ protected URLClassLoader getMavenClasspathAwareClassLoader()
{
List<String> classpath = getClasspathElements();
final int size = classpath.size();
@@ -102,7 +102,7 @@
getLog().warn("Skipping invalid classpath element: " + classpath.get(i));
}
}
- return new URLClassLoader(urls, parent);
+ return new URLClassLoader(urls, null);
}
public Boolean getExtension()
Modified: 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 2010-09-22 06:42:01 UTC (rev 13001)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java 2010-09-22 08:58:12 UTC (rev 13002)
@@ -23,6 +23,7 @@
import java.io.File;
import java.net.MalformedURLException;
+import java.net.URLClassLoader;
import java.util.LinkedList;
import java.util.List;
@@ -112,7 +113,7 @@
ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
try
{
- ClassLoader loader = getMavenClasspathAwareClassLoader(null);
+ URLClassLoader loader = getMavenClasspathAwareClassLoader();
Thread.currentThread().setContextClassLoader(loader);
WSContractConsumerParams params = new WSContractConsumerParams();
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 2010-09-22 06:42:01 UTC (rev 13001)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsProvideMojo.java 2010-09-22 08:58:12 UTC (rev 13002)
@@ -22,6 +22,7 @@
package org.jboss.ws.plugins.tools;
import java.io.File;
+import java.net.URLClassLoader;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
@@ -85,7 +86,7 @@
}
ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
- ClassLoader loader = getMavenClasspathAwareClassLoader(null);
+ URLClassLoader loader = getMavenClasspathAwareClassLoader();
Thread.currentThread().setContextClassLoader(loader);
try
{
@@ -98,6 +99,8 @@
params.setOutputDirectory(getOutputDirectory());
params.setResourceDirectory(resourceDirectory);
params.setSourceDirectory(sourceDirectory);
+ params.setFork(fork);
+ params.setArgLine(argLine);
WSContractDelegate delegate = new WSContractDelegate();
delegate.runProvider(params);
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 2010-09-22 06:42:01 UTC (rev 13001)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java 2010-09-22 08:58:12 UTC (rev 13002)
@@ -24,6 +24,7 @@
import java.io.File;
import java.io.PrintStream;
import java.lang.reflect.Method;
+import java.net.URL;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
@@ -36,6 +37,18 @@
public void runProvider(WSContractProviderParams params) throws Exception
{
+ if (params.isFork())
+ {
+ runProviderOutOfProcess(params);
+ }
+ else
+ {
+ runProviderInProcess(params);
+ }
+ }
+
+ private void runProviderInProcess(WSContractProviderParams params) throws Exception
+ {
ClassLoader loader = params.getLoader();
Class<?> providerClass = loader.loadClass("org.jboss.wsf.spi.tools.WSContractProvider");
Object provider = providerClass.getMethod("newInstance").invoke(null);
@@ -44,6 +57,26 @@
m.invoke(provider, new Object[]{params.getEndpointClass()});
}
+ private void runProviderOutOfProcess(WSContractProviderParams params) throws Exception
+ {
+ List<String> classpath = new LinkedList<String>();
+ URL[] urls = params.getLoader().getURLs();
+ for (URL url : urls)
+ {
+ classpath.add(url.getFile());
+ }
+ List<String> commandList = initCommandList(params.getArgLine(), classpath, "org.jboss.wsf.spi.tools.cmd.WSProvide");
+ String commandLine = getProviderCommandLine(commandList, params);
+
+ System.out.println("*oooooooooooooooooooooooooo* commandline: ***" + commandLine +"*oooooooooooooooooooo*");
+ Process p = Runtime.getRuntime().exec(commandLine);
+ int result = p.waitFor();
+ if (result != 0)
+ {
+ throw new Exception("Process terminated with code " + result);
+ }
+ }
+
public void runConsumer(WSContractConsumerParams params, String wsdl) throws Exception
{
if (params.isFork())
@@ -68,6 +101,20 @@
private void runConsumerOutOfProcess(WSContractConsumerParams params, String wsdl) throws Exception
{
+ List<String> commandList = initCommandList(params.getArgLine(), params.getAdditionalCompilerClassPath(), "org.jboss.wsf.spi.tools.cmd.WSConsume");
+ String commandLine = getConsumerCommandLine(commandList, params, wsdl);
+
+ System.out.println("************** commandline: ***" + commandLine +"***");
+ Process p = Runtime.getRuntime().exec(commandLine);
+ int result = p.waitFor();
+ if (result != 0)
+ {
+ throw new Exception("Process terminated with code " + result);
+ }
+ }
+
+ private static List<String> initCommandList(String argLine, List<String> classpath, String toolClass)
+ {
List<String> commandList = new ArrayList<String>();
if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
{
@@ -81,11 +128,11 @@
}
}
commandList.add("java");
- if (params.getArgLine() != null)
+ if (argLine != null)
{
- commandList.add(params.getArgLine());
+ commandList.add(argLine);
}
- List<String> cp = params.getAdditionalCompilerClassPath();
+ List<String> cp = classpath;
if (cp != null && !cp.isEmpty())
{
commandList.add("-classpath ");
@@ -98,7 +145,12 @@
additionalClasspath.deleteCharAt(additionalClasspath.length() - 1);
commandList.add(additionalClasspath.toString());
}
- commandList.add("org.jboss.wsf.spi.tools.cmd.WSConsume");
+ commandList.add(toolClass);
+ return commandList;
+ }
+
+ private static String getConsumerCommandLine(List<String> commandList, WSContractConsumerParams params, String wsdl)
+ {
List<String> bindingFiles = params.getBindingFiles();
if (bindingFiles != null && !bindingFiles.isEmpty())
{
@@ -154,13 +206,46 @@
command.append(s);
command.append(" ");
}
- System.out.println("************** commandline: ***" + command.toString()+"***");
- Process p = Runtime.getRuntime().exec(command.toString());
- int result = p.waitFor();
- if (result != 0)
+ return command.toString();
+ }
+
+ private static String getProviderCommandLine(List<String> commandList, WSContractProviderParams params)
+ {
+ if (params.isGenerateSource())
{
- throw new Exception("Process terminated with code " + result);
+ commandList.add("-k");
}
+ if (params.isGenerateWsdl())
+ {
+ commandList.add("-w");
+ }
+ if (params.getOutputDirectory() != null)
+ {
+ commandList.add("-o");
+ commandList.add(params.getOutputDirectory().getAbsolutePath());
+ }
+ if (params.getSourceDirectory() != null)
+ {
+ commandList.add("-s");
+ commandList.add(params.getSourceDirectory().getAbsolutePath());
+ }
+ if (params.getResourceDirectory() != null)
+ {
+ commandList.add("-r");
+ commandList.add(params.getResourceDirectory().getAbsolutePath());
+ }
+ if (params.isExtension())
+ {
+ commandList.add("-e");
+ }
+ commandList.add(params.getEndpointClass());
+ StringBuilder command = new StringBuilder();
+ for (String s : commandList)
+ {
+ command.append(s);
+ command.append(" ");
+ }
+ return command.toString();
}
private static void setupConsumer(Class<?> consumerClass, Object consumer, WSContractConsumerParams params) throws Exception
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 2010-09-22 06:42:01 UTC (rev 13001)
+++ projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractProviderParams.java 2010-09-22 08:58:12 UTC (rev 13002)
@@ -22,18 +22,37 @@
package org.jboss.ws.plugins.tools;
import java.io.File;
+import java.net.URLClassLoader;
public class WSContractProviderParams
{
+ private boolean fork;
private String endpointClass;
- private ClassLoader loader;
+ private URLClassLoader loader;
private boolean extension;
private boolean generateSource;
private boolean generateWsdl;
private File outputDirectory;
private File resourceDirectory;
private File sourceDirectory;
+ private String argLine;
+ public boolean isFork()
+ {
+ return fork;
+ }
+ public void setFork(boolean fork)
+ {
+ this.fork = fork;
+ }
+ public String getArgLine()
+ {
+ return argLine;
+ }
+ public void setArgLine(String argLine)
+ {
+ this.argLine = argLine;
+ }
public String getEndpointClass()
{
return endpointClass;
@@ -42,11 +61,11 @@
{
this.endpointClass = endpointClass;
}
- public ClassLoader getLoader()
+ public URLClassLoader getLoader()
{
return loader;
}
- public void setLoader(ClassLoader loader)
+ public void setLoader(URLClassLoader loader)
{
this.loader = loader;
}
Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestEndorseHelper.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestEndorseHelper.java 2010-09-22 06:42:01 UTC (rev 13001)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/java/org/jboss/test/ws/plugins/tools/helpers/TestEndorseHelper.java 2010-09-22 08:58:12 UTC (rev 13002)
@@ -37,6 +37,8 @@
{
private Long lastModificationTime = null;
private Long lastModificationTime2 = null;
+ private Long wsdlLastModificationTime = null;
+ private Long wsdlLastModificationTime2 = null;
private static final String JAXWS_22_ENDPOINT_SERVICE_CONSTRUCTOR = "public EndpointService(URL wsdlLocation, WebServiceFeature... features)";
private static final String JAXWS_22_ENDPOINT_SERVICE_CONSTRUCTOR_CONTENTS = "super(wsdlLocation, serviceName, features);";
@@ -101,8 +103,32 @@
return false;
}
+ //wsdl check for wsprovide executions
+ File wsdl = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsprovide" + File.separator + "resources" +
+ File.separator + "TestEndpointService.wsdl");
+ File wsdl2 = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsprovide" + File.separator + "resources" +
+ File.separator + "TestEndpoint2Service.wsdl");
+ boolean wsdlCheck = internalVerify(wsdl, wsdlLastModificationTime);
+ wsdlCheck = wsdlCheck && internalVerify(wsdl2, wsdlLastModificationTime2);
+ if (!wsdlCheck) return false;
+
return true;
}
+
+ private static boolean internalVerify(File file, Long modificationTime)
+ {
+ if (!file.exists())
+ {
+ System.out.println(file + " not found!");
+ return false;
+ }
+ if (modificationTime != null && file.lastModified() == modificationTime)
+ {
+ System.out.println(file + " was not modified by the plugin!");
+ return false;
+ }
+ return true;
+ }
@Override
public void setup(File basedir, File localRepositoryPath, Map<?, ?> context) throws Exception
@@ -122,6 +148,20 @@
{
this.lastModificationTime2 = endpointServiceFile2.lastModified();
}
+
+ //wsprovide executions
+ File wsdl = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsprovide" + File.separator + "resources" +
+ File.separator + "TestEndpointService.wsdl");
+ if (wsdl.exists())
+ {
+ this.wsdlLastModificationTime = wsdl.lastModified();
+ }
+ File wsdl2 = new File(basedir.getAbsolutePath() + File.separator + "target" + File.separator + "wsprovide" + File.separator + "resources" +
+ File.separator + "TestEndpointService2.wsdl");
+ if (wsdl2.exists())
+ {
+ this.wsdlLastModificationTime2 = wsdl2.lastModified();
+ }
}
private String readContents(File file) throws Exception
Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom-cxf.xml
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom-cxf.xml 2010-09-22 06:42:01 UTC (rev 13001)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom-cxf.xml 2010-09-22 08:58:12 UTC (rev 13002)
@@ -64,6 +64,26 @@
<targetPackage>foo.test.bar</targetPackage>
</configuration>
</execution>
+ <execution>
+ <id>Third execution</id>
+ <goals>
+ <goal>wsprovide</goal>
+ </goals>
+ <configuration>
+ <endpointClass>org.jboss.test.ws.plugins.tools.wsprovide.TestEndpoint</endpointClass>
+ <generateWsdl>true</generateWsdl>
+ </configuration>
+ </execution>
+ <execution>
+ <id>Fourth execution</id>
+ <goals>
+ <goal>wsprovide-test</goal>
+ </goals>
+ <configuration>
+ <endpointClass>org.jboss.test.ws.plugins.tools.wsprovide.TestEndpoint2</endpointClass>
+ <generateWsdl>true</generateWsdl>
+ </configuration>
+ </execution>
</executions>
</plugin>
<plugin>
Modified: projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom.xml
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom.xml 2010-09-22 06:42:01 UTC (rev 13001)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/pom.xml 2010-09-22 08:58:12 UTC (rev 13002)
@@ -64,6 +64,26 @@
<targetPackage>foo.test.bar</targetPackage>
</configuration>
</execution>
+ <execution>
+ <id>Third execution</id>
+ <goals>
+ <goal>wsprovide</goal>
+ </goals>
+ <configuration>
+ <endpointClass>org.jboss.test.ws.plugins.tools.wsprovide.TestEndpoint</endpointClass>
+ <generateWsdl>true</generateWsdl>
+ </configuration>
+ </execution>
+ <execution>
+ <id>Fourth execution</id>
+ <goals>
+ <goal>wsprovide-test</goal>
+ </goals>
+ <configuration>
+ <endpointClass>org.jboss.test.ws.plugins.tools.wsprovide.TestEndpoint2</endpointClass>
+ <generateWsdl>true</generateWsdl>
+ </configuration>
+ </execution>
</executions>
</plugin>
<plugin>
Added: projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/main/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/main/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint.java (rev 0)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/main/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint.java 2010-09-22 08:58:12 UTC (rev 13002)
@@ -0,0 +1,43 @@
+/*
+ * 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;
+import javax.xml.ws.soap.Addressing;
+import javax.xml.ws.soap.AddressingFeature.Responses;
+
+/**
+ * A simple test endpoint service implementation
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 22-Sep-2010
+ *
+ */
+@WebService
+@Addressing(responses = Responses.ALL) //this requires JAXWS 2.2
+public class TestEndpoint
+{
+ 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/testEndorse/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint2.java
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint2.java (rev 0)
+++ projects/plugins/maven/jaxws-tools/trunk/src/test/resources/test-embedded/testEndorse/src/test/java/org/jboss/test/ws/plugins/tools/wsprovide/TestEndpoint2.java 2010-09-22 08:58:12 UTC (rev 13002)
@@ -0,0 +1,43 @@
+/*
+ * 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;
+import javax.xml.ws.soap.Addressing;
+import javax.xml.ws.soap.AddressingFeature.Responses;
+
+/**
+ * A simple test endpoint service implementation
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 22-Sep-2010
+ *
+ */
+@WebService
+@Addressing(responses = Responses.ALL) //this requires JAXWS 2.2
+public class TestEndpoint2
+{
+ public String test(String s)
+ {
+ return s;
+ }
+}
\ No newline at end of file
13 years, 7 months
JBossWS SVN: r13001 - stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-22 02:42:01 -0400 (Wed, 22 Sep 2010)
New Revision: 13001
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java
Log:
Fixing message on cxf tool target
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java 2010-09-22 06:40:27 UTC (rev 13000)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java 2010-09-22 06:42:01 UTC (rev 13001)
@@ -211,7 +211,8 @@
// Always set the target
if (target != null)
{
- stream.println("WSConsume (CXF) does not allow to setup the JAX-WS specification target, using JAX-WS 2.1.");
+ stream.println("WSConsume (CXF) does not allow to setup the JAX-WS specification target, using the currently " +
+ "configured JAX-WS version (check your JVM version and/or endorsed libs)");
}
//Always generate wrapped style for reference element:CXF-1079
13 years, 7 months