Skip to content

Commit 56d8228

Browse files
authored
Merge pull request #1948 from venmanyarun/toolchain_integration_tests
Adding more toolchain integration tests
2 parents aea5fc3 + 27cc3c1 commit 56d8228

File tree

13 files changed

+658
-2
lines changed

13 files changed

+658
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
invoker.goals.1 = clean verify -Pdeploy-loose-app -DcopyLibsDirectory=target/libs
2+
3+
invoker.goals.2 = clean verify -Pdeploy-app
4+
5+
invoker.goals.3 = clean verify -Pundeploy-loose-app
Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,280 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<groupId>io.openliberty.tools.it</groupId>
8+
<artifactId>tests</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
</parent>
11+
12+
<artifactId>deploy-loose-config-apps-with-toolchain-it</artifactId>
13+
<packaging>war</packaging>
14+
15+
<properties>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
18+
<package.type>jar</package.type>
19+
<include>minify</include>
20+
</properties>
21+
22+
<dependencies>
23+
<dependency>
24+
<groupId>javax.servlet</groupId>
25+
<artifactId>javax.servlet-api</artifactId>
26+
<version>3.1.0</version>
27+
<scope>provided</scope>
28+
</dependency>
29+
<dependency>
30+
<groupId>commons-httpclient</groupId>
31+
<artifactId>commons-httpclient</artifactId>
32+
<version>3.1</version>
33+
<scope>test</scope>
34+
</dependency>
35+
<dependency>
36+
<groupId>junit</groupId>
37+
<artifactId>junit</artifactId>
38+
<version>4.13.1</version>
39+
<scope>test</scope>
40+
</dependency>
41+
<dependency>
42+
<groupId>io.openliberty.tools.it</groupId>
43+
<artifactId>loose-config-fragment-it</artifactId>
44+
<version>1.0-SNAPSHOT</version>
45+
</dependency>
46+
</dependencies>
47+
48+
<build>
49+
<plugins>
50+
<plugin>
51+
<groupId>org.apache.maven.plugins</groupId>
52+
<artifactId>maven-war-plugin</artifactId>
53+
<version>3.4.0</version>
54+
<configuration>
55+
<failOnMissingWebXml>false</failOnMissingWebXml>
56+
<packagingExcludes>pom.xml</packagingExcludes>
57+
<webResources>
58+
<resource>
59+
<!-- this is relative to the pom.xml directory -->
60+
<directory>target/generated-test-sources</directory>
61+
</resource>
62+
<resource>
63+
<directory>target/generated-sources</directory>
64+
<targetPath>generated</targetPath>
65+
</resource>
66+
</webResources>
67+
</configuration>
68+
</plugin>
69+
<plugin>
70+
<groupId>io.openliberty.tools</groupId>
71+
<artifactId>liberty-maven-plugin</artifactId>
72+
<version>@pom.version@</version>
73+
<configuration>
74+
<jdkToolchain>
75+
<version>11</version>
76+
</jdkToolchain>
77+
<runtimeArtifact>
78+
<groupId>${project.groupId}</groupId>
79+
<artifactId>assembly-server</artifactId>
80+
<version>${project.version}</version>
81+
<type>zip</type>
82+
</runtimeArtifact>
83+
<serverName>test</serverName>
84+
<appsDirectory>apps</appsDirectory>
85+
<deployPackages>project</deployPackages>
86+
<stripVersion>true</stripVersion>
87+
</configuration>
88+
<executions>
89+
<execution>
90+
<id>create-liberty-server</id>
91+
<phase>package</phase>
92+
<goals>
93+
<goal>create</goal>
94+
</goals>
95+
</execution>
96+
<execution>
97+
<id>start-liberty-server</id>
98+
<phase>pre-integration-test</phase>
99+
<goals>
100+
<goal>start</goal>
101+
</goals>
102+
<configuration>
103+
<background>true</background>
104+
<verifyTimeout>40</verifyTimeout>
105+
</configuration>
106+
</execution>
107+
<execution>
108+
<id>check-liberty-server</id>
109+
<phase>pre-integration-test</phase>
110+
<goals>
111+
<goal>status</goal>
112+
</goals>
113+
</execution>
114+
<execution>
115+
<id>stop-liberty-server</id>
116+
<phase>post-integration-test</phase>
117+
<goals>
118+
<goal>stop</goal>
119+
</goals>
120+
</execution>
121+
<execution>
122+
<id>clean-server</id>
123+
<phase>post-integration-test</phase>
124+
<goals>
125+
<goal>clean</goal>
126+
</goals>
127+
<configuration>
128+
<cleanDropins>true</cleanDropins>
129+
<cleanApps>true</cleanApps>
130+
<cleanLogs>false</cleanLogs>
131+
<cleanWorkarea>false</cleanWorkarea>
132+
</configuration>
133+
</execution>
134+
</executions>
135+
</plugin>
136+
<plugin>
137+
<groupId>org.apache.maven.plugins</groupId>
138+
<artifactId>maven-failsafe-plugin</artifactId>
139+
<version>3.1.2</version>
140+
<configuration>
141+
<redirectTestOutputToFile>true</redirectTestOutputToFile>
142+
<forkMode>once</forkMode>
143+
<forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
144+
<argLine>-enableassertions</argLine>
145+
<workingDirectory>${project.build.directory}</workingDirectory>
146+
<includes>
147+
<include>**/*Test.java</include>
148+
</includes>
149+
</configuration>
150+
<executions>
151+
<execution>
152+
<id>integration-test</id>
153+
<goals>
154+
<goal>integration-test</goal>
155+
</goals>
156+
</execution>
157+
<execution>
158+
<id>verify</id>
159+
<phase>verify</phase>
160+
<goals>
161+
<goal>verify</goal>
162+
</goals>
163+
</execution>
164+
</executions>
165+
</plugin>
166+
<plugin>
167+
<groupId>org.apache.maven.plugins</groupId>
168+
<artifactId>maven-surefire-plugin</artifactId>
169+
<version>3.1.2</version>
170+
<configuration>
171+
<skip>true</skip>
172+
</configuration>
173+
</plugin>
174+
</plugins>
175+
</build>
176+
<profiles>
177+
<profile>
178+
<id>deploy-loose-app</id>
179+
<build>
180+
<plugins>
181+
<plugin>
182+
<groupId>io.openliberty.tools</groupId>
183+
<artifactId>liberty-maven-plugin</artifactId>
184+
<version>@pom.version@</version>
185+
<executions>
186+
<execution>
187+
<id>install-artifact</id>
188+
<phase>integration-test</phase>
189+
<goals>
190+
<goal>deploy</goal>
191+
</goals>
192+
</execution>
193+
</executions>
194+
</plugin>
195+
<plugin>
196+
<groupId>org.apache.maven.plugins</groupId>
197+
<artifactId>maven-failsafe-plugin</artifactId>
198+
<version>3.1.2</version>
199+
<configuration>
200+
<excludes>
201+
<include>**/AppFileTest.java</include>
202+
<include>**/UndeployAppFileTest.java</include>
203+
</excludes>
204+
</configuration>
205+
</plugin>
206+
</plugins>
207+
</build>
208+
</profile>
209+
<!-->install-app case handled in install-apps-project-it<-->
210+
<profile>
211+
<id>deploy-app</id>
212+
<build>
213+
<plugins>
214+
<plugin>
215+
<groupId>io.openliberty.tools</groupId>
216+
<artifactId>liberty-maven-plugin</artifactId>
217+
<version>@pom.version@</version>
218+
<executions>
219+
<execution>
220+
<id>install-artifact</id>
221+
<phase>integration-test</phase>
222+
<goals>
223+
<goal>deploy</goal>
224+
</goals>
225+
<configuration>
226+
<looseApplication>false</looseApplication>
227+
</configuration>
228+
</execution>
229+
</executions>
230+
</plugin>
231+
<plugin>
232+
<groupId>org.apache.maven.plugins</groupId>
233+
<artifactId>maven-failsafe-plugin</artifactId>
234+
<version>3.1.2</version>
235+
<configuration>
236+
<excludes>
237+
<include>**/LooseConfigTest.java</include>
238+
<include>**/UndeployAppFileTest.java</include>
239+
</excludes>
240+
</configuration>
241+
</plugin>
242+
</plugins>
243+
</build>
244+
</profile>
245+
<profile>
246+
<id>undeploy-loose-app</id>
247+
<build>
248+
<plugins>
249+
<plugin>
250+
<groupId>io.openliberty.tools</groupId>
251+
<artifactId>liberty-maven-plugin</artifactId>
252+
<version>@pom.version@</version>
253+
<executions>
254+
<execution>
255+
<id>install-artifact</id>
256+
<phase>integration-test</phase>
257+
<goals>
258+
<goal>deploy</goal>
259+
<goal>undeploy</goal>
260+
</goals>
261+
</execution>
262+
</executions>
263+
</plugin>
264+
<plugin>
265+
<groupId>org.apache.maven.plugins</groupId>
266+
<artifactId>maven-failsafe-plugin</artifactId>
267+
<version>3.1.2</version>
268+
<configuration>
269+
<excludes>
270+
<include>**/AppFileTest.java</include>
271+
<include>**/EndpointTest.java</include>
272+
<include>**/LooseConfigTest.java</include>
273+
</excludes>
274+
</configuration>
275+
</plugin>
276+
</plugins>
277+
</build>
278+
</profile>
279+
</profiles>
280+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*******************************************************************************
2+
* (c) Copyright IBM Corporation 2019.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*******************************************************************************/
16+
package net.wasdev.wlp.test.servlet;
17+
18+
import java.io.IOException;
19+
20+
import javax.servlet.ServletException;
21+
import javax.servlet.annotation.WebServlet;
22+
import javax.servlet.http.HttpServlet;
23+
import javax.servlet.http.HttpServletRequest;
24+
import javax.servlet.http.HttpServletResponse;
25+
import net.wasdev.wlp.test.util.Welcome;
26+
27+
@WebServlet(urlPatterns="/servlet")
28+
public class HelloServlet extends HttpServlet {
29+
private static final long serialVersionUID = 1L;
30+
31+
/**
32+
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
33+
*/
34+
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
35+
String msg = Welcome.getMessage("greeting");
36+
response.getWriter().append(msg);
37+
}
38+
39+
/**
40+
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
41+
*/
42+
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
43+
doGet(request, response);
44+
}
45+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
(C) Copyright IBM Corporation 2019.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
<server description="Sample Servlet server">
17+
<featureManager>
18+
<feature>jsp-2.3</feature>
19+
</featureManager>
20+
21+
<httpEndpoint httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint" />
22+
23+
<application name="deploy-app" contextRoot="deploy-app" location="deploy-loose-config-apps-with-toolchain-it.war" type="war"/>
24+
</server>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
4+
version="3.1">
5+
<display-name>Hello Servlet</display-name>
6+
7+
<welcome-file-list>
8+
<welcome-file>index.html</welcome-file>
9+
</welcome-file-list>
10+
</web-app>

0 commit comments

Comments
 (0)