-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jetty 10.0.x add plugin overlay test (#9045)
* Add overlay test for jetty-maven-plugin Signed-off-by: Jan Bartel <janb@webtide.com>
- Loading branch information
Showing
12 changed files
with
283 additions
and
4 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
jetty-maven-plugin/src/it/jetty-start-overlay-it/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoker.goals = verify |
28 changes: 28 additions & 0 deletions
28
jetty-maven-plugin/src/it/jetty-start-overlay-it/jetty-simple-base-webapp/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.eclipse.jetty.its.jetty-start-overlay-it</groupId> | ||
<artifactId>jetty-simple-project</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>jetty-simple-base-webapp</artifactId> | ||
<packaging>war</packaging> | ||
|
||
<name>Jetty :: Simple :: Base Webapp</name> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<configuration> | ||
<failOnMissingWebXml>false</failOnMissingWebXml> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
5 changes: 5 additions & 0 deletions
5
...-plugin/src/it/jetty-start-overlay-it/jetty-simple-base-webapp/src/main/webapp/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<html> | ||
<body> | ||
<h1>Simple Base Webapp Index</h1> | ||
</body> | ||
</html> |
128 changes: 128 additions & 0 deletions
128
jetty-maven-plugin/src/it/jetty-start-overlay-it/jetty-simple-webapp/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.eclipse.jetty.its.jetty-start-overlay-it</groupId> | ||
<artifactId>jetty-simple-project</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>jetty-simple-webapp</artifactId> | ||
<packaging>war</packaging> | ||
|
||
<name>Jetty :: Simple :: Webapp</name> | ||
|
||
<properties> | ||
<jetty.port.file>${project.build.directory}/jetty-start-port.txt</jetty.port.file> | ||
</properties> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.eclipse.jetty.its.jetty-start-overlay-it</groupId> | ||
<artifactId>jetty-simple-base-webapp</artifactId> | ||
<type>war</type> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-servlet</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-maven-plugin</artifactId> | ||
<classifier>tests</classifier> | ||
<type>test-jar</type> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
|
||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<configuration> | ||
<failOnMissingWebXml>false</failOnMissingWebXml> | ||
<overlays> | ||
<overlay> | ||
<groupId>org.eclipse.jetty.its.jetty-start-overlay-it</groupId> | ||
<artifactId>jetty-simple-base-webapp</artifactId> | ||
<includes> | ||
<include>index.html</include> | ||
</includes> | ||
</overlay> | ||
<overlay/> | ||
</overlays> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>run-tests</id> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>test</goal> | ||
</goals> | ||
<configuration> | ||
<includes> | ||
<include>IntegrationTest*.java</include> | ||
</includes> | ||
<systemPropertyVariables> | ||
<jetty.port.file>${jetty.port.file}</jetty.port.file> | ||
<context.path>/setbycontextxml</context.path> | ||
<contentCheck>Simple Base Webapp Index</contentCheck> | ||
<pathToCheck>/index.html</pathToCheck> | ||
<maven.it.name>${project.groupId}:${project.artifactId}</maven.it.name> | ||
</systemPropertyVariables> | ||
<dependenciesToScan> | ||
<dependency>org.eclipse.jetty:jetty-maven-plugin</dependency> | ||
</dependenciesToScan> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>start-jetty</id> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>start</goal> | ||
</goals> | ||
<configuration> | ||
<contextXml>${basedir}/src/config/context.xml</contextXml> | ||
<systemProperties> | ||
<jetty.port.file>${jetty.port.file}</jetty.port.file> | ||
<jetty.deployMode>EMBED</jetty.deployMode> | ||
</systemProperties> | ||
<jettyXmls> | ||
<jettyXml>${basedir}/src/config/jetty.xml</jettyXml> | ||
</jettyXmls> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
7 changes: 7 additions & 0 deletions
7
jetty-maven-plugin/src/it/jetty-start-overlay-it/jetty-simple-webapp/src/config/context.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd"> | ||
|
||
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> | ||
|
||
<Set name="contextPath">/setbycontextxml</Set> | ||
|
||
</Configure> |
40 changes: 40 additions & 0 deletions
40
jetty-maven-plugin/src/it/jetty-start-overlay-it/jetty-simple-webapp/src/config/jetty.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd"> | ||
|
||
<Configure id="Server" class="org.eclipse.jetty.server.Server"> | ||
<New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration"> | ||
<Set name="secureScheme">https</Set> | ||
<Set name="securePort"><Property name="jetty.secure.port" default="8443" /></Set> | ||
<Set name="outputBufferSize">32768</Set> | ||
<Set name="requestHeaderSize">8192</Set> | ||
<Set name="responseHeaderSize">8192</Set> | ||
<Set name="headerCacheSize">1024</Set> | ||
</New> | ||
|
||
<Call name="addConnector"> | ||
<Arg> | ||
<New class="org.eclipse.jetty.server.ServerConnector"> | ||
<Arg name="server"><Ref refid="Server" /></Arg> | ||
<Arg name="factories"> | ||
<Array type="org.eclipse.jetty.server.ConnectionFactory"> | ||
<Item> | ||
<New class="org.eclipse.jetty.server.HttpConnectionFactory"> | ||
<Arg name="config"><Ref refid="httpConfig" /></Arg> | ||
</New> | ||
</Item> | ||
</Array> | ||
</Arg> | ||
<Call name="addEventListener"> | ||
<Arg> | ||
<New class="org.eclipse.jetty.maven.plugin.ServerConnectorListener"> | ||
<Set name="fileName"><Property name="jetty.port.file" default="port.txt"/></Set> | ||
</New> | ||
</Arg> | ||
</Call> | ||
<Set name="host" property="jetty.host"/> | ||
<Set name="port" property="jetty.port"/> | ||
<Set name="idleTimeout">30000</Set> | ||
</New> | ||
</Arg> | ||
</Call> | ||
</Configure> |
5 changes: 5 additions & 0 deletions
5
...maven-plugin/src/it/jetty-start-overlay-it/jetty-simple-webapp/src/main/webapp/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<html> | ||
<body> | ||
<h1>Simple WebApp Index</h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.eclipse.jetty.its</groupId> | ||
<artifactId>it-parent-pom</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<groupId>org.eclipse.jetty.its.jetty-start-overlay-it</groupId> | ||
<artifactId>jetty-simple-project</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<name>Jetty :: Simple Overlay</name> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<java.version>1.8</java.version> | ||
<jetty.version>@project.version@</jetty.version> | ||
</properties> | ||
|
||
<modules> | ||
<module>jetty-simple-base-webapp</module> | ||
<module>jetty-simple-webapp</module> | ||
</modules> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.eclipse.jetty.its.jetty-start-overlay-it</groupId> | ||
<artifactId>jetty-simple-base-webapp</artifactId> | ||
<version>${project.version}</version> | ||
<type>war</type> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
</project> |
21 changes: 21 additions & 0 deletions
21
jetty-maven-plugin/src/it/jetty-start-overlay-it/postbuild.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
File buildLog = new File( basedir, 'build.log' ) | ||
assert buildLog.text.contains( 'Started Server' ) | ||
assert buildLog.text.contains( 'Running org.eclipse.jetty.maven.plugin.it.IntegrationTestGetContent') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters