Skip to content

Commit

Permalink
OWB-1446 start tomcat via cargo
Browse files Browse the repository at this point in the history
  • Loading branch information
struberg committed Oct 13, 2024
1 parent 889bca6 commit 7cb8274
Show file tree
Hide file tree
Showing 8 changed files with 246 additions and 374 deletions.
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -762,12 +762,6 @@
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>${jakarta.cdi-api.version}</version>
<exclusions>
<exclusion>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
5 changes: 5 additions & 0 deletions samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ under the License.
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven3-plugin</artifactId>
<configuration>
<configuration>

</configuration>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Expand Down
2 changes: 1 addition & 1 deletion webbeans-tomcat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-el22</artifactId>
<optional> true</optional>
<optional>true</optional>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
243 changes: 82 additions & 161 deletions webbeans-tomcat/src/it/fatwar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@
</parent>

<groupId>org.apache.openwebbeans.it</groupId>
<artifactId>openwebbeans-tomcat7-it-fatwar</artifactId>
<artifactId>openwebbeans-tomcat-it-fatwar</artifactId>
<version>@project.version@</version>
<packaging>war</packaging>
<name>Tomcat 7 plugin IT</name>
<name>Tomcat plugin IT</name>

<properties>
<tomcat.port.it>9082</tomcat.port.it>
<jstl.version>1.2</jstl.version>
<projectStage>Development</projectStage>
</properties>

Expand All @@ -45,29 +44,23 @@
</dependency>

<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_3.0_spec</artifactId>
<version>1.0</version>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jcdi_2.0_spec</artifactId>
<scope>compile</scope>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
</dependency>

<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-atinject_1.0_spec</artifactId>
<scope>compile</scope>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
</dependency>

<dependency>
<groupId>jakarta.interceptor</groupId>
<artifactId>jakarta.interceptor-api</artifactId>
<version>${geronimo_interceptor.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
Expand All @@ -85,157 +78,38 @@

<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-tomcat7</artifactId>
<artifactId>openwebbeans-tomcat</artifactId>
<version>@project.version@</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>jakarta.servlet.jsp.jstl</groupId>
<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jakarta.servlet.jsp.jstl</artifactId>
<version>2.0.0</version>
</dependency>

</dependencies>

<build>
<finalName>owbtomcat7it</finalName>
<finalName>owbTomcatIt</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<!-- needed for the tomcat7 integration tests -->
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<dependencies>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
</dependency>

<!--
tomcat7-maven-plugin dependencies
We need to add those for specifying the version
-->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>${tomcat7.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util</artifactId>
<version>${tomcat7.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-coyote</artifactId>
<version>${tomcat7.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-api</artifactId>
<version>${tomcat7.version}</version>
</dependency>

<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>${tomcat7.version}</version>
</dependency>

<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-dbcp</artifactId>
<version>${tomcat7.version}</version>
</dependency>

<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId>
<version>${tomcat7.version}</version>
</dependency>

<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jsp-api</artifactId>
<version>${tomcat7.version}</version>
</dependency>

<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<version>${tomcat7.version}</version>
</dependency>

<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper-el</artifactId>
<version>${tomcat7.version}</version>
</dependency>

<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-el-api</artifactId>
<version>${tomcat7.version}</version>
</dependency>

<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>${tomcat7.version}</version>
</dependency>

<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-tribes</artifactId>
<version>${tomcat7.version}</version>
</dependency>

<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina-ha</artifactId>
<version>${tomcat7.version}</version>
</dependency>

<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-annotations-api</artifactId>
<version>${tomcat7.version}</version>
</dependency>

<!-- tomcat i18n too ?? -->

<!-- not sure we need that -->
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-juli</artifactId>
<version>${tomcat7.version}</version>
</dependency>

<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-logging-juli</artifactId>
<version>${tomcat7.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-logging-log4j</artifactId>
<version>${tomcat7.version}</version>
</dependency>

</dependencies>
</plugin>

</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.11</version>
<version>3.2.5</version>
<executions>
<execution>
<id>integration-test</id>
Expand All @@ -253,36 +127,83 @@
</plugin>

<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven3-plugin</artifactId>
<configuration>
<path>/${project.build.finalName}</path>
<addContextWarDependencies>true</addContextWarDependencies>
<port>${tomcat.port.it}</port>
<fork>true</fork> <!-- needed for testing ITs -->
<systemProperties>
<org.apache.myfaces.PROJECT_STAGE>${projectStage}</org.apache.myfaces.PROJECT_STAGE>
<faces.PROJECT_STAGE>${projectStage}</faces.PROJECT_STAGE>
</systemProperties>
<container>
<containerId>tomcat10x</containerId>
<artifactInstaller>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<version>${tomcat.version}</version>
</artifactInstaller>
</container>
<deployables>
<deployable>
<type>war</type>
<location>${project.build.directory}/${project.build.finalName}.war</location>
<properties>
<context>/${project.build.finalName}</context>
</properties>
</deployable>
</deployables>
<configuration>
<properties>
<cargo.servlet.port>${tomcat.port.it}</cargo.servlet.port>
</properties>
</configuration>
</configuration>
<executions>
<execution>
<id>start-tomcat</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run-war</goal>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-tomcat</id>
<phase>post-integration-test</phase>
<goals>
<goal>shutdown</goal>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>

<!--
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>/${project.build.finalName}</path>
<addContextWarDependencies>true</addContextWarDependencies>
<port>${tomcat.port.it}</port>
<fork>true</fork> &lt;!&ndash; needed for testing ITs &ndash;&gt;
<systemProperties>
<org.apache.myfaces.PROJECT_STAGE>${projectStage}</org.apache.myfaces.PROJECT_STAGE>
<faces.PROJECT_STAGE>${projectStage}</faces.PROJECT_STAGE>
</systemProperties>
</configuration>
<executions>
<execution>
<id>start-tomcat</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run-war</goal>
</goals>
</execution>
<execution>
<id>stop-tomcat</id>
<phase>post-integration-test</phase>
<goals>
<goal>shutdown</goal>
</goals>
</execution>
</executions>
</plugin>
-->
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ public void testTomcatRequest() throws Exception

{
// Get the response
String response = getResponse("http://localhost:9082/owbtomcat7it/test.test");
String response = getResponse("http://localhost:9082/owbTomcatIt/test.test");
Assert.assertEquals(":thumb_up:", response);
}
{
String response = getResponse("http://localhost:9082/owbtomcat7it/test.test?action=setRequest&val=3500");
String response = getResponse("http://localhost:9082/owbTomcatIt/test.test?action=setRequest&val=3500");
Assert.assertEquals("3600", response);
}

{
String response = getResponse("http://localhost:9082/owbtomcat7it/test.test?action=setSession&val=500");
String response = getResponse("http://localhost:9082/owbTomcatIt/test.test?action=setSession&val=500");
Assert.assertEquals("500", response);
}
}
Expand Down
Loading

0 comments on commit 7cb8274

Please sign in to comment.