Skip to content

Commit

Permalink
Merge branch 'master' into iss552
Browse files Browse the repository at this point in the history
  • Loading branch information
starksm64 authored Jun 15, 2024
2 parents 4515be4 + 2bc6e1c commit 6529524
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 1 deletion.
93 changes: 93 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Java CI with Maven

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:

arquillian-build-jdk8:
name: Integration - JDK 8
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
SNAPSHOT_VERSION: ${{ steps.arq-version.outputs.SNAPSHOT_VERSION }}

steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
name: JDK 8 setup
with:
java-version: 8
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn clean -B install

- name: Version save
id: arq-version
run: |
VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
echo "SNAPSHOT_VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "Arquillian version: $VERSION"
- name: Artifact upload
uses: actions/upload-artifact@v4
with:
name: arquillian
path: ~/.m2/repository/org/jboss/

arquillian-build-jdk11:
name: Integration - JDK 11
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
name: JDK 11 setup
with:
java-version: 11
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn clean -B install

integration-wildfly-job:
runs-on: ubuntu-latest
name: Integration verification for WildFly
needs: arquillian-build-jdk8
timeout-minutes: 300

steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: arquillian
path: ~/.m2/repository/org/jboss

- uses: actions/setup-java@v4
name: JDK 17 setup
with:
java-version: 17
distribution: 'temurin'
cache: maven

- uses: actions/checkout@v4
name: Checkout WildFly
with:
repository: wildfly/wildfly

- name: WildFly integration
env:
SNAPSHOT_VERSION: ${{ needs.arquillian-build-jdk8.outputs.SNAPSHOT_VERSION }}
run: |
mvn clean install -Dquickly -Dversion.org.jboss.arquillian.core="$SNAPSHOT_VERSION"
mvn clean verify -f testsuite/integration -DallTests -Dversion.org.jboss.arquillian.core="$SNAPSHOT_VERSION"
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,16 @@ public String get() {
});
}

@Test(expected = IllegalArgumentException.class)
public void shouldThrowExceptionIfDescriptorIsNull() {
new PropertiesParser().addProperties(null, System.getProperties());
}

@Test(expected = IllegalArgumentException.class)
public void shouldThrowExceptionIfPropertiesIsNull() {
new PropertiesParser().addProperties(desc, null);
}

private void validate(String property, String value, ValueCallback callback) {
validate(property, value, value, callback);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ private void writeObject(Object object, HttpServletResponse response) {
try {
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
} catch (Exception e2) {
throw new RuntimeException("Could not write to output", e2);
RuntimeException runtimeException = new RuntimeException("Could not write to output", e2);
runtimeException.addSuppressed(e);
throw runtimeException;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ public void shouldThrowExceptionOnMissingNamedTargetedContext() throws Exception
handler.locateTestServlet(testMethod);
}

@Test(expected = IllegalArgumentException.class)
public void shouldThrowExceptionWhenNoConfig() throws Exception {
new ServletURIHandler(null, to(new HTTPContext("127.0.0.1", 8080).add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "test"))));
}

@Test(expected = IllegalArgumentException.class)
public void shouldThrowExceptionOnNoContexts() throws Exception {
new ServletURIHandler(new ServletProtocolConfiguration(), null);
}

private Collection<HTTPContext> to(HTTPContext... inputs) {
List<HTTPContext> contexts = new ArrayList<HTTPContext>();
Collections.addAll(contexts, inputs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,25 @@ public void shouldDisableCommandService() throws Exception {
"Timeout exception should have been thrown",
result.getThrowable().getMessage().contains("timeout"));
}

@Test(expected = IllegalArgumentException.class)
public void shouldThrowExceptionIfNoConfig() throws Exception {
new ServletMethodExecutor(null, createContexts(), new TestCommandCallback());
}

@Test(expected = IllegalArgumentException.class)
public void shouldThrowExceptionIfNoContexts() {
new ServletMethodExecutor(new ServletProtocolConfiguration(), null, new TestCommandCallback());
}

@Test(expected = IllegalArgumentException.class)
public void shouldThrowExceptionIfNoCallback() throws Exception {
new ServletMethodExecutor(new ServletProtocolConfiguration(), createContexts(), null);
}

@Test(expected = IllegalArgumentException.class)
public void shouldThrowExceptionIfNoExecutor() throws Exception {
ServletMethodExecutor executor = new ServletMethodExecutor(new ServletProtocolConfiguration(), createContexts(), new TestCommandCallback());
executor.invoke(null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,11 @@ public void shouldThrowExceptionOnEnterpriseArchiveWithMultipleMarkedWebArchives
processors());
}

@Test(expected = IllegalArgumentException.class)
public void shouldVerifyExceptionOnEmptyVersion() throws Exception {
Descriptors.create(WebAppDescriptor.class).version("");
}

private Collection<Archive<?>> createAuxiliaryArchives() {
List<Archive<?>> archives = new ArrayList<Archive<?>>();
archives.add(ShrinkWrap.create(JavaArchive.class, "auxiliaryArchive1.jar"));
Expand Down

0 comments on commit 6529524

Please sign in to comment.