-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[580] Create some integration tests. Create profiles for WildFly and …
…Payara for testing. Signed-off-by: James R. Perkins <[email protected]>
- Loading branch information
Showing
27 changed files
with
1,943 additions
and
0 deletions.
There are no files selected for viewing
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,84 @@ | ||
# This workflow will build a Java project with Maven | ||
# For more information see: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | ||
|
||
name: Arquillian Integration Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
schedule: | ||
- cron: '0 0 * * *' # Every day at 00:00 UTC | ||
|
||
# Only run the latest job | ||
concurrency: | ||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
wildfly-integration: | ||
name: 'WildFly Integration Tests' | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 90 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest ] | ||
java: ['11', '17', '21'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK ${{ matrix.java }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: Build with Maven Java ${{ matrix.java }} - ${{ matrix.os }} | ||
run: | | ||
mvn clean install -U -B -fae '-Pwildfly' '-T1' '-Pintegration-tests' | ||
- uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: surefire-reports-${{ matrix.os }}-${{ matrix.java }} | ||
path: '**/surefire-reports/*' | ||
- uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: server-logs-${{ matrix.os }}-${{ matrix.java }} | ||
path: '**/server.log' | ||
|
||
payara-integration: | ||
name: 'Payara Integration Tests' | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 90 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest ] | ||
java: ['11', '17', '21'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK ${{ matrix.java }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: Build with Maven Java ${{ matrix.java }} - ${{ matrix.os }} | ||
run: | | ||
mvn clean install -U -B -fae '-Ppayara' '-T1' '-Pintegration-tests' | ||
- uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: surefire-reports-${{ matrix.os }}-${{ matrix.java }} | ||
path: '**/surefire-reports/*' | ||
- uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: server-logs-${{ matrix.os }}-${{ matrix.java }} | ||
path: '**/server.log' |
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,88 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ JBoss, Home of Professional Open Source. | ||
~ | ||
~ Copyright 2024 Red Hat, Inc., and individual contributors | ||
~ as indicated by the @author tags. | ||
~ | ||
~ Licensed 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. | ||
--> | ||
|
||
<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.jboss.arquillian</groupId> | ||
<artifactId>integration-tests</artifactId> | ||
<version>1.9.0.Final-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>common-tests</artifactId> | ||
<name>Arquillian Core: Common integration tests</name> | ||
<description/> | ||
|
||
<properties> | ||
<version.org.junit>5.10.3</version.org.junit> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.junit</groupId> | ||
<artifactId>junit-bom</artifactId> | ||
<version>${version.org.junit}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>jakarta.annotation</groupId> | ||
<artifactId>jakarta.annotation-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>jakarta.enterprise</groupId> | ||
<artifactId>jakarta.enterprise.cdi-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>jakarta.inject</groupId> | ||
<artifactId>jakarta.inject-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>jakarta.ws.rs</groupId> | ||
<artifactId>jakarta.ws.rs-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.arquillian.container</groupId> | ||
<artifactId>arquillian-container-test-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.arquillian.test</groupId> | ||
<artifactId>arquillian-test-api</artifactId> | ||
</dependency> | ||
|
||
<!-- Test Dependencies --> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build/> | ||
|
||
</project> |
96 changes: 96 additions & 0 deletions
96
...ts/common/src/main/java/org/jboss/arquillian/integration/test/common/TestEnvironment.java
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,96 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* | ||
* Copyright 2024 Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. | ||
* | ||
* Licensed 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. | ||
*/ | ||
|
||
package org.jboss.arquillian.integration.test.common; | ||
|
||
import java.net.URI; | ||
|
||
/** | ||
* The test environment setup. | ||
* | ||
* @author <a href="mailto:[email protected]">James R. Perkins</a> | ||
*/ | ||
public class TestEnvironment { | ||
|
||
private static final String PROTOCOL = System.getProperty("arq.protocol", "http"); | ||
private static final String HOST = System.getProperty("arq.host", "127.0.0.1"); | ||
private static final int PORT = Integer.parseInt(System.getProperty("arq.port", "8080")); | ||
public static final String REST_PATH = "/rest"; | ||
|
||
private TestEnvironment() { | ||
} | ||
|
||
/** | ||
* Returns the defined protocol to use for HTTP connections. The default is {@code http} and can be overridden | ||
* with the {@code arq.protocol} system property. | ||
* | ||
* @return the HTTP protocol | ||
*/ | ||
public static String protocol() { | ||
return PROTOCOL; | ||
} | ||
|
||
/** | ||
* Returns the defined host to use for HTTP connections. The default is {@code 127.0.0.1} and can be overridden | ||
* with the {@code arq.host} system property. | ||
* | ||
* @return the HTTP host | ||
*/ | ||
public static String host() { | ||
return HOST; | ||
} | ||
|
||
/** | ||
* Returns the defined port to use for HTTP connections. The default is {@code 8080} and can be overridden | ||
* with the {@code arq.port} system property. | ||
* | ||
* @return the HTTP port | ||
*/ | ||
public static int port() { | ||
return PORT; | ||
} | ||
|
||
/** | ||
* Creates a URI with the given paths appended to the {@linkplain #protocol() protocol}, {@linkplain #host() host} | ||
* and {@linkplain #port() port}. | ||
* | ||
* @param paths the paths to append | ||
* | ||
* @return a new URI for an HTTP connection | ||
*/ | ||
public static URI uri(final String... paths) { | ||
final StringBuilder uri = new StringBuilder() | ||
.append(protocol()) | ||
.append("://") | ||
.append(host()) | ||
.append(':') | ||
.append(port()); | ||
for (String path : paths) { | ||
if (!path.isEmpty()) { | ||
if (path.charAt(0) == '/') { | ||
uri.append(path); | ||
} else { | ||
uri.append('/').append(path); | ||
} | ||
} | ||
} | ||
return URI.create(uri.toString()); | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
...s/common/src/main/java/org/jboss/arquillian/integration/test/common/app/EchoResource.java
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,37 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* | ||
* Copyright 2024 Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. | ||
* | ||
* Licensed 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. | ||
*/ | ||
|
||
package org.jboss.arquillian.integration.test.common.app; | ||
|
||
import jakarta.enterprise.context.RequestScoped; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">James R. Perkins</a> | ||
*/ | ||
@Path("echo") | ||
@RequestScoped | ||
public class EchoResource { | ||
|
||
@POST | ||
public String echo(final String msg) { | ||
return msg; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/app/Greeter.java
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,33 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* | ||
* Copyright 2024 Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. | ||
* | ||
* Licensed 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. | ||
*/ | ||
|
||
package org.jboss.arquillian.integration.test.common.app; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">James R. Perkins</a> | ||
*/ | ||
@ApplicationScoped | ||
public class Greeter { | ||
|
||
public String greet(String name) { | ||
return "Hello " + name + "!"; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
.../common/src/main/java/org/jboss/arquillian/integration/test/common/app/RestActivator.java
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,31 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* | ||
* Copyright 2024 Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. | ||
* | ||
* Licensed 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. | ||
*/ | ||
|
||
package org.jboss.arquillian.integration.test.common.app; | ||
|
||
import jakarta.ws.rs.ApplicationPath; | ||
import jakarta.ws.rs.core.Application; | ||
import org.jboss.arquillian.integration.test.common.TestEnvironment; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">James R. Perkins</a> | ||
*/ | ||
@ApplicationPath(TestEnvironment.REST_PATH) | ||
public class RestActivator extends Application { | ||
} |
24 changes: 24 additions & 0 deletions
24
integration-tests/common/src/main/resources/manual-mode-arquillian.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,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ JBoss, Home of Professional Open Source. | ||
~ | ||
~ Copyright 2024 Red Hat, Inc., and individual contributors | ||
~ as indicated by the @author tags. | ||
~ | ||
~ Licensed 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. | ||
--> | ||
|
||
<arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> | ||
<container qualifier="default" default="true" mode="manual"/> | ||
</arquillian> |
Oops, something went wrong.