Skip to content

Commit 96d1792

Browse files
[#585] add wsdl test project
1 parent 696f37c commit 96d1792

File tree

8 files changed

+181
-78
lines changed

8 files changed

+181
-78
lines changed

maven-plugin/tests/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
<module>jt-194</module>
6363
<module>jt-306</module>
6464
<module>jt-40</module>
65+
<module>wsdl-file</module>
6566
</modules>
6667
<build>
6768
<plugins>

maven-plugin/tests/wsdl-file/build-1.5.bat

-4
This file was deleted.

maven-plugin/tests/wsdl-file/build-1.6.bat

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<wsdl:definitions name="CustomerServiceService"
3+
targetNamespace="http://customerservice.example.com/service"
4+
xmlns:tns="http://customerservice.example.com/service"
5+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
6+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
7+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
8+
<wsdl:types>
9+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
10+
xmlns:tns="http://customerservice.example.com/service"
11+
xmlns:cns="http://customerservice.example.com/model"
12+
attributeFormDefault="unqualified"
13+
elementFormDefault="qualified"
14+
targetNamespace="http://customerservice.example.com/service">
15+
16+
<xs:import schemaLocation="customer.xsd" namespace="http://customerservice.example.com/model"/>
17+
<!-- ... -->
18+
<xs:element name="getCustomerById" type="tns:getCustomerById" />
19+
<xs:complexType name="getCustomerById">
20+
<xs:sequence>
21+
<xs:element minOccurs="0" name="customerId" type="xs:int" />
22+
</xs:sequence>
23+
</xs:complexType>
24+
<xs:element name="getCustomerByIdResponse" type="tns:getCustomerByIdResponse" />
25+
<xs:complexType name="getCustomerByIdResponse">
26+
<xs:sequence>
27+
<xs:element minOccurs="0" name="return" type="cns:customer" />
28+
</xs:sequence>
29+
</xs:complexType>
30+
<!-- ... -->
31+
<xs:element name="updateCustomer" type="tns:updateCustomer" />
32+
<xs:complexType name="updateCustomer">
33+
<xs:sequence>
34+
<xs:element minOccurs="0" name="customer" type="cns:customer" />
35+
</xs:sequence>
36+
</xs:complexType>
37+
<xs:element name="updateCustomerResponse" type="tns:updateCustomerResponse" />
38+
<xs:complexType name="updateCustomerResponse">
39+
<xs:sequence>
40+
<xs:element minOccurs="0" name="customerId" type="xs:int" />
41+
</xs:sequence>
42+
</xs:complexType>
43+
<!-- ... -->
44+
<xs:element name="deleteCustomerById" type="tns:deleteCustomerById" />
45+
<xs:complexType name="deleteCustomerById">
46+
<xs:sequence>
47+
<xs:element minOccurs="0" name="customerId" type="xs:int" />
48+
</xs:sequence>
49+
</xs:complexType>
50+
<!-- ... -->
51+
<xs:element name="NoSuchCustomer" type="tns:NoSuchCustomer" />
52+
<xs:complexType name="NoSuchCustomer">
53+
<xs:sequence>
54+
<xs:element name="customerId" nillable="true" type="xs:int" />
55+
</xs:sequence>
56+
</xs:complexType>
57+
</xs:schema>
58+
</wsdl:types>
59+
<wsdl:message name="getCustomerById">
60+
<wsdl:part name="parameters" element="tns:getCustomerById"/>
61+
</wsdl:message>
62+
<wsdl:message name="getCustomerByIdResponse">
63+
<wsdl:part name="parameters" element="tns:getCustomerByIdResponse"/>
64+
</wsdl:message>
65+
<wsdl:message name="updateCustomer">
66+
<wsdl:part name="parameters" element="tns:updateCustomer"/>
67+
</wsdl:message>
68+
<wsdl:message name="updateCustomerResponse">
69+
<wsdl:part name="parameters" element="tns:updateCustomerResponse"/>
70+
</wsdl:message>
71+
<wsdl:message name="deleteCustomerById">
72+
<wsdl:part name="parameters" element="tns:deleteCustomerById"/>
73+
</wsdl:message>
74+
<wsdl:message name="NoSuchCustomerException">
75+
<wsdl:part name="NoSuchCustomerException" element="tns:NoSuchCustomer"/>
76+
</wsdl:message>
77+
<wsdl:portType name="CustomerService">
78+
<wsdl:operation name="updateCustomer">
79+
<wsdl:input name="updateCustomer" message="tns:updateCustomer"/>
80+
<wsdl:output name="updateCustomerResponse" message="tns:updateCustomerResponse"/>
81+
</wsdl:operation>
82+
<wsdl:operation name="deleteCustomerById">
83+
<wsdl:input name="deleteCustomerById" message="tns:deleteCustomerById"/>
84+
<wsdl:fault name="NoSuchCustomerException" message="tns:NoSuchCustomerException"/>
85+
</wsdl:operation>
86+
<wsdl:operation name="getCustomerById">
87+
<wsdl:input name="getCustomerById" message="tns:getCustomerById"/>
88+
<wsdl:output name="getCustomerByIdResponse" message="tns:getCustomerByIdResponse"/>
89+
<wsdl:fault name="NoSuchCustomerException" message="tns:NoSuchCustomerException"/>
90+
</wsdl:operation>
91+
</wsdl:portType>
92+
<wsdl:binding name="CustomerServiceServiceSoapBinding"
93+
type="tns:CustomerService">
94+
<soap:binding style="document"
95+
transport="http://schemas.xmlsoap.org/soap/http" />
96+
<wsdl:operation name="updateCustomer">
97+
<soap:operation soapAction="" style="document" />
98+
<wsdl:input name="updateCustomer">
99+
<soap:body use="literal" />
100+
</wsdl:input>
101+
<wsdl:output name="updateCustomerResponse">
102+
<soap:body use="literal" />
103+
</wsdl:output>
104+
</wsdl:operation>
105+
<wsdl:operation name="deleteCustomerById">
106+
<soap:operation soapAction="" style="document" />
107+
<wsdl:input name="deleteCustomerById">
108+
<soap:body use="literal" />
109+
</wsdl:input>
110+
<wsdl:fault name="NoSuchCustomerException">
111+
<soap:fault name="NoSuchCustomerException" use="literal" />
112+
</wsdl:fault>
113+
</wsdl:operation>
114+
<wsdl:operation name="getCustomerById">
115+
<soap:operation soapAction="" style="document" />
116+
<wsdl:input name="getCustomerById">
117+
<soap:body use="literal" />
118+
</wsdl:input>
119+
<wsdl:output name="getCustomerByIdResponse">
120+
<soap:body use="literal" />
121+
</wsdl:output>
122+
<wsdl:fault name="NoSuchCustomerException">
123+
<soap:fault name="NoSuchCustomerException" use="literal" />
124+
</wsdl:fault>
125+
</wsdl:operation>
126+
</wsdl:binding>
127+
<wsdl:service name="CustomerServiceService">
128+
<wsdl:port name="CustomerServicePort" binding="tns:CustomerServiceServiceSoapBinding">
129+
<soap:address location="http://localhost:8080/CustomerServicePort" />
130+
</wsdl:port>
131+
</wsdl:service>
132+
</wsdl:definitions>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<xs:schema
2+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
3+
xmlns:tns="http://customerservice.example.com/model"
4+
elementFormDefault="qualified"
5+
attributeFormDefault="unqualified"
6+
targetNamespace="http://customerservice.example.com/model">
7+
<xs:complexType name="customer">
8+
<xs:sequence>
9+
<xs:element name="customerId" type="xs:int" minOccurs="0"/>
10+
<xs:element minOccurs="0" name="name" type="xs:string" />
11+
<xs:element maxOccurs="unbounded" minOccurs="0" name="address"
12+
nillable="true" type="xs:string" />
13+
<xs:element minOccurs="0" name="numOrders" type="xs:int" />
14+
<xs:element name="revenue" type="xs:double" />
15+
<xs:element minOccurs="0" name="test" type="xs:decimal" />
16+
<xs:element minOccurs="0" name="birthDate" type="xs:date" />
17+
<xs:element minOccurs="0" name="type" type="tns:customerType" />
18+
</xs:sequence>
19+
</xs:complexType>
20+
<xs:simpleType name="customerType">
21+
<xs:restriction base="xs:string">
22+
<xs:enumeration value="PRIVATE" />
23+
<xs:enumeration value="BUSINESS" />
24+
</xs:restriction>
25+
</xs:simpleType>
26+
</xs:schema>

maven-plugin/tests/wsdl-file/src/main/resources/pedidowebservice.wsdl

-47
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.example.customerservice.service.test;
2+
3+
import jakarta.xml.bind.JAXBContext;
4+
import jakarta.xml.bind.JAXBException;
5+
6+
import com.example.customerservice.service.DeleteCustomerById;
7+
import org.junit.jupiter.api.Assertions;
8+
import org.junit.jupiter.api.Test;
9+
10+
public class JAXBContextTest {
11+
12+
public static final String CONTEXT_PATH = DeleteCustomerById.class.getPackage().getName();
13+
14+
@Test
15+
public void successfullyCreatesMarshallerAndUnmarshaller() throws JAXBException {
16+
final JAXBContext context = JAXBContext.newInstance(CONTEXT_PATH);
17+
Assertions.assertNotNull(context.createMarshaller());
18+
Assertions.assertNotNull(context.createUnmarshaller());
19+
20+
}
21+
22+
}

maven-plugin/tests/wsdl-file/src/test/java/net/webservicex/test/JAXBContextTest.java

-23
This file was deleted.

0 commit comments

Comments
 (0)