Skip to content

Commit

Permalink
Merge pull request #132 from jhanders34/jhanders34-branch
Browse files Browse the repository at this point in the history
Fix REST protocol when no servlets are defined and switch to newer Arquillian and liberty levels
  • Loading branch information
cherylking committed Jun 9, 2023
2 parents 7f57fa0 + 725676d commit 9649faf
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 40 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,11 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]
java: [8, 11, 17]
runtime: [ol, olbeta, wlp]
runtime_version: [22.0.0.10, 22.0.0.11-beta]
runtime: [ol, wlp-ee9, wlp-ee10]
runtime_version: [23.0.0.3]
exclude:
- runtime: olbeta
runtime_version: 22.0.0.10
- runtime: ol
runtime_version: 22.0.0.11-beta
- runtime: wlp
runtime_version: 22.0.0.11-beta
- java: 8
runtime_version: 22.0.0.11-beta
runtime: wlp-ee10

steps:
- uses: actions/checkout@v3
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

An Arquillian container adapter (`DeployableContainer` implementation) that can start and stop a local Liberty process and run tests on it over a remote protocol (effectively in a different JVM). For an introduction to testing microservices with the Arquillian Liberty Managed container and [Open Liberty](https://openliberty.io/), check out the [this guide](https://openliberty.io/guides/arquillian-managed.html).

**Jakarta EE 9:** for Arquillian Liberty Managed container documentation with Jakarta EE 9, click [here](liberty-managed/JakartaEE9_README.md).
**Jakarta EE 9 and 10:** for Arquillian Liberty Managed container documentation with Jakarta EE 9 and EE 10, click [here](liberty-managed/JakartaEE9_README.md).

**Java EE 8 or below:** for Arquillian Liberty Managed container documentation with Java EE 8 or below, click [here](liberty-managed/README.md).

### Arquillian Liberty Remote Container

An Arquillian container adapter (`DeployableContainer` implementation) that can connect and run against a remote (different JVM, different machine) Liberty server and run tests on it over a remote protocol (effectively in a different JVM).

**Jakarta EE 9:** for Arquillian Liberty Remote container documentation with Jakarta EE 9, click [here](liberty-remote/JakartaEE9_README.md).
**Jakarta EE 9 and 10:** for Arquillian Liberty Remote container documentation with Jakarta EE 9 and EE 10, click [here](liberty-remote/JakartaEE9_README.md).

**Java EE 8 or below:** for Arquillian Liberty Remote container documentation with Java EE 8 or below, click [here](liberty-remote/README.md).

Expand All @@ -24,11 +24,13 @@ To run tests, you will need to specify the following parameters:

| Parameter | Description |
| ---------------- | ----------- |
| runtime | The runtime to use. Specify `ol` for Open Liberty, `olbeta` for Open Liberty beta, and `wlp` for WebSphere Liberty. |
| runtime | The runtime to use. Specify `ol` for Open Liberty, `olbeta` for Open Liberty beta, and `wlp-ee9` or `wlp-ee10` for WebSphere Liberty. |
| runtimeVersion | Version of the specified runtime to use. |

For example, to run tests on version 22.0.0.6 of the Open Liberty runtime, use the following command:

```
mvn verify -Druntime=ol -DruntimeVersion=22.0.0.6
```

EE 9 archive images are no longer published for WebSphere Liberty so runtimeVersion is ignored for `wlp-ee9` and 23.0.0.2 is used which is the last version of the wlp-jakartaee9 archive that was published.
6 changes: 3 additions & 3 deletions liberty-managed/JakartaEE9_README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Arquillian Liberty Managed with Jakarta EE 9
# Arquillian Liberty Managed with Jakarta EE 9 and 10

An Arquillian container adapter (`DeployableContainer` implementation) that can start and stop a local Liberty process and run tests on it over a remote protocol (effectively in a different JVM).

## Prerequisites

**Prerequisite Version**

This `DeployableContainer` has been tested with the latest beta release of Open Liberty. Requires Jakarta EE 9.
This `DeployableContainer` has been tested with the latest release of Open Liberty. Requires Jakarta EE 9 or 10.

For Java EE 8 projects and below, check out the documentation [here](README.md).

Expand Down Expand Up @@ -56,7 +56,7 @@ To enable Arquillian Liberty Managed in your project, add the following to your
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.7.0.Alpha14</version>
<version>1.7.0.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion liberty-managed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ An Arquillian container adapter (`DeployableContainer` implementation) that can

This `DeployableContainer` has been tested with the latest two releases of Open Liberty and WebSphere Liberty. Requires Java EE 8 or below.

For Jakarta EE 9 projects, check out the documentation [here](JakartaEE9_README.md).
For Jakarta EE 9 and EE 10 projects, check out the documentation [here](JakartaEE9_README.md).

**Prerequisite Configuration**

Expand Down
8 changes: 7 additions & 1 deletion liberty-managed/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<assemblyArtifact>
<groupId>${runtimeGroupId}</groupId>
<artifactId>${runtimeArtifactId}</artifactId>
<version>${runtimeVersion}</version>
<version>${libertyVersion}</version>
<type>zip</type>
</assemblyArtifact>
<serverEnv>src/test/resources/server.env</serverEnv>
Expand Down Expand Up @@ -211,6 +211,7 @@
</goals>
<configuration>
<skip>${skipTests}</skip>
<skip>${skipEE9Tests}</skip>
<reportsDirectory>${project.build.directory}/surefire-reports/wlp-dropins-deployment-servlet-test
</reportsDirectory>
<systemPropertyVariables>
Expand All @@ -230,6 +231,7 @@
</goals>
<configuration>
<skip>${skipTests}</skip>
<skip>${skipEE9Tests}</skip>
<reportsDirectory>${project.build.directory}/surefire-reports/wlp-xml-deployment-servlet-test</reportsDirectory>
<systemPropertyVariables>
<arquillian.launch>wlp-xml-deployment-servlet</arquillian.launch>
Expand All @@ -248,6 +250,7 @@
</goals>
<configuration>
<skip>${skipTests}</skip>
<skip>${skipEE9Tests}</skip>
<reportsDirectory>${project.build.directory}/surefire-reports/wlp-xml-management-deployment-servlet-test</reportsDirectory>
<systemPropertyVariables>
<arquillian.launch>wlp-xml-management-deployment-servlet</arquillian.launch>
Expand All @@ -263,6 +266,7 @@
</goals>
<configuration>
<skip>${skipTests}</skip>
<skip>${skipEE9Tests}</skip>
<reportsDirectory>${project.build.directory}/surefire-reports/wlp-dropins-deployment-rest-test
</reportsDirectory>
<systemPropertyVariables>
Expand All @@ -282,6 +286,7 @@
</goals>
<configuration>
<skip>${skipTests}</skip>
<skip>${skipEE9Tests}</skip>
<reportsDirectory>${project.build.directory}/surefire-reports/wlp-xml-deployment-rest-test</reportsDirectory>
<systemPropertyVariables>
<arquillian.launch>wlp-xml-deployment-rest</arquillian.launch>
Expand All @@ -300,6 +305,7 @@
</goals>
<configuration>
<skip>${skipTests}</skip>
<skip>${skipEE9Tests}</skip>
<reportsDirectory>${project.build.directory}/surefire-reports/wlp-xml-management-deployment-rest-test</reportsDirectory>
<systemPropertyVariables>
<arquillian.launch>wlp-xml-management-deployment-rest</arquillian.launch>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012, 2022 IBM Corporation, Red Hat Middleware LLC, and individual contributors
* Copyright 2012, 2023 IBM Corporation, Red Hat Middleware LLC, and individual contributors
* identified by the Git commit log.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -653,8 +653,8 @@ private List<String> getServletNames(WebModule webModule) throws DeploymentExcep
// If we didn't find any servlets and this is a testable archive it ought to
// contain the arquillian test servlet, which is all that most tests need to
// work
if (containerConfiguration.isServletTestProtocol() && servletNames.isEmpty() && Testable.isArchiveToTest(webModule.archive)) {
servletNames.add(ARQUILLIAN_SERVLET_NAME);
if (servletNames.isEmpty() && Testable.isArchiveToTest(webModule.archive)) {
servletNames.add(containerConfiguration.isServletTestProtocol() ? ARQUILLIAN_SERVLET_NAME : ARQUILLIAN_REST_NAME);
}
return servletNames;
} catch (Exception e) {
Expand Down
6 changes: 3 additions & 3 deletions liberty-remote/JakartaEE9_README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Arquillian Liberty Remote with Jakarta EE 9
# Arquillian Liberty Remote with Jakarta EE 9 and 10

An Arquillian container adapter (`DeployableContainer` implementation) that can connect and run against a remote (different JVM, different machine) Liberty server andrun tests on it over a remote protocol (effectively in a different JVM).

## Prerequisites

**Prerequisite Version**

This `DeployableContainer` has been tested with the latest beta release of Open Liberty. Requires Jakarta EE 9.
This `DeployableContainer` has been tested with the latest release of Open Liberty. Requires Jakarta EE 9 or EE 10.

For Java EE 8 projects and below, check out the documentation [here](README.md).

Expand Down Expand Up @@ -64,7 +64,7 @@ To enable Arquillian Liberty Remote in your project, add the following to your `
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.7.0.Alpha13</version>
<version>1.7.0.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion liberty-remote/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ An Arquillian container adapter (`DeployableContainer` implementation) that can

This `DeployableContainer` has been tested with the latest two releases of Open Liberty and WebSphere Liberty. Requires Java EE 8 or below.

For Jakarta EE 9 projects, check out the documentation [here](JakartaEE9_README.md).
For Jakarta EE 9 and 10 projects, check out the documentation [here](JakartaEE9_README.md).

**Prerequisite Configuration**

Expand Down
4 changes: 3 additions & 1 deletion liberty-remote/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
</goals>
<configuration>
<skip>${skipTests}</skip>
<skip>${skipEE9Tests}</skip>
<reportsDirectory>${project.build.directory}/surefire-reports/wlp-remote-deployment-servlet-test
</reportsDirectory>
<systemPropertyVariables>
Expand All @@ -87,6 +88,7 @@
</goals>
<configuration>
<skip>${skipTests}</skip>
<skip>${skipEE9Tests}</skip>
<reportsDirectory>${project.build.directory}/surefire-reports/wlp-remote-deployment-rest-test
</reportsDirectory>
<systemPropertyVariables>
Expand Down Expand Up @@ -152,7 +154,7 @@
<assemblyArtifact>
<groupId>${runtimeGroupId}</groupId>
<artifactId>${runtimeArtifactId}</artifactId>
<version>${runtimeVersion}</version>
<version>${libertyVersion}</version>
<type>zip</type>
</assemblyArtifact>
</configuration>
Expand Down
4 changes: 2 additions & 2 deletions liberty-support-feature/JakartaEE9_README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Arquillian support Liberty user feature with Jakarta EE 9
# Arquillian support Liberty user feature with Jakarta EE 9 and 10

A Liberty user feature which allows deployment exceptions to be reported more reliably when using the Liberty Managed Jakarta container.

The Arquillian support feature adds an additional http endpoint which the Arquillian container can query to determine the cause when an application fails to start.

It is only for supporting the running of Arquillian tests and must not be installed on a production system.

Requires Jakarta EE 9. For Java EE 8 projects and below, check out the documentation [here](README.md).
Requires Jakarta EE 9 or 10. For Java EE 8 projects and below, check out the documentation [here](README.md).

## Configuring with a Maven project

Expand Down
2 changes: 1 addition & 1 deletion liberty-support-feature/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Arquillian support feature adds an additional http endpoint which the Arquil

It is only for supporting the running of Arquillian tests and must not be installed on a production system.

Requires Java EE 8 or below. For Jakarta EE 9 projects, check out the documentation [here](JakartaEE9_README.md).
Requires Java EE 8 or below. For Jakarta EE 9 and 10 projects, check out the documentation [here](JakartaEE9_README.md).

## Configuring with a Maven project

Expand Down
39 changes: 27 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<!-- Properties -->
<properties>
<!-- Versioning -->
<version.arquillian_core>1.7.0.Alpha14</version.arquillian_core>
<version.arquillian_core>1.7.0.Final</version.arquillian_core>
<version.surefire.plugin>3.0.0-M7</version.surefire.plugin>

<!-- override from parent -->
Expand Down Expand Up @@ -77,21 +77,37 @@
<!-- Profiles for WLP vs OL -->
<profiles>
<profile>
<id>wlp-its</id>
<id>wlp-ee9-its</id>
<activation>
<property>
<name>runtime</name>
<value>wlp</value>
<value>wlp-ee9</value>
</property>
</activation>
<properties>
<runtime>wlp</runtime>
<runtime>wlp-ee9</runtime>
<runtimeGroupId>com.ibm.websphere.appserver.runtime</runtimeGroupId>
<runtimeArtifactId>wlp-jakartaee9</runtimeArtifactId>
<runtimeVersion>${runtimeVersion}</runtimeVersion>
<libertyVersion>23.0.0.2</libertyVersion>
<skipEE10Tests>true</skipEE10Tests>
</properties>
</profile>
<profile>
<id>wlp-ee10-its</id>
<activation>
<property>
<name>runtime</name>
<value>wlp-ee10</value>
</property>
</activation>
<properties>
<runtime>wlp-ee10</runtime>
<runtimeGroupId>com.ibm.websphere.appserver.runtime</runtimeGroupId>
<runtimeArtifactId>wlp-jakartaee10</runtimeArtifactId>
<libertyVersion>${runtimeVersion}</libertyVersion>
<skipEE9Tests>true</skipEE9Tests>
</properties>
</profile>
<profile>
<id>ol-its</id>
<activation>
Expand All @@ -104,8 +120,7 @@
<runtime>ol</runtime>
<runtimeGroupId>io.openliberty</runtimeGroupId>
<runtimeArtifactId>openliberty-runtime</runtimeArtifactId>
<runtimeVersion>${runtimeVersion}</runtimeVersion>
<skipEE10Tests>true</skipEE10Tests>
<libertyVersion>${runtimeVersion}</libertyVersion>
</properties>
</profile>
<profile>
Expand All @@ -120,23 +135,23 @@
<runtime>olbeta</runtime>
<runtimeGroupId>io.openliberty.beta</runtimeGroupId>
<runtimeArtifactId>openliberty-runtime</runtimeArtifactId>
<runtimeVersion>${runtimeVersion}</runtimeVersion>
<libertyVersion>${runtimeVersion}</libertyVersion>
</properties>
</profile>
<profile>
<id>default-its</id>
<activation>
<property>
<name>runtime</name>
<value>olbeta</value>
<value>ol</value>
</property>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<runtime>olbeta</runtime>
<runtimeGroupId>io.openliberty.beta</runtimeGroupId>
<runtime>ol</runtime>
<runtimeGroupId>io.openliberty</runtimeGroupId>
<runtimeArtifactId>openliberty-runtime</runtimeArtifactId>
<runtimeVersion>22.0.0.11-beta</runtimeVersion>
<libertyVersion>23.0.0.3</libertyVersion>
</properties>
</profile>
</profiles>
Expand Down

0 comments on commit 9649faf

Please sign in to comment.