Skip to content

Commit 2ecbb45

Browse files
committed
* Mavenized the addressbook sample.
* Reuse the artifacts generated by addr-sample and echo-sample in the integration tests (instead of regenerating them).
1 parent 7946f75 commit 2ecbb45

10 files changed

Lines changed: 181 additions & 40 deletions

File tree

distribution/src/main/assembly/bin.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@
2828
<directory>src/main/files</directory>
2929
<outputDirectory>/</outputDirectory>
3030
</fileSet>
31+
<fileSet>
32+
<directory>../samples/addr-sample/src/main/java</directory>
33+
<outputDirectory>/</outputDirectory>
34+
</fileSet>
35+
<fileSet>
36+
<directory>../samples/addr-sample/src/test/java</directory>
37+
<outputDirectory>/</outputDirectory>
38+
</fileSet>
39+
<fileSet>
40+
<directory>../samples/addr-sample/src/main/wsdl</directory>
41+
<outputDirectory>samples/addr</outputDirectory>
42+
</fileSet>
3143
<fileSet>
3244
<directory>../samples/attachments-sample/src/main/java</directory>
3345
<outputDirectory>/</outputDirectory>

integration/pom.xml

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@
5050
<version>${project.version}</version>
5151
<scope>test</scope>
5252
</dependency>
53+
<dependency>
54+
<groupId>${project.groupId}</groupId>
55+
<artifactId>addr-sample</artifactId>
56+
<version>${project.version}</version>
57+
<scope>test</scope>
58+
</dependency>
59+
<dependency>
60+
<groupId>${project.groupId}</groupId>
61+
<artifactId>echo-sample</artifactId>
62+
<version>${project.version}</version>
63+
<scope>test</scope>
64+
</dependency>
5365
<dependency>
5466
<groupId>log4j</groupId>
5567
<artifactId>log4j</artifactId>
@@ -194,44 +206,6 @@
194206
<testDefaultHttpPort>8080</testDefaultHttpPort>
195207
</configuration>
196208
<executions>
197-
<execution>
198-
<id>samples-echo</id>
199-
<goals>
200-
<goal>generate-test-sources</goal>
201-
</goals>
202-
<configuration>
203-
<file>../samples/echo-sample/src/main/wsdl/InteropTest.wsdl</file>
204-
<generate>client</generate>
205-
<typeMappingVersion>1.1</typeMappingVersion>
206-
<mappings>
207-
<mapping>
208-
<namespace>http://soapinterop.org/</namespace>
209-
<package>samples.echo</package>
210-
</mapping>
211-
<mapping>
212-
<namespace>http://soapinterop.org/xsd</namespace>
213-
<package>samples.echo</package>
214-
</mapping>
215-
</mappings>
216-
</configuration>
217-
</execution>
218-
<execution>
219-
<id>samples-addr</id>
220-
<goals>
221-
<goal>generate-test-sources</goal>
222-
</goals>
223-
<configuration>
224-
<file>../distribution/src/main/files/samples/addr/AddressBook.wsdl</file>
225-
<generate>client</generate>
226-
<typeMappingVersion>1.1</typeMappingVersion>
227-
<mappings>
228-
<mapping>
229-
<namespace>urn:AddressFetcher2</namespace>
230-
<package>samples.addr</package>
231-
</mapping>
232-
</mappings>
233-
</configuration>
234-
</execution>
235209
<!-- Import Test 1: some namespace->package mappings from the -->
236210
<!-- command line, some generated, some from -->
237211
<!-- NStoPkg.properties. -->

integration/src/test/java/test/dynamic/ServiceGetPort.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public ServiceGetPort(String name) {
3939

4040
public void testGetGeneratedStub() throws Exception {
4141
Service service = ServiceFactory.newInstance().createService(
42-
new URL("file:../distribution/src/main/files/samples/addr/AddressBook.wsdl"),
42+
new URL("file:../samples/addr-sample/src/main/wsdl/AddressBook.wsdl"),
4343
new QName("urn:AddressFetcher2", "AddressBookService"));
4444
QName portName = new QName("urn:AddressFetcher2", "AddressBook");
4545
Remote stub = service.getPort(portName, AddressBook.class);

samples/addr-sample/pom.xml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one
4+
~ or more contributor license agreements. See the NOTICE file
5+
~ distributed with this work for additional information
6+
~ regarding copyright ownership. The ASF licenses this file
7+
~ to you under the Apache License, Version 2.0 (the
8+
~ "License"); you may not use this file except in compliance
9+
~ with the License. You may obtain a copy of the License at
10+
~
11+
~ http://www.apache.org/licenses/LICENSE-2.0
12+
~
13+
~ Unless required by applicable law or agreed to in writing,
14+
~ software distributed under the License is distributed on an
15+
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
~ KIND, either express or implied. See the License for the
17+
~ specific language governing permissions and limitations
18+
~ under the License.
19+
-->
20+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
<parent>
23+
<groupId>org.apache.axis</groupId>
24+
<artifactId>samples</artifactId>
25+
<version>1.4.1-SNAPSHOT</version>
26+
<relativePath>../pom.xml</relativePath>
27+
</parent>
28+
<artifactId>addr-sample</artifactId>
29+
<name>Addressbook Sample</name>
30+
<dependencies>
31+
<dependency>
32+
<groupId>${project.groupId}</groupId>
33+
<artifactId>axis-rt-core</artifactId>
34+
<version>${project.version}</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>junit</groupId>
38+
<artifactId>junit</artifactId>
39+
<scope>test</scope>
40+
</dependency>
41+
<dependency>
42+
<groupId>${project.groupId}</groupId>
43+
<artifactId>axis-standalone-server</artifactId>
44+
<version>${project.version}</version>
45+
<scope>test</scope>
46+
</dependency>
47+
</dependencies>
48+
<build>
49+
<plugins>
50+
<plugin>
51+
<groupId>${project.groupId}</groupId>
52+
<artifactId>maven-wsdl2java-plugin</artifactId>
53+
<version>${project.version}</version>
54+
<executions>
55+
<execution>
56+
<id>samples-addr</id>
57+
<goals>
58+
<goal>generate-sources</goal>
59+
</goals>
60+
<configuration>
61+
<file>src/main/wsdl/AddressBook.wsdl</file>
62+
<generate>both</generate>
63+
<typeMappingVersion>1.1</typeMappingVersion>
64+
<skeleton>true</skeleton>
65+
<deployScope>session</deployScope>
66+
<mappings>
67+
<mapping>
68+
<namespace>urn:AddressFetcher2</namespace>
69+
<package>samples.addr</package>
70+
</mapping>
71+
</mappings>
72+
<deployWsdd>${project.build.directory}/wsdd/AddressBook.wsdd</deployWsdd>
73+
</configuration>
74+
</execution>
75+
</executions>
76+
</plugin>
77+
<plugin>
78+
<artifactId>maven-surefire-plugin</artifactId>
79+
<executions>
80+
<execution>
81+
<id>default-test</id>
82+
<configuration>
83+
<skip>true</skip>
84+
</configuration>
85+
</execution>
86+
</executions>
87+
</plugin>
88+
<plugin>
89+
<groupId>org.codehaus.mojo</groupId>
90+
<artifactId>build-helper-maven-plugin</artifactId>
91+
<executions>
92+
<execution>
93+
<id>reserve-network-port</id>
94+
<goals>
95+
<goal>reserve-network-port</goal>
96+
</goals>
97+
<phase>pre-integration-test</phase>
98+
<configuration>
99+
<portNames>
100+
<portName>test.functional.ServicePort</portName>
101+
</portNames>
102+
</configuration>
103+
</execution>
104+
</executions>
105+
</plugin>
106+
<plugin>
107+
<groupId>${project.groupId}</groupId>
108+
<artifactId>maven-axis-server-plugin</artifactId>
109+
<version>${project.version}</version>
110+
<executions>
111+
<execution>
112+
<id>start-server</id>
113+
<goals>
114+
<goal>start-server</goal>
115+
</goals>
116+
<configuration>
117+
<port>${test.functional.ServicePort}</port>
118+
<wsdds>
119+
<wsdd>
120+
<directory>${project.build.directory}/wsdd</directory>
121+
</wsdd>
122+
</wsdds>
123+
</configuration>
124+
</execution>
125+
<execution>
126+
<id>stop-server</id>
127+
<goals>
128+
<goal>stop-all</goal>
129+
</goals>
130+
</execution>
131+
</executions>
132+
</plugin>
133+
<plugin>
134+
<artifactId>maven-failsafe-plugin</artifactId>
135+
<executions>
136+
<execution>
137+
<goals>
138+
<goal>integration-test</goal>
139+
<goal>verify</goal>
140+
</goals>
141+
<configuration>
142+
<includes>
143+
<include>**/*TestCase.java</include>
144+
</includes>
145+
<systemPropertyVariables>
146+
<test.functional.ServicePort>${test.functional.ServicePort}</test.functional.ServicePort>
147+
</systemPropertyVariables>
148+
</configuration>
149+
</execution>
150+
</executions>
151+
</plugin>
152+
</plugins>
153+
</build>
154+
</project>

distribution/src/main/files/samples/addr/AddressBookSOAPBindingImpl.java renamed to samples/addr-sample/src/main/java/samples/addr/AddressBookSOAPBindingImpl.java

File renamed without changes.

distribution/src/main/files/samples/addr/DOMUtils.java renamed to samples/addr-sample/src/main/java/samples/addr/DOMUtils.java

File renamed without changes.
File renamed without changes.

distribution/src/main/files/samples/addr/AddressBook.wsdl renamed to samples/addr-sample/src/main/wsdl/AddressBook.wsdl

File renamed without changes.

distribution/src/main/files/samples/addr/AddressBookTestCase.java renamed to samples/addr-sample/src/test/java/samples/addr/AddressBookTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public AddressBookTestCase(String name) {
3232
}
3333

3434
public void doTest () throws Exception {
35-
String[] args = {};
35+
String[] args = { "-p", System.getProperty("test.functional.ServicePort", "8080") };
3636
Main.main(args);
3737
}
3838

samples/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
Root POM for the Axis samples.
3333
</description>
3434
<modules>
35+
<module>addr-sample</module>
3536
<module>attachments-sample</module>
3637
<module>bidbuy-sample</module>
3738
<module>echo-sample</module>

0 commit comments

Comments
 (0)