From fc4561770c55ff17e08f66c9450406a6b6337dd3 Mon Sep 17 00:00:00 2001 From: Radoslav Husar Date: Wed, 3 Jul 2024 19:14:34 +0200 Subject: [PATCH 01/12] ARQ-2231 The JUnit 5 container does not work with manual mode tests (#583) --- .../junit5/ArquillianExtension.java | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/junit5/core/src/main/java/org/jboss/arquillian/junit5/ArquillianExtension.java b/junit5/core/src/main/java/org/jboss/arquillian/junit5/ArquillianExtension.java index 21887f009..6165e4e09 100644 --- a/junit5/core/src/main/java/org/jboss/arquillian/junit5/ArquillianExtension.java +++ b/junit5/core/src/main/java/org/jboss/arquillian/junit5/ArquillianExtension.java @@ -93,23 +93,28 @@ public void interceptTestMethod(Invocation invocation, ReflectiveInvocatio } @Override - public void interceptBeforeEachMethod(Invocation invocation, - ReflectiveInvocationContext invocationContext, ExtensionContext extensionContext) throws Throwable { - if (IS_INSIDE_ARQUILLIAN.test(extensionContext) || isRunAsClient(extensionContext)) { - invocation.proceed(); - } else { - invocation.skip(); - } + public void interceptBeforeEachMethod(Invocation invocation, ReflectiveInvocationContext invocationContext, ExtensionContext extensionContext) throws Throwable { + if (IS_INSIDE_ARQUILLIAN.test(extensionContext) || isRunAsClient(extensionContext)) { + // Since the invocation is going to proceed, the invocation must happen within the context of SPI before() + getManager(extensionContext).getAdaptor().before( + extensionContext.getRequiredTestInstance(), + extensionContext.getRequiredTestMethod(), + invocation::proceed); + } else { + invocation.skip(); + } } @Override - public void interceptAfterEachMethod(Invocation invocation, - ReflectiveInvocationContext invocationContext, ExtensionContext extensionContext) throws Throwable { - if (IS_INSIDE_ARQUILLIAN.test(extensionContext) || isRunAsClient(extensionContext)) { - invocation.proceed(); - } else { - invocation.skip(); - } + public void interceptAfterEachMethod(Invocation invocation, ReflectiveInvocationContext invocationContext, ExtensionContext extensionContext) throws Throwable { + if (IS_INSIDE_ARQUILLIAN.test(extensionContext) || isRunAsClient(extensionContext)) { + getManager(extensionContext).getAdaptor().after( + extensionContext.getRequiredTestInstance(), + extensionContext.getRequiredTestMethod(), + invocation::proceed); + } else { + invocation.skip(); + } } @Override From 88f9920ba26faf38f27d0305fae6d3a62244f51c Mon Sep 17 00:00:00 2001 From: Radoslav Husar Date: Wed, 3 Jul 2024 19:20:40 +0200 Subject: [PATCH 02/12] Disable MultiThreadedBuilder by default. (#582) Co-authored-by: Scott M Stark --- .mvn/maven.config | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .mvn/maven.config diff --git a/.mvn/maven.config b/.mvn/maven.config deleted file mode 100644 index c5db7dac5..000000000 --- a/.mvn/maven.config +++ /dev/null @@ -1 +0,0 @@ --T1.5C From c23f9717f91883c9f0ae606567878eb871296adf Mon Sep 17 00:00:00 2001 From: Scott M Stark Date: Mon, 8 Jul 2024 11:00:37 -0600 Subject: [PATCH 03/12] Move main branch to 1.9.0.Final-SNAPSHOT Signed-off-by: Scott M Stark --- bom/pom.xml | 2 +- build/pom.xml | 2 +- config/api/pom.xml | 2 +- config/impl-base/pom.xml | 2 +- config/pom.xml | 2 +- config/spi/pom.xml | 2 +- container/impl-base/pom.xml | 2 +- container/pom.xml | 2 +- container/spi/pom.xml | 2 +- container/test-api/pom.xml | 2 +- container/test-impl-base/pom.xml | 2 +- container/test-spi/pom.xml | 2 +- core/api/pom.xml | 2 +- core/impl-base/pom.xml | 2 +- core/pom.xml | 2 +- core/spi/pom.xml | 2 +- junit/container/pom.xml | 2 +- junit/core/pom.xml | 2 +- junit/pom.xml | 2 +- junit/standalone/pom.xml | 2 +- junit5/container/pom.xml | 2 +- junit5/core/pom.xml | 2 +- junit5/pom.xml | 2 +- pom.xml | 2 +- protocols/jmx/pom.xml | 2 +- protocols/pom.xml | 2 +- protocols/servlet/pom.xml | 2 +- test/api/pom.xml | 2 +- test/impl-base/pom.xml | 2 +- test/pom.xml | 2 +- test/spi/pom.xml | 2 +- testenrichers/cdi/pom.xml | 2 +- testenrichers/ejb/pom.xml | 2 +- testenrichers/initialcontext/pom.xml | 2 +- testenrichers/pom.xml | 2 +- testenrichers/resource/pom.xml | 2 +- testng/container/pom.xml | 2 +- testng/core/pom.xml | 2 +- testng/pom.xml | 2 +- testng/standalone/pom.xml | 2 +- 40 files changed, 40 insertions(+), 40 deletions(-) diff --git a/bom/pom.xml b/bom/pom.xml index e91f76dea..83c0d9608 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -7,7 +7,7 @@ org.jboss.arquillian arquillian-bom - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT pom Arquillian BOM http://arquillian.org diff --git a/build/pom.xml b/build/pom.xml index 2636c33a3..93453dce8 100644 --- a/build/pom.xml +++ b/build/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../pom.xml diff --git a/config/api/pom.xml b/config/api/pom.xml index 99dd9fc84..e0b951cb7 100644 --- a/config/api/pom.xml +++ b/config/api/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/config/impl-base/pom.xml b/config/impl-base/pom.xml index 8438b9cf6..a5c36aa2b 100644 --- a/config/impl-base/pom.xml +++ b/config/impl-base/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/config/pom.xml b/config/pom.xml index ff98c497b..ad12a2653 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT diff --git a/config/spi/pom.xml b/config/spi/pom.xml index 7c98996a0..31272b9e1 100644 --- a/config/spi/pom.xml +++ b/config/spi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/container/impl-base/pom.xml b/container/impl-base/pom.xml index 07bf603a6..a1d7ffda2 100644 --- a/container/impl-base/pom.xml +++ b/container/impl-base/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/container/pom.xml b/container/pom.xml index c778413f9..2f5c30058 100644 --- a/container/pom.xml +++ b/container/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT diff --git a/container/spi/pom.xml b/container/spi/pom.xml index 72cb1409d..609105c55 100644 --- a/container/spi/pom.xml +++ b/container/spi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/container/test-api/pom.xml b/container/test-api/pom.xml index 6f821cb99..e14b65a9e 100644 --- a/container/test-api/pom.xml +++ b/container/test-api/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/container/test-impl-base/pom.xml b/container/test-impl-base/pom.xml index 24efbb04d..ab4ce402e 100644 --- a/container/test-impl-base/pom.xml +++ b/container/test-impl-base/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/container/test-spi/pom.xml b/container/test-spi/pom.xml index 0f876fa5b..e436c5313 100644 --- a/container/test-spi/pom.xml +++ b/container/test-spi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/core/api/pom.xml b/core/api/pom.xml index 1efc18aaa..b54db164e 100644 --- a/core/api/pom.xml +++ b/core/api/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/core/impl-base/pom.xml b/core/impl-base/pom.xml index 7c40d767b..9734a57b4 100644 --- a/core/impl-base/pom.xml +++ b/core/impl-base/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/core/pom.xml b/core/pom.xml index 5f960c8e8..58bb9fe23 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT diff --git a/core/spi/pom.xml b/core/spi/pom.xml index bd6e5d6f4..0ada712b0 100644 --- a/core/spi/pom.xml +++ b/core/spi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/junit/container/pom.xml b/junit/container/pom.xml index e159edbf2..a13e228cf 100644 --- a/junit/container/pom.xml +++ b/junit/container/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/junit/core/pom.xml b/junit/core/pom.xml index 2a6c2b252..aadff9bb0 100644 --- a/junit/core/pom.xml +++ b/junit/core/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/junit/pom.xml b/junit/pom.xml index 1c2f855c2..38ef8a0cd 100644 --- a/junit/pom.xml +++ b/junit/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT diff --git a/junit/standalone/pom.xml b/junit/standalone/pom.xml index 1db5e47d7..d7aa950ac 100644 --- a/junit/standalone/pom.xml +++ b/junit/standalone/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/junit5/container/pom.xml b/junit5/container/pom.xml index 132bfc41d..15f116dd2 100644 --- a/junit5/container/pom.xml +++ b/junit5/container/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/junit5/core/pom.xml b/junit5/core/pom.xml index 83d3e89ff..a5b57c900 100644 --- a/junit5/core/pom.xml +++ b/junit5/core/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/junit5/pom.xml b/junit5/pom.xml index 59798d7cb..6955f5c0e 100644 --- a/junit5/pom.xml +++ b/junit5/pom.xml @@ -4,7 +4,7 @@ org.jboss.arquillian arquillian-parent - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT diff --git a/pom.xml b/pom.xml index 8619ba89b..46cf48d03 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ org.jboss.arquillian arquillian-parent - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT pom Arquillian Aggregator http://arquillian.org diff --git a/protocols/jmx/pom.xml b/protocols/jmx/pom.xml index 4a06ea0b0..f4021674e 100644 --- a/protocols/jmx/pom.xml +++ b/protocols/jmx/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/protocols/pom.xml b/protocols/pom.xml index 7fd4e25ed..ec49227db 100644 --- a/protocols/pom.xml +++ b/protocols/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT diff --git a/protocols/servlet/pom.xml b/protocols/servlet/pom.xml index 626d3b237..309388bfc 100644 --- a/protocols/servlet/pom.xml +++ b/protocols/servlet/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/test/api/pom.xml b/test/api/pom.xml index 437b594ba..89fb7fc2d 100644 --- a/test/api/pom.xml +++ b/test/api/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/test/impl-base/pom.xml b/test/impl-base/pom.xml index e93cb5998..10ffdf71d 100644 --- a/test/impl-base/pom.xml +++ b/test/impl-base/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/test/pom.xml b/test/pom.xml index 38cf86c30..fe45dc6c4 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT diff --git a/test/spi/pom.xml b/test/spi/pom.xml index bfb681ae6..7c9ba76ea 100644 --- a/test/spi/pom.xml +++ b/test/spi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/testenrichers/cdi/pom.xml b/testenrichers/cdi/pom.xml index bf82ab185..107f02825 100644 --- a/testenrichers/cdi/pom.xml +++ b/testenrichers/cdi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/testenrichers/ejb/pom.xml b/testenrichers/ejb/pom.xml index 6cfea7890..38b95b024 100644 --- a/testenrichers/ejb/pom.xml +++ b/testenrichers/ejb/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/testenrichers/initialcontext/pom.xml b/testenrichers/initialcontext/pom.xml index 6f5fe5fbe..b45eb869f 100644 --- a/testenrichers/initialcontext/pom.xml +++ b/testenrichers/initialcontext/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/testenrichers/pom.xml b/testenrichers/pom.xml index 44e2db482..374f954eb 100644 --- a/testenrichers/pom.xml +++ b/testenrichers/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT diff --git a/testenrichers/resource/pom.xml b/testenrichers/resource/pom.xml index d87516dbe..8cb6b7721 100644 --- a/testenrichers/resource/pom.xml +++ b/testenrichers/resource/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/testng/container/pom.xml b/testng/container/pom.xml index a5776335e..31de438e0 100644 --- a/testng/container/pom.xml +++ b/testng/container/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/testng/core/pom.xml b/testng/core/pom.xml index 1adbb3de2..27b957822 100644 --- a/testng/core/pom.xml +++ b/testng/core/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml diff --git a/testng/pom.xml b/testng/pom.xml index 96e80416d..88b330b44 100644 --- a/testng/pom.xml +++ b/testng/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT diff --git a/testng/standalone/pom.xml b/testng/standalone/pom.xml index 31f7e9a09..458d0dd53 100644 --- a/testng/standalone/pom.xml +++ b/testng/standalone/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-build - 1.8.2.Final-SNAPSHOT + 1.9.0.Final-SNAPSHOT ../../build/pom.xml From 92b9fdd91098425331ce6ea9caff4126d097c735 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 12:03:52 -0500 Subject: [PATCH 04/12] build(deps): Bump version.junit5 from 5.10.2 to 5.10.3 (#571) Bumps `version.junit5` from 5.10.2 to 5.10.3. Updates `org.junit.jupiter:junit-jupiter-engine` from 5.10.2 to 5.10.3 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.10.2...r5.10.3) Updates `org.junit.jupiter:junit-jupiter-api` from 5.10.2 to 5.10.3 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.10.2...r5.10.3) Updates `org.junit.jupiter:junit-jupiter-params` from 5.10.2 to 5.10.3 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.10.2...r5.10.3) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.junit.jupiter:junit-jupiter-api dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.junit.jupiter:junit-jupiter-params dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Scott M Stark --- build/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pom.xml b/build/pom.xml index 93453dce8..393e7c8a8 100644 --- a/build/pom.xml +++ b/build/pom.xml @@ -26,7 +26,7 @@ 1 4.13.2 1.10.1 - 5.10.2 + 5.10.3 4.10.0 7.5 3.24.2 From 5f70ee044ee4d7dc0b472ff015f9ce42e6a7bc10 Mon Sep 17 00:00:00 2001 From: Scott M Stark Date: Mon, 8 Jul 2024 18:44:32 -0600 Subject: [PATCH 05/12] Correct the javadoc references to @OperateOnDeployment (#589) Fixes #64 Signed-off-by: Scott M Stark --- .../container/test/api/OperateOnDeployment.java | 8 ++++---- .../test/impl/client/ContainerEventController.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/container/test-api/src/main/java/org/jboss/arquillian/container/test/api/OperateOnDeployment.java b/container/test-api/src/main/java/org/jboss/arquillian/container/test/api/OperateOnDeployment.java index 8d9f2196e..24c4818e6 100644 --- a/container/test-api/src/main/java/org/jboss/arquillian/container/test/api/OperateOnDeployment.java +++ b/container/test-api/src/main/java/org/jboss/arquillian/container/test/api/OperateOnDeployment.java @@ -46,10 +46,10 @@ * .addClass(MyServletY.class); * } * - * @Test @OperatesOnDeployment("X") + * @Test @OperateOnDeployment("X") * public void shouldExecuteInX() { ... } * - * @Test @OperatesOnDeployment("Y") + * @Test @OperateOnDeployment("Y") * public void shouldExecuteInY() { ... } * *

@@ -70,10 +70,10 @@ * .addClass(MyServletY.class); * } * - * @Test @OperatesOnDeployment("X") + * @Test @OperateOnDeployment("X") * public void shouldExecuteInX() { ... } * - * @Test @OperatesOnDeployment("Y") @RunAsClient + * @Test @OperateOnDeployment("Y") @RunAsClient * public void shouldExecuteInY(@ArquillianResource @OperateOnDeployment("X") URL deploymentXURLContext) { ... } * * diff --git a/container/test-impl-base/src/main/java/org/jboss/arquillian/container/test/impl/client/ContainerEventController.java b/container/test-impl-base/src/main/java/org/jboss/arquillian/container/test/impl/client/ContainerEventController.java index 2e2fcab0c..8d655c795 100644 --- a/container/test-impl-base/src/main/java/org/jboss/arquillian/container/test/impl/client/ContainerEventController.java +++ b/container/test-impl-base/src/main/java/org/jboss/arquillian/container/test/impl/client/ContainerEventController.java @@ -132,7 +132,7 @@ private void createContext(EventContext context) { } /* - * Internal Helpers needed to extract @OperatesOnDeployment from TestMethod. + * Internal Helpers needed to extract @OperateOnDeployment from TestMethod. * * TODO: This should not rely on direct Reflection, but rather access the metadata through some * common metadata layer. From 77233267901d54ca3dd4bf82bf728559618c6536 Mon Sep 17 00:00:00 2001 From: "James R. Perkins" Date: Mon, 8 Jul 2024 17:59:40 -0700 Subject: [PATCH 06/12] =?UTF-8?q?[580]=20Create=20some=20integration=20tes?= =?UTF-8?q?ts.=20Create=20profiles=20for=20WildFly=20to=20r=E2=80=A6=20(#5?= =?UTF-8?q?81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [580] Create some integration tests. Create profiles for WildFly and Payara for testing. Signed-off-by: James R. Perkins * [580] Upgrade the Maven version. Signed-off-by: James R. Perkins --------- Signed-off-by: James R. Perkins Co-authored-by: Scott M Stark --- .github/workflows/integration-tests.yml | 84 +++++ .mvn/wrapper/maven-wrapper.properties | 2 +- integration-tests/common/pom.xml | 88 ++++++ .../test/common/TestEnvironment.java | 96 ++++++ .../test/common/app/EchoResource.java | 37 +++ .../integration/test/common/app/Greeter.java | 33 ++ .../test/common/app/RestActivator.java | 31 ++ .../main/resources/manual-mode-arquillian.xml | 24 ++ integration-tests/junit4-tests/pom.xml | 70 +++++ .../test/cdi/CdiInjectionTest.java | 62 ++++ .../test/manual/ManualModeTest.java | 92 ++++++ .../AbstractArquillianResourceTest.java | 102 ++++++ .../ClientArquillianResourceTest.java | 29 ++ .../InContainerArquillianResourceTest.java | 67 ++++ integration-tests/junit5-tests/pom.xml | 80 +++++ .../test/cdi/CdiInjectionTest.java | 62 ++++ .../test/manual/ManualModeTest.java | 98 ++++++ .../AbstractArquillianResourceTest.java | 105 +++++++ .../ClientArquillianResourceTest.java | 29 ++ .../InContainerArquillianResourceTest.java | 70 +++++ integration-tests/pom.xml | 293 ++++++++++++++++++ integration-tests/testng-tests/pom.xml | 70 +++++ .../test/cdi/CdiInjectionTest.java | 60 ++++ .../test/manual/ManualModeTest.java | 90 ++++++ .../AbstractArquillianResourceTest.java | 83 +++++ .../ClientArquillianResourceTest.java | 29 ++ .../InContainerArquillianResourceTest.java | 53 ++++ pom.xml | 8 + 28 files changed, 1946 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/integration-tests.yml create mode 100644 integration-tests/common/pom.xml create mode 100644 integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/TestEnvironment.java create mode 100644 integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/app/EchoResource.java create mode 100644 integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/app/Greeter.java create mode 100644 integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/app/RestActivator.java create mode 100644 integration-tests/common/src/main/resources/manual-mode-arquillian.xml create mode 100644 integration-tests/junit4-tests/pom.xml create mode 100644 integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/cdi/CdiInjectionTest.java create mode 100644 integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/manual/ManualModeTest.java create mode 100644 integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/AbstractArquillianResourceTest.java create mode 100644 integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/ClientArquillianResourceTest.java create mode 100644 integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/InContainerArquillianResourceTest.java create mode 100644 integration-tests/junit5-tests/pom.xml create mode 100644 integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/cdi/CdiInjectionTest.java create mode 100644 integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/manual/ManualModeTest.java create mode 100644 integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/AbstractArquillianResourceTest.java create mode 100644 integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/ClientArquillianResourceTest.java create mode 100644 integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/InContainerArquillianResourceTest.java create mode 100644 integration-tests/pom.xml create mode 100644 integration-tests/testng-tests/pom.xml create mode 100644 integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/cdi/CdiInjectionTest.java create mode 100644 integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/manual/ManualModeTest.java create mode 100644 integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/AbstractArquillianResourceTest.java create mode 100644 integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/ClientArquillianResourceTest.java create mode 100644 integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/InContainerArquillianResourceTest.java diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml new file mode 100644 index 000000000..88b3b0353 --- /dev/null +++ b/.github/workflows/integration-tests.yml @@ -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: | + ./mvnw -V 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: | + ./mvnw -V 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' diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index ffdc10e59..e09662410 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -1,2 +1,2 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar diff --git a/integration-tests/common/pom.xml b/integration-tests/common/pom.xml new file mode 100644 index 000000000..c6cca86f6 --- /dev/null +++ b/integration-tests/common/pom.xml @@ -0,0 +1,88 @@ + + + + + 4.0.0 + + org.jboss.arquillian + integration-tests + 1.9.0.Final-SNAPSHOT + ../pom.xml + + + common-tests + Arquillian Core: Common integration tests + + + + 5.10.3 + + + + + + org.junit + junit-bom + ${version.org.junit} + pom + import + + + + + + + jakarta.annotation + jakarta.annotation-api + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + jakarta.inject + jakarta.inject-api + + + jakarta.ws.rs + jakarta.ws.rs-api + + + org.jboss.arquillian.container + arquillian-container-test-api + + + org.jboss.arquillian.test + arquillian-test-api + + + + + org.junit.jupiter + junit-jupiter + test + + + + + + diff --git a/integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/TestEnvironment.java b/integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/TestEnvironment.java new file mode 100644 index 000000000..aeb1485f1 --- /dev/null +++ b/integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/TestEnvironment.java @@ -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 James R. Perkins + */ +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()); + } + +} diff --git a/integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/app/EchoResource.java b/integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/app/EchoResource.java new file mode 100644 index 000000000..51090cb4d --- /dev/null +++ b/integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/app/EchoResource.java @@ -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 James R. Perkins + */ +@Path("echo") +@RequestScoped +public class EchoResource { + + @POST + public String echo(final String msg) { + return msg; + } +} diff --git a/integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/app/Greeter.java b/integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/app/Greeter.java new file mode 100644 index 000000000..23051ca92 --- /dev/null +++ b/integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/app/Greeter.java @@ -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 James R. Perkins + */ +@ApplicationScoped +public class Greeter { + + public String greet(String name) { + return "Hello " + name + "!"; + } +} diff --git a/integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/app/RestActivator.java b/integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/app/RestActivator.java new file mode 100644 index 000000000..d40050d35 --- /dev/null +++ b/integration-tests/common/src/main/java/org/jboss/arquillian/integration/test/common/app/RestActivator.java @@ -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 James R. Perkins + */ +@ApplicationPath(TestEnvironment.REST_PATH) +public class RestActivator extends Application { +} diff --git a/integration-tests/common/src/main/resources/manual-mode-arquillian.xml b/integration-tests/common/src/main/resources/manual-mode-arquillian.xml new file mode 100644 index 000000000..efdaaaa41 --- /dev/null +++ b/integration-tests/common/src/main/resources/manual-mode-arquillian.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/integration-tests/junit4-tests/pom.xml b/integration-tests/junit4-tests/pom.xml new file mode 100644 index 000000000..6b58e237d --- /dev/null +++ b/integration-tests/junit4-tests/pom.xml @@ -0,0 +1,70 @@ + + + + + 4.0.0 + + org.jboss.arquillian + integration-tests + 1.9.0.Final-SNAPSHOT + ../pom.xml + + + junit4-tests + Arquillian Core: JUnit 4 Integration Tests + + + 4.13.2 + + + + + + + junit + junit + test + ${version.org.junit} + + + org.jboss.arquillian + common-tests + test + + + org.jboss.arquillian.junit + arquillian-junit-container + test + + + + + + wildfly + + + false + + + + + diff --git a/integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/cdi/CdiInjectionTest.java b/integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/cdi/CdiInjectionTest.java new file mode 100644 index 000000000..eae767304 --- /dev/null +++ b/integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/cdi/CdiInjectionTest.java @@ -0,0 +1,62 @@ +/* + * 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.cdi; + +import java.net.URI; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.integration.test.common.app.Greeter; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * @author James R. Perkins + */ +@RunWith(Arquillian.class) +@ApplicationScoped +public class CdiInjectionTest { + + @Deployment + public static WebArchive createDeployment() { + return ShrinkWrap.create(WebArchive.class) + .addClass(Greeter.class) + .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + } + + @ArquillianResource + private URI uri; + + @Inject + Greeter greeter; + + @Test + public void validateGreeting() { + Assert.assertNotNull("Greeter should not be null", greeter); + Assert.assertEquals("Hello JUnit5!", greeter.greet("JUnit5")); + } +} diff --git a/integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/manual/ManualModeTest.java b/integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/manual/ManualModeTest.java new file mode 100644 index 000000000..9ffeabf83 --- /dev/null +++ b/integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/manual/ManualModeTest.java @@ -0,0 +1,92 @@ +/* + * 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.manual; + +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; + +import org.jboss.arquillian.container.test.api.ContainerController; +import org.jboss.arquillian.container.test.api.Deployer; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.RunAsClient; +import org.jboss.arquillian.integration.test.common.TestEnvironment; +import org.jboss.arquillian.integration.test.common.app.EchoResource; +import org.jboss.arquillian.integration.test.common.app.RestActivator; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * @author James R. Perkins + */ +@RunWith(Arquillian.class) +@RunAsClient +public class ManualModeTest { + private static final String CONTAINER_NAME = "default"; + private static final String DEPLOYMENT_NAME = "manual-mode"; + + @Deployment(name = DEPLOYMENT_NAME, managed = false) + public static WebArchive createDeployment() { + return ShrinkWrap.create(WebArchive.class, DEPLOYMENT_NAME + ".war") + .addClasses(RestActivator.class, EchoResource.class) + .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + } + + @ArquillianResource + private static ContainerController controller; + + @ArquillianResource + private static Deployer deployer; + + @Test + public void startConnectAndStop() throws Exception { + Assert.assertNotNull(controller); + Assert.assertFalse("This is a manual mode test and the server should not have been started.", controller.isStarted(CONTAINER_NAME)); + // Check that we can start the server and the server is running + controller.start(CONTAINER_NAME); + Assert.assertTrue("The server should have been started", controller.isStarted(CONTAINER_NAME)); + + // Deploy the application and make a REST request + deployer.deploy(DEPLOYMENT_NAME); + assertAppDeployed(); + + // Undeploy the application and stop the server + deployer.undeploy(DEPLOYMENT_NAME); + controller.stop(CONTAINER_NAME); + } + + private void assertAppDeployed() throws Exception { + final String msg = "Test message"; + final HttpClient client = HttpClient.newHttpClient(); + final HttpRequest request = HttpRequest.newBuilder() + .uri(TestEnvironment.uri(DEPLOYMENT_NAME, TestEnvironment.REST_PATH, "echo")) + .POST(HttpRequest.BodyPublishers.ofString(msg)) + .build(); + final HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); + Assert.assertEquals(200, response.statusCode()); + Assert.assertEquals(msg, response.body()); + } +} diff --git a/integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/AbstractArquillianResourceTest.java b/integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/AbstractArquillianResourceTest.java new file mode 100644 index 000000000..8cf1b7587 --- /dev/null +++ b/integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/AbstractArquillianResourceTest.java @@ -0,0 +1,102 @@ +/* + * 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.resource.injection; + +import java.net.URI; +import java.net.URL; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.integration.test.common.TestEnvironment; +import org.jboss.arquillian.integration.test.common.app.Greeter; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * @author James R. Perkins + */ +@RunWith(Arquillian.class) +abstract class AbstractArquillianResourceTest { + static final String DEPLOYMENT_NAME = "injection"; + + @ArquillianResource + protected URL url; + + @ArquillianResource + protected URI uri; + + @Deployment + public static WebArchive createDeployment() { + return ShrinkWrap.create(WebArchive.class, DEPLOYMENT_NAME + ".war") + .addClasses(Greeter.class, AbstractArquillianResourceTest.class, TestEnvironment.class) + .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + } + + @Test + public void checkUrl() { + Assert.assertNotNull("The URL should have been injected", url); + Assert.assertEquals(TestEnvironment.protocol(), url.getProtocol()); + checkHost(url.getHost()); + Assert.assertEquals(TestEnvironment.port(), url.getPort()); + Assert.assertEquals("/" + DEPLOYMENT_NAME + "/", url.getPath()); + } + + @Test + public void checkParameterUrl(@ArquillianResource final URL url) { + Assert.assertNotNull("The URL should have been injected", url); + Assert.assertEquals(TestEnvironment.protocol(), url.getProtocol()); + checkHost(url.getHost()); + Assert.assertEquals(TestEnvironment.port(), url.getPort()); + Assert.assertEquals("/" + DEPLOYMENT_NAME + "/", url.getPath()); + } + + @Test + public void checkUri() { + Assert.assertNotNull("The URI should have been injected", uri); + checkHost(uri.getHost()); + Assert.assertEquals(TestEnvironment.port(), uri.getPort()); + Assert.assertEquals("/" + DEPLOYMENT_NAME + "/", uri.getPath()); + } + + @Test + public void checkParameterUri(@ArquillianResource final URI uri) { + Assert.assertNotNull("The URI should have been injected", uri); + checkHost(uri.getHost()); + Assert.assertEquals(TestEnvironment.port(), uri.getPort()); + Assert.assertEquals("/" + DEPLOYMENT_NAME + "/", uri.getPath()); + } + + protected void checkHost(final String host) { + // localhost and 127.0.0.1 should be treated as the same + final String expectedHost = TestEnvironment.host(); + if ("127.0.0.1".equals(expectedHost)) { + Assert.assertEquals(expectedHost, host.replace("localhost", "127.0.0.1")); + } else if ("localhost".equals(expectedHost)) { + Assert.assertEquals(expectedHost, host.replace("127.0.0.1", "localhost")); + } else { + Assert.assertEquals(expectedHost, host); + } + } +} diff --git a/integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/ClientArquillianResourceTest.java b/integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/ClientArquillianResourceTest.java new file mode 100644 index 000000000..90a75fa22 --- /dev/null +++ b/integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/ClientArquillianResourceTest.java @@ -0,0 +1,29 @@ +/* + * 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.resource.injection; + +import org.jboss.arquillian.container.test.api.RunAsClient; + +/** + * @author James R. Perkins + */ +@RunAsClient +public class ClientArquillianResourceTest extends AbstractArquillianResourceTest { +} diff --git a/integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/InContainerArquillianResourceTest.java b/integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/InContainerArquillianResourceTest.java new file mode 100644 index 000000000..b54838f80 --- /dev/null +++ b/integration-tests/junit4-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/InContainerArquillianResourceTest.java @@ -0,0 +1,67 @@ +/* + * 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.resource.injection; + +import javax.naming.Context; +import javax.naming.InitialContext; + +import org.jboss.arquillian.test.api.ArquillianResource; +import org.junit.Assert; +import org.junit.Test; + +/** + * @author James R. Perkins + */ +public class InContainerArquillianResourceTest extends AbstractArquillianResourceTest { + + @ArquillianResource + protected Context context; + + @ArquillianResource + protected InitialContext initialContext; + + @Test + public void checkContext() throws Exception { + Assert.assertNotNull("The Context should have been injected", context); + final Object bm = context.lookup("java:comp/BeanManager"); + Assert.assertNotNull(bm); + } + + @Test + public void checkContextParameter(@ArquillianResource final Context context) throws Exception { + Assert.assertNotNull("The Context should have been injected", context); + final Object bm = context.lookup("java:comp/BeanManager"); + Assert.assertNotNull(bm); + } + + @Test + public void checkInitialContext() throws Exception { + Assert.assertNotNull("The InitialContext should have been injected", initialContext); + final Object bm = initialContext.lookup("java:comp/BeanManager"); + Assert.assertNotNull(bm); + } + + @Test + public void checkInitialContextParameter(@ArquillianResource final InitialContext initialContext) throws Exception { + Assert.assertNotNull("The InitialContext should have been injected", initialContext); + final Object bm = initialContext.lookup("java:comp/BeanManager"); + Assert.assertNotNull(bm); + } +} diff --git a/integration-tests/junit5-tests/pom.xml b/integration-tests/junit5-tests/pom.xml new file mode 100644 index 000000000..f61b03845 --- /dev/null +++ b/integration-tests/junit5-tests/pom.xml @@ -0,0 +1,80 @@ + + + + + 4.0.0 + + org.jboss.arquillian + integration-tests + 1.9.0.Final-SNAPSHOT + ../pom.xml + + + junit5-tests + Arquillian Core: JUnit 5 Integration Tests + + + 5.10.3 + + + + + + org.junit + junit-bom + ${version.org.junit} + pom + import + + + + + + + + org.junit.jupiter + junit-jupiter + test + + + org.jboss.arquillian + common-tests + test + + + org.jboss.arquillian.junit5 + arquillian-junit5-container + test + + + + + + wildfly + + + false + + + + + diff --git a/integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/cdi/CdiInjectionTest.java b/integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/cdi/CdiInjectionTest.java new file mode 100644 index 000000000..5770015fc --- /dev/null +++ b/integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/cdi/CdiInjectionTest.java @@ -0,0 +1,62 @@ +/* + * 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.cdi; + +import java.net.URI; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.integration.test.common.app.Greeter; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +/** + * @author James R. Perkins + */ +@ExtendWith(ArquillianExtension.class) +@ApplicationScoped +public class CdiInjectionTest { + + @Deployment + public static WebArchive createDeployment() { + return ShrinkWrap.create(WebArchive.class) + .addClass(Greeter.class) + .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + } + + @ArquillianResource + private URI uri; + + @Inject + Greeter greeter; + + @Test + public void validateGreeting() { + Assertions.assertNotNull(greeter, "Greeter should not be null"); + Assertions.assertEquals("Hello JUnit5!", greeter.greet("JUnit5")); + } +} diff --git a/integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/manual/ManualModeTest.java b/integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/manual/ManualModeTest.java new file mode 100644 index 000000000..83a59f0b8 --- /dev/null +++ b/integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/manual/ManualModeTest.java @@ -0,0 +1,98 @@ +/* + * 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.manual; + +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; + +import org.jboss.arquillian.container.test.api.ContainerController; +import org.jboss.arquillian.container.test.api.Deployer; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.RunAsClient; +import org.jboss.arquillian.integration.test.common.TestEnvironment; +import org.jboss.arquillian.integration.test.common.app.EchoResource; +import org.jboss.arquillian.integration.test.common.app.RestActivator; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +/** + * @author James R. Perkins + */ +@ExtendWith(ArquillianExtension.class) +@RunAsClient +public class ManualModeTest { + private static final String CONTAINER_NAME = "default"; + private static final String DEPLOYMENT_NAME = "manual-mode"; + + @ArquillianResource + private static ContainerController controller; + + @ArquillianResource + private static Deployer deployer; + + @Deployment(name = DEPLOYMENT_NAME, managed = false) + public static WebArchive createDeployment() { + return ShrinkWrap.create(WebArchive.class, DEPLOYMENT_NAME + ".war") + .addClasses(RestActivator.class, EchoResource.class) + .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + } + + @BeforeEach + public void validate() { + Assertions.assertNotNull(controller); + Assertions.assertFalse(controller.isStarted(CONTAINER_NAME), "This is a manual mode test and the server should not have been started."); + } + + @AfterEach + public void cleanUp() { + if (controller.isStarted(CONTAINER_NAME)) { + deployer.undeploy(DEPLOYMENT_NAME); + controller.stop(CONTAINER_NAME); + } + } + + @Test + public void startConnectAndStop() throws Exception { + // Start the server, check it's been started and deploy the application + controller.start(CONTAINER_NAME); + Assertions.assertTrue(controller.isStarted(CONTAINER_NAME), "The server should be started."); + deployer.deploy(DEPLOYMENT_NAME); + + // Make an HTTP request to make sure the deployment is available + final String msg = "Test message"; + final HttpClient client = HttpClient.newHttpClient(); + final HttpRequest request = HttpRequest.newBuilder() + .uri(TestEnvironment.uri(DEPLOYMENT_NAME, TestEnvironment.REST_PATH, "echo")) + .POST(HttpRequest.BodyPublishers.ofString(msg)) + .build(); + final HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); + Assertions.assertEquals(200, response.statusCode()); + Assertions.assertEquals(msg, response.body()); + } +} diff --git a/integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/AbstractArquillianResourceTest.java b/integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/AbstractArquillianResourceTest.java new file mode 100644 index 000000000..6162f2ede --- /dev/null +++ b/integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/AbstractArquillianResourceTest.java @@ -0,0 +1,105 @@ +/* + * 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.resource.injection; + +import java.net.URI; +import java.net.URL; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.integration.test.common.TestEnvironment; +import org.jboss.arquillian.integration.test.common.app.Greeter; +import org.jboss.arquillian.junit5.ArquillianExtension; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +/** + * @author James R. Perkins + */ +@ExtendWith(ArquillianExtension.class) +abstract class AbstractArquillianResourceTest { + static final String DEPLOYMENT_NAME = "injection"; + + @ArquillianResource + protected URL url; + + @ArquillianResource + protected URI uri; + + @Deployment + public static WebArchive createDeployment() { + return ShrinkWrap.create(WebArchive.class, DEPLOYMENT_NAME + ".war") + .addClasses(Greeter.class, AbstractArquillianResourceTest.class, TestEnvironment.class) + .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + } + + @Test + public void checkUrl() { + Assertions.assertNotNull(url, "The URL should have been injected"); + Assertions.assertEquals(TestEnvironment.protocol(), url.getProtocol()); + checkHost(url.getHost()); + Assertions.assertEquals(TestEnvironment.port(), url.getPort()); + Assertions.assertEquals("/" + DEPLOYMENT_NAME + "/", url.getPath()); + } + + @Test + @Disabled("https://github.com/arquillian/arquillian-core/issues/312") + public void checkParameterUrl(@ArquillianResource final URL url) { + Assertions.assertNotNull(url, "The URL should have been injected"); + Assertions.assertEquals(TestEnvironment.protocol(), url.getProtocol()); + checkHost(url.getHost()); + Assertions.assertEquals(TestEnvironment.port(), url.getPort()); + Assertions.assertEquals("/" + DEPLOYMENT_NAME + "/", url.getPath()); + } + + @Test + public void checkUri() { + Assertions.assertNotNull(uri, "The URI should have been injected"); + checkHost(uri.getHost()); + Assertions.assertEquals(TestEnvironment.port(), uri.getPort()); + Assertions.assertEquals("/" + DEPLOYMENT_NAME + "/", uri.getPath()); + } + + @Test + @Disabled("https://github.com/arquillian/arquillian-core/issues/312") + public void checkParameterUri(@ArquillianResource final URI uri) { + Assertions.assertNotNull(uri, "The URI should have been injected"); + checkHost(uri.getHost()); + Assertions.assertEquals(TestEnvironment.port(), uri.getPort()); + Assertions.assertEquals("/" + DEPLOYMENT_NAME + "/", uri.getPath()); + } + + protected void checkHost(final String host) { + // localhost and 127.0.0.1 should be treated as the same + final String expectedHost = TestEnvironment.host(); + if ("127.0.0.1".equals(expectedHost)) { + Assertions.assertEquals(expectedHost, host.replace("localhost", "127.0.0.1")); + } else if ("localhost".equals(expectedHost)) { + Assertions.assertEquals(expectedHost, host.replace("127.0.0.1", "localhost")); + } else { + Assertions.assertEquals(expectedHost, host); + } + } +} diff --git a/integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/ClientArquillianResourceTest.java b/integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/ClientArquillianResourceTest.java new file mode 100644 index 000000000..90a75fa22 --- /dev/null +++ b/integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/ClientArquillianResourceTest.java @@ -0,0 +1,29 @@ +/* + * 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.resource.injection; + +import org.jboss.arquillian.container.test.api.RunAsClient; + +/** + * @author James R. Perkins + */ +@RunAsClient +public class ClientArquillianResourceTest extends AbstractArquillianResourceTest { +} diff --git a/integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/InContainerArquillianResourceTest.java b/integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/InContainerArquillianResourceTest.java new file mode 100644 index 000000000..bab8ae897 --- /dev/null +++ b/integration-tests/junit5-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/InContainerArquillianResourceTest.java @@ -0,0 +1,70 @@ +/* + * 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.resource.injection; + +import javax.naming.Context; +import javax.naming.InitialContext; + +import org.jboss.arquillian.test.api.ArquillianResource; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * @author James R. Perkins + */ +public class InContainerArquillianResourceTest extends AbstractArquillianResourceTest { + + @ArquillianResource + protected Context context; + + @ArquillianResource + protected InitialContext initialContext; + + @Test + public void checkContext() throws Exception { + Assertions.assertNotNull(context, "The Context should have been injected"); + final Object bm = context.lookup("java:comp/BeanManager"); + Assertions.assertNotNull(bm); + } + + @Test + @Disabled("https://github.com/arquillian/arquillian-core/issues/312") + public void checkContextParameter(@ArquillianResource final Context context) throws Exception { + Assertions.assertNotNull(context, "The Context should have been injected"); + final Object bm = context.lookup("java:comp/BeanManager"); + Assertions.assertNotNull(bm); + } + + @Test + public void checkInitialContext() throws Exception { + Assertions.assertNotNull(initialContext, "The InitialContext should have been injected"); + final Object bm = initialContext.lookup("java:comp/BeanManager"); + Assertions.assertNotNull(bm); + } + + @Test + @Disabled("https://github.com/arquillian/arquillian-core/issues/312") + public void checkInitialContextParameter(@ArquillianResource final InitialContext initialContext) throws Exception { + Assertions.assertNotNull(initialContext, "The InitialContext should have been injected"); + final Object bm = initialContext.lookup("java:comp/BeanManager"); + Assertions.assertNotNull(bm); + } +} diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml new file mode 100644 index 000000000..0c8b765ae --- /dev/null +++ b/integration-tests/pom.xml @@ -0,0 +1,293 @@ + + + + + 4.0.0 + + org.jboss + jboss-parent + 46 + + + + org.jboss.arquillian + integration-tests + 1.9.0.Final-SNAPSHOT + pom + Arquillian Core: Implementation Integration Tests + Tests for implementations of Arquillian Core + + + common + junit4-tests + junit5-tests + testng-tests + + + + true + false + ${maven.test.skip} + + + 10.0.0 + ${project.version} + 1.8.1.Final + + + + + + + jakarta.platform + jakarta.jakartaee-bom + ${version.jakarta.ee} + import + pom + + + org.jboss.arquillian + arquillian-bom + ${version.org.jboss.arquillian} + import + pom + + + org.jboss.arquillian.jakarta + arquillian-jakarta-bom + ${version.org.jboss.arquillian.jakarta} + import + pom + + + org.jboss.arquillian + common-tests + ${project.version} + + + + + + + + + + maven-surefire-plugin + + + true + ${maven.test.redirectTestOutputToFile} + + + + cdi-tests + + test + + test + + ${skipTests} + + org.jboss.arquillian.integration.test.cdi.*Test + + + + + manual-mode-tests + + test + + test + + ${skipTests} + + org.jboss.arquillian.integration.test.manual.*Test + + + manual-mode-arquillian.xml + + + + + resource-injection-tests + + test + + test + + ${skipTests} + + org.jboss.arquillian.integration.test.resource.injection.*Test + + + + + + + + + + maven-deploy-plugin + + true + + + + + + + + + wildfly + + ${skipTests} + + + 5.1.0.Beta3 + 5.0.0.Final + + ${project.build.directory}${file.separator}wildfly + + + + + org.wildfly.arquillian + wildfly-arquillian-container-managed + ${version.org.wildfly.arquillian} + test + + + + + + + maven-surefire-plugin + + + ${jboss.home} + + + + + org.wildfly.plugins + wildfly-maven-plugin + ${version.wildfly-maven-plugin} + + ${skip.provision.server} + ${jboss.home} + ${jboss.home} + + + org.wildfly + wildfly-ee-galleon-pack + + + + + + org.wildfly.channels + wildfly-ee + + + + + ee-core-profile-server + + + true + + + + + provision-wildfly + + provision + + process-test-classes + + + + + + + + + payara + + ${skipTests} + + + 6.2024.6 + 3.0 + + ${project.build.directory}${file.separator}payara6 + + + + + fish.payara.arquillian + arquillian-payara-server-managed + ${version.fish.payara.arquillian} + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + process-test-classes + + unpack + + + + + fish.payara.distributions + payara + ${version.fish.payara} + zip + true + ${project.build.directory} + + + + + + + + maven-surefire-plugin + + + ${payara.home} + localhost + + + + + + + + + diff --git a/integration-tests/testng-tests/pom.xml b/integration-tests/testng-tests/pom.xml new file mode 100644 index 000000000..53b151878 --- /dev/null +++ b/integration-tests/testng-tests/pom.xml @@ -0,0 +1,70 @@ + + + + + 4.0.0 + + org.jboss.arquillian + integration-tests + 1.9.0.Final-SNAPSHOT + ../pom.xml + + + testng-tests + Arquillian Core: TestNG Integration Tests + + + 7.5 + + + + + + + org.testng + testng + ${version.org.testng} + test + + + org.jboss.arquillian + common-tests + test + + + org.jboss.arquillian.testng + arquillian-testng-container + test + + + + + + wildfly + + + false + + + + + diff --git a/integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/cdi/CdiInjectionTest.java b/integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/cdi/CdiInjectionTest.java new file mode 100644 index 000000000..62fd5e5d7 --- /dev/null +++ b/integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/cdi/CdiInjectionTest.java @@ -0,0 +1,60 @@ +/* + * 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.cdi; + +import java.net.URI; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.integration.test.common.app.Greeter; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.arquillian.testng.Arquillian; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.testng.Assert; +import org.testng.annotations.Test; + +/** + * @author James R. Perkins + */ +@ApplicationScoped +public class CdiInjectionTest extends Arquillian { + + @Deployment + public static WebArchive createDeployment() { + return ShrinkWrap.create(WebArchive.class) + .addClass(Greeter.class) + .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + } + + @ArquillianResource + private URI uri; + + @Inject + Greeter greeter; + + @Test + public void validateGreeting() { + Assert.assertNotNull(greeter, "Greeter should not be null"); + Assert.assertEquals(greeter.greet("JUnit5"), "Hello JUnit5!"); + } +} diff --git a/integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/manual/ManualModeTest.java b/integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/manual/ManualModeTest.java new file mode 100644 index 000000000..3f71fbd91 --- /dev/null +++ b/integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/manual/ManualModeTest.java @@ -0,0 +1,90 @@ +/* + * 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.manual; + +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; + +import org.jboss.arquillian.container.test.api.ContainerController; +import org.jboss.arquillian.container.test.api.Deployer; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.RunAsClient; +import org.jboss.arquillian.integration.test.common.TestEnvironment; +import org.jboss.arquillian.integration.test.common.app.EchoResource; +import org.jboss.arquillian.integration.test.common.app.RestActivator; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.arquillian.testng.Arquillian; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.testng.Assert; +import org.testng.annotations.Test; + +/** + * @author James R. Perkins + */ +@RunAsClient +public class ManualModeTest extends Arquillian { + private static final String CONTAINER_NAME = "default"; + private static final String DEPLOYMENT_NAME = "manual-mode"; + + @Deployment(name = DEPLOYMENT_NAME, managed = false) + public static WebArchive createDeployment() { + return ShrinkWrap.create(WebArchive.class, DEPLOYMENT_NAME + ".war") + .addClasses(RestActivator.class, EchoResource.class) + .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + } + + @ArquillianResource + private static ContainerController controller; + + @ArquillianResource + private static Deployer deployer; + + @Test + public void startConnectAndStop() throws Exception { + Assert.assertNotNull(controller); + Assert.assertFalse(controller.isStarted(CONTAINER_NAME), "This is a manual mode test and the server should not have been started."); + // Check that we can start the server and the server is running + controller.start(CONTAINER_NAME); + Assert.assertTrue(controller.isStarted(CONTAINER_NAME), "The server should have been started"); + + // Deploy the application and make a REST request + deployer.deploy(DEPLOYMENT_NAME); + assertAppDeployed(); + + // Undeploy the application and stop the server + deployer.undeploy(DEPLOYMENT_NAME); + controller.stop(CONTAINER_NAME); + } + + private void assertAppDeployed() throws Exception { + final String msg = "Test message"; + final HttpClient client = HttpClient.newHttpClient(); + final HttpRequest request = HttpRequest.newBuilder() + .uri(TestEnvironment.uri(DEPLOYMENT_NAME, TestEnvironment.REST_PATH, "echo")) + .POST(HttpRequest.BodyPublishers.ofString(msg)) + .build(); + final HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); + Assert.assertEquals(response.statusCode(), 200); + Assert.assertEquals(msg, response.body()); + } +} diff --git a/integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/AbstractArquillianResourceTest.java b/integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/AbstractArquillianResourceTest.java new file mode 100644 index 000000000..8c8e9403e --- /dev/null +++ b/integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/AbstractArquillianResourceTest.java @@ -0,0 +1,83 @@ +/* + * 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.resource.injection; + +import java.net.URI; +import java.net.URL; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.integration.test.common.TestEnvironment; +import org.jboss.arquillian.integration.test.common.app.Greeter; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.arquillian.testng.Arquillian; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.testng.Assert; +import org.testng.annotations.Test; + +/** + * @author James R. Perkins + */ +abstract class AbstractArquillianResourceTest extends Arquillian { + static final String DEPLOYMENT_NAME = "injection"; + + @ArquillianResource + protected URL url; + + @ArquillianResource + protected URI uri; + + @Deployment + public static WebArchive createDeployment() { + return ShrinkWrap.create(WebArchive.class, DEPLOYMENT_NAME + ".war") + .addClasses(Greeter.class, AbstractArquillianResourceTest.class, TestEnvironment.class) + .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + } + + @Test + public void checkUrl() { + Assert.assertNotNull(url, "The URL should have been injected"); + Assert.assertEquals(url.getProtocol(), TestEnvironment.protocol()); + checkHost(url.getHost()); + Assert.assertEquals(url.getPort(), TestEnvironment.port()); + Assert.assertEquals(url.getPath(), "/" + DEPLOYMENT_NAME + "/"); + } + + @Test + public void checkUri() { + Assert.assertNotNull(uri, "The URI should have been injected"); + checkHost(uri.getHost()); + Assert.assertEquals(uri.getPort(), TestEnvironment.port()); + Assert.assertEquals(uri.getPath(), "/" + DEPLOYMENT_NAME + "/"); + } + + protected void checkHost(final String host) { + // localhost and 127.0.0.1 should be treated as the same + final String expectedHost = TestEnvironment.host(); + if ("127.0.0.1".equals(expectedHost)) { + Assert.assertEquals(host.replace("localhost", "127.0.0.1"), expectedHost); + } else if ("localhost".equals(expectedHost)) { + Assert.assertEquals(host.replace("127.0.0.1", "localhost"), expectedHost); + } else { + Assert.assertEquals(host, expectedHost); + } + } +} diff --git a/integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/ClientArquillianResourceTest.java b/integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/ClientArquillianResourceTest.java new file mode 100644 index 000000000..90a75fa22 --- /dev/null +++ b/integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/ClientArquillianResourceTest.java @@ -0,0 +1,29 @@ +/* + * 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.resource.injection; + +import org.jboss.arquillian.container.test.api.RunAsClient; + +/** + * @author James R. Perkins + */ +@RunAsClient +public class ClientArquillianResourceTest extends AbstractArquillianResourceTest { +} diff --git a/integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/InContainerArquillianResourceTest.java b/integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/InContainerArquillianResourceTest.java new file mode 100644 index 000000000..dff00635d --- /dev/null +++ b/integration-tests/testng-tests/src/test/java/org/jboss/arquillian/integration/test/resource/injection/InContainerArquillianResourceTest.java @@ -0,0 +1,53 @@ +/* + * 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.resource.injection; + +import javax.naming.Context; +import javax.naming.InitialContext; + +import org.jboss.arquillian.test.api.ArquillianResource; +import org.testng.Assert; +import org.testng.annotations.Test; + +/** + * @author James R. Perkins + */ +public class InContainerArquillianResourceTest extends AbstractArquillianResourceTest { + + @ArquillianResource + protected Context context; + + @ArquillianResource + protected InitialContext initialContext; + + @Test + public void checkContext() throws Exception { + Assert.assertNotNull(context, "The Context should have been injected"); + final Object bm = context.lookup("java:comp/BeanManager"); + Assert.assertNotNull(bm); + } + + @Test + public void checkInitialContext() throws Exception { + Assert.assertNotNull(initialContext, "The InitialContext should have been injected"); + final Object bm = initialContext.lookup("java:comp/BeanManager"); + Assert.assertNotNull(bm); + } +} diff --git a/pom.xml b/pom.xml index 46cf48d03..f10169a77 100644 --- a/pom.xml +++ b/pom.xml @@ -146,6 +146,14 @@ + + integration-tests + + + bom + integration-tests + + release From 9ba4f6f2b8dc34feb94ccae9b9f75963f2614f65 Mon Sep 17 00:00:00 2001 From: Radoslav Husar Date: Tue, 9 Jul 2024 05:03:01 +0200 Subject: [PATCH 07/12] ARQ-2235 arquillian-bom should not include Maven artifacts not produced by this project (#575) * ARQ-2235 arquillian-bom should not include Maven artifacts not produced by this project - shrinkwrap projects. This otherwise causes dependency ordering headaches for consumers that import this pom into their dependencyManagement section, especially since the currently provided version lags behind upstream releases. * Fix bom description. * Fix BOM's issueManagement Jira tracker URL. --------- Co-authored-by: Scott M Stark --- bom/pom.xml | 43 ++++--------------------------------------- 1 file changed, 4 insertions(+), 39 deletions(-) diff --git a/bom/pom.xml b/bom/pom.xml index 83c0d9608..d4ad88a3b 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -11,11 +11,11 @@ pom Arquillian BOM http://arquillian.org - Arquillian Bill Of Material + Arquillian Bill Of Materials jira - http://jira.jboss.com/jira/browse/ARQ + https://issues.redhat.com/browse/ARQ @@ -42,18 +42,10 @@ - - 1.2.6 - 2.0.0 - 3.3.0 - jboss-releases-repository - https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/ - + https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/ jboss-snapshots-repository - https://repository.jboss.org/nexus/content/repositories/snapshots/ - - + https://repository.jboss.org/nexus/content/repositories/snapshots/ @@ -218,33 +210,6 @@ ${project.version} - - - org.jboss.shrinkwrap - shrinkwrap-bom - ${version.shrinkwrap_core} - pom - import - - - - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-bom - ${version.shrinkwrap_resolver} - pom - import - - - - - org.jboss.shrinkwrap.descriptors - shrinkwrap-descriptors-bom - ${version.shrinkwrap_descriptors} - pom - import - - From 8babc142ab30ac483a34899d135682b566e78137 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 22:30:12 -0500 Subject: [PATCH 08/12] build(deps): Bump version.junit5.platform from 1.10.1 to 1.10.3 (#570) Bumps `version.junit5.platform` from 1.10.1 to 1.10.3. Updates `org.junit.platform:junit-platform-engine` from 1.10.1 to 1.10.3 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/commits) Updates `org.junit.platform:junit-platform-testkit` from 1.10.1 to 1.10.3 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/commits) Updates `org.junit.platform:junit-platform-launcher` from 1.10.1 to 1.10.3 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/commits) --- updated-dependencies: - dependency-name: org.junit.platform:junit-platform-engine dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.junit.platform:junit-platform-testkit dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.junit.platform:junit-platform-launcher dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pom.xml b/build/pom.xml index 393e7c8a8..fc7508071 100644 --- a/build/pom.xml +++ b/build/pom.xml @@ -25,7 +25,7 @@ 1 4.13.2 - 1.10.1 + 1.10.3 5.10.3 4.10.0 7.5 From 6a270334305a60958d54b171063cb70ea72cbc1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 22:30:32 -0500 Subject: [PATCH 09/12] build(deps-dev): Bump org.testng:testng (#590) Bumps [org.testng:testng](https://github.com/cbeust/testng) from 7.5 to 7.5.1. - [Release notes](https://github.com/cbeust/testng/releases) - [Changelog](https://github.com/testng-team/testng/blob/master/CHANGES.txt) - [Commits](https://github.com/cbeust/testng/compare/7.5...7.5.1) --- updated-dependencies: - dependency-name: org.testng:testng dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- integration-tests/testng-tests/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/testng-tests/pom.xml b/integration-tests/testng-tests/pom.xml index 53b151878..c024d8988 100644 --- a/integration-tests/testng-tests/pom.xml +++ b/integration-tests/testng-tests/pom.xml @@ -33,7 +33,7 @@ Arquillian Core: TestNG Integration Tests - 7.5 + 7.5.1 From 578b77e463090a994c37e8a693e6d955f334142a Mon Sep 17 00:00:00 2001 From: Scott M Stark Date: Mon, 8 Jul 2024 22:51:12 -0600 Subject: [PATCH 10/12] [maven-release-plugin] prepare release 1.9.0.Final --- bom/pom.xml | 4 ++-- build/pom.xml | 2 +- config/api/pom.xml | 2 +- config/impl-base/pom.xml | 2 +- config/pom.xml | 2 +- config/spi/pom.xml | 2 +- container/impl-base/pom.xml | 2 +- container/pom.xml | 2 +- container/spi/pom.xml | 2 +- container/test-api/pom.xml | 2 +- container/test-impl-base/pom.xml | 2 +- container/test-spi/pom.xml | 2 +- core/api/pom.xml | 2 +- core/impl-base/pom.xml | 2 +- core/pom.xml | 2 +- core/spi/pom.xml | 2 +- junit/container/pom.xml | 2 +- junit/core/pom.xml | 2 +- junit/pom.xml | 2 +- junit/standalone/pom.xml | 2 +- junit5/container/pom.xml | 2 +- junit5/core/pom.xml | 2 +- junit5/pom.xml | 2 +- pom.xml | 4 ++-- protocols/jmx/pom.xml | 2 +- protocols/pom.xml | 2 +- protocols/servlet/pom.xml | 2 +- test/api/pom.xml | 2 +- test/impl-base/pom.xml | 2 +- test/pom.xml | 2 +- test/spi/pom.xml | 2 +- testenrichers/cdi/pom.xml | 2 +- testenrichers/ejb/pom.xml | 2 +- testenrichers/initialcontext/pom.xml | 2 +- testenrichers/pom.xml | 2 +- testenrichers/resource/pom.xml | 2 +- testng/container/pom.xml | 2 +- testng/core/pom.xml | 2 +- testng/pom.xml | 2 +- testng/standalone/pom.xml | 2 +- 40 files changed, 42 insertions(+), 42 deletions(-) diff --git a/bom/pom.xml b/bom/pom.xml index d4ad88a3b..a2e926c2b 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -7,7 +7,7 @@ org.jboss.arquillian arquillian-bom - 1.9.0.Final-SNAPSHOT + 1.9.0.Final pom Arquillian BOM http://arquillian.org @@ -29,7 +29,7 @@ scm:git:git://git@github.com:arquillian/arquillian-core.git scm:git:ssh://github.com/arquillian/arquillian-core.git git://github.com/arquillian/arquillian-core.git - HEAD + 1.9.0.Final diff --git a/build/pom.xml b/build/pom.xml index fc7508071..a16edc50a 100644 --- a/build/pom.xml +++ b/build/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../pom.xml diff --git a/config/api/pom.xml b/config/api/pom.xml index e0b951cb7..0de280214 100644 --- a/config/api/pom.xml +++ b/config/api/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/config/impl-base/pom.xml b/config/impl-base/pom.xml index a5c36aa2b..d7bd1c82e 100644 --- a/config/impl-base/pom.xml +++ b/config/impl-base/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/config/pom.xml b/config/pom.xml index ad12a2653..db1248a1a 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final-SNAPSHOT + 1.9.0.Final diff --git a/config/spi/pom.xml b/config/spi/pom.xml index 31272b9e1..c853b9072 100644 --- a/config/spi/pom.xml +++ b/config/spi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/container/impl-base/pom.xml b/container/impl-base/pom.xml index a1d7ffda2..9e981632b 100644 --- a/container/impl-base/pom.xml +++ b/container/impl-base/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/container/pom.xml b/container/pom.xml index 2f5c30058..a15f1d4ad 100644 --- a/container/pom.xml +++ b/container/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final-SNAPSHOT + 1.9.0.Final diff --git a/container/spi/pom.xml b/container/spi/pom.xml index 609105c55..32943e1c3 100644 --- a/container/spi/pom.xml +++ b/container/spi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/container/test-api/pom.xml b/container/test-api/pom.xml index e14b65a9e..bb898e120 100644 --- a/container/test-api/pom.xml +++ b/container/test-api/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/container/test-impl-base/pom.xml b/container/test-impl-base/pom.xml index ab4ce402e..1b290cb97 100644 --- a/container/test-impl-base/pom.xml +++ b/container/test-impl-base/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/container/test-spi/pom.xml b/container/test-spi/pom.xml index e436c5313..a6d711c0f 100644 --- a/container/test-spi/pom.xml +++ b/container/test-spi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/core/api/pom.xml b/core/api/pom.xml index b54db164e..63d5fb3fe 100644 --- a/core/api/pom.xml +++ b/core/api/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/core/impl-base/pom.xml b/core/impl-base/pom.xml index 9734a57b4..d24903a0f 100644 --- a/core/impl-base/pom.xml +++ b/core/impl-base/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/core/pom.xml b/core/pom.xml index 58bb9fe23..51f5f2636 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final-SNAPSHOT + 1.9.0.Final diff --git a/core/spi/pom.xml b/core/spi/pom.xml index 0ada712b0..ba863a94f 100644 --- a/core/spi/pom.xml +++ b/core/spi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/junit/container/pom.xml b/junit/container/pom.xml index a13e228cf..bfd5a8c84 100644 --- a/junit/container/pom.xml +++ b/junit/container/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/junit/core/pom.xml b/junit/core/pom.xml index aadff9bb0..891f5103f 100644 --- a/junit/core/pom.xml +++ b/junit/core/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/junit/pom.xml b/junit/pom.xml index 38ef8a0cd..96fb38c22 100644 --- a/junit/pom.xml +++ b/junit/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final-SNAPSHOT + 1.9.0.Final diff --git a/junit/standalone/pom.xml b/junit/standalone/pom.xml index d7aa950ac..44091e068 100644 --- a/junit/standalone/pom.xml +++ b/junit/standalone/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/junit5/container/pom.xml b/junit5/container/pom.xml index 15f116dd2..7a4fba606 100644 --- a/junit5/container/pom.xml +++ b/junit5/container/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/junit5/core/pom.xml b/junit5/core/pom.xml index a5b57c900..97ecb2edf 100644 --- a/junit5/core/pom.xml +++ b/junit5/core/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/junit5/pom.xml b/junit5/pom.xml index 6955f5c0e..23261a00c 100644 --- a/junit5/pom.xml +++ b/junit5/pom.xml @@ -4,7 +4,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final-SNAPSHOT + 1.9.0.Final diff --git a/pom.xml b/pom.xml index f10169a77..2c587be21 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final-SNAPSHOT + 1.9.0.Final pom Arquillian Aggregator http://arquillian.org @@ -53,7 +53,7 @@ scm:git:git://git@github.com:arquillian/arquillian-core.git scm:git:ssh://github.com/arquillian/arquillian-core.git git://github.com/arquillian/arquillian-core.git - HEAD + 1.9.0.Final diff --git a/protocols/jmx/pom.xml b/protocols/jmx/pom.xml index f4021674e..933be94fc 100644 --- a/protocols/jmx/pom.xml +++ b/protocols/jmx/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/protocols/pom.xml b/protocols/pom.xml index ec49227db..26a4ee93e 100644 --- a/protocols/pom.xml +++ b/protocols/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final-SNAPSHOT + 1.9.0.Final diff --git a/protocols/servlet/pom.xml b/protocols/servlet/pom.xml index 309388bfc..c29be10c4 100644 --- a/protocols/servlet/pom.xml +++ b/protocols/servlet/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/test/api/pom.xml b/test/api/pom.xml index 89fb7fc2d..5d641835d 100644 --- a/test/api/pom.xml +++ b/test/api/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/test/impl-base/pom.xml b/test/impl-base/pom.xml index 10ffdf71d..30c57b365 100644 --- a/test/impl-base/pom.xml +++ b/test/impl-base/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/test/pom.xml b/test/pom.xml index fe45dc6c4..16544d923 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final-SNAPSHOT + 1.9.0.Final diff --git a/test/spi/pom.xml b/test/spi/pom.xml index 7c9ba76ea..b5a33a921 100644 --- a/test/spi/pom.xml +++ b/test/spi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/testenrichers/cdi/pom.xml b/testenrichers/cdi/pom.xml index 107f02825..13aec1b1b 100644 --- a/testenrichers/cdi/pom.xml +++ b/testenrichers/cdi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/testenrichers/ejb/pom.xml b/testenrichers/ejb/pom.xml index 38b95b024..e1254a2d0 100644 --- a/testenrichers/ejb/pom.xml +++ b/testenrichers/ejb/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/testenrichers/initialcontext/pom.xml b/testenrichers/initialcontext/pom.xml index b45eb869f..a2c0cd6b2 100644 --- a/testenrichers/initialcontext/pom.xml +++ b/testenrichers/initialcontext/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/testenrichers/pom.xml b/testenrichers/pom.xml index 374f954eb..0e2efba22 100644 --- a/testenrichers/pom.xml +++ b/testenrichers/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final-SNAPSHOT + 1.9.0.Final diff --git a/testenrichers/resource/pom.xml b/testenrichers/resource/pom.xml index 8cb6b7721..56825f2ce 100644 --- a/testenrichers/resource/pom.xml +++ b/testenrichers/resource/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/testng/container/pom.xml b/testng/container/pom.xml index 31de438e0..b954c4e27 100644 --- a/testng/container/pom.xml +++ b/testng/container/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/testng/core/pom.xml b/testng/core/pom.xml index 27b957822..cb6896a41 100644 --- a/testng/core/pom.xml +++ b/testng/core/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml diff --git a/testng/pom.xml b/testng/pom.xml index 88b330b44..09b396e66 100644 --- a/testng/pom.xml +++ b/testng/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final-SNAPSHOT + 1.9.0.Final diff --git a/testng/standalone/pom.xml b/testng/standalone/pom.xml index 458d0dd53..ba66fd83b 100644 --- a/testng/standalone/pom.xml +++ b/testng/standalone/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final-SNAPSHOT + 1.9.0.Final ../../build/pom.xml From 513b086903235e15cec5bad777707a9cdcffec5e Mon Sep 17 00:00:00 2001 From: Scott M Stark Date: Mon, 8 Jul 2024 22:51:12 -0600 Subject: [PATCH 11/12] [maven-release-plugin] prepare for next development iteration --- bom/pom.xml | 4 ++-- build/pom.xml | 2 +- config/api/pom.xml | 2 +- config/impl-base/pom.xml | 2 +- config/pom.xml | 2 +- config/spi/pom.xml | 2 +- container/impl-base/pom.xml | 2 +- container/pom.xml | 2 +- container/spi/pom.xml | 2 +- container/test-api/pom.xml | 2 +- container/test-impl-base/pom.xml | 2 +- container/test-spi/pom.xml | 2 +- core/api/pom.xml | 2 +- core/impl-base/pom.xml | 2 +- core/pom.xml | 2 +- core/spi/pom.xml | 2 +- junit/container/pom.xml | 2 +- junit/core/pom.xml | 2 +- junit/pom.xml | 2 +- junit/standalone/pom.xml | 2 +- junit5/container/pom.xml | 2 +- junit5/core/pom.xml | 2 +- junit5/pom.xml | 2 +- pom.xml | 4 ++-- protocols/jmx/pom.xml | 2 +- protocols/pom.xml | 2 +- protocols/servlet/pom.xml | 2 +- test/api/pom.xml | 2 +- test/impl-base/pom.xml | 2 +- test/pom.xml | 2 +- test/spi/pom.xml | 2 +- testenrichers/cdi/pom.xml | 2 +- testenrichers/ejb/pom.xml | 2 +- testenrichers/initialcontext/pom.xml | 2 +- testenrichers/pom.xml | 2 +- testenrichers/resource/pom.xml | 2 +- testng/container/pom.xml | 2 +- testng/core/pom.xml | 2 +- testng/pom.xml | 2 +- testng/standalone/pom.xml | 2 +- 40 files changed, 42 insertions(+), 42 deletions(-) diff --git a/bom/pom.xml b/bom/pom.xml index a2e926c2b..df13daca4 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -7,7 +7,7 @@ org.jboss.arquillian arquillian-bom - 1.9.0.Final + 1.9.1.Final-SNAPSHOT pom Arquillian BOM http://arquillian.org @@ -29,7 +29,7 @@ scm:git:git://git@github.com:arquillian/arquillian-core.git scm:git:ssh://github.com/arquillian/arquillian-core.git git://github.com/arquillian/arquillian-core.git - 1.9.0.Final + HEAD diff --git a/build/pom.xml b/build/pom.xml index a16edc50a..b31e96f2b 100644 --- a/build/pom.xml +++ b/build/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../pom.xml diff --git a/config/api/pom.xml b/config/api/pom.xml index 0de280214..a3deac5b1 100644 --- a/config/api/pom.xml +++ b/config/api/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/config/impl-base/pom.xml b/config/impl-base/pom.xml index d7bd1c82e..b507a47db 100644 --- a/config/impl-base/pom.xml +++ b/config/impl-base/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/config/pom.xml b/config/pom.xml index db1248a1a..13b8eb9ba 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final + 1.9.1.Final-SNAPSHOT diff --git a/config/spi/pom.xml b/config/spi/pom.xml index c853b9072..03f022cf6 100644 --- a/config/spi/pom.xml +++ b/config/spi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/container/impl-base/pom.xml b/container/impl-base/pom.xml index 9e981632b..f93d28b32 100644 --- a/container/impl-base/pom.xml +++ b/container/impl-base/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/container/pom.xml b/container/pom.xml index a15f1d4ad..162b0471c 100644 --- a/container/pom.xml +++ b/container/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final + 1.9.1.Final-SNAPSHOT diff --git a/container/spi/pom.xml b/container/spi/pom.xml index 32943e1c3..2b2fac9a4 100644 --- a/container/spi/pom.xml +++ b/container/spi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/container/test-api/pom.xml b/container/test-api/pom.xml index bb898e120..094e00c70 100644 --- a/container/test-api/pom.xml +++ b/container/test-api/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/container/test-impl-base/pom.xml b/container/test-impl-base/pom.xml index 1b290cb97..165b373ba 100644 --- a/container/test-impl-base/pom.xml +++ b/container/test-impl-base/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/container/test-spi/pom.xml b/container/test-spi/pom.xml index a6d711c0f..468293b21 100644 --- a/container/test-spi/pom.xml +++ b/container/test-spi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/core/api/pom.xml b/core/api/pom.xml index 63d5fb3fe..9792df6d1 100644 --- a/core/api/pom.xml +++ b/core/api/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/core/impl-base/pom.xml b/core/impl-base/pom.xml index d24903a0f..5ff78df93 100644 --- a/core/impl-base/pom.xml +++ b/core/impl-base/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/core/pom.xml b/core/pom.xml index 51f5f2636..c0e052820 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final + 1.9.1.Final-SNAPSHOT diff --git a/core/spi/pom.xml b/core/spi/pom.xml index ba863a94f..e2fa80c56 100644 --- a/core/spi/pom.xml +++ b/core/spi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/junit/container/pom.xml b/junit/container/pom.xml index bfd5a8c84..3553c032a 100644 --- a/junit/container/pom.xml +++ b/junit/container/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/junit/core/pom.xml b/junit/core/pom.xml index 891f5103f..6301ecb02 100644 --- a/junit/core/pom.xml +++ b/junit/core/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/junit/pom.xml b/junit/pom.xml index 96fb38c22..66642b278 100644 --- a/junit/pom.xml +++ b/junit/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final + 1.9.1.Final-SNAPSHOT diff --git a/junit/standalone/pom.xml b/junit/standalone/pom.xml index 44091e068..7e218fdef 100644 --- a/junit/standalone/pom.xml +++ b/junit/standalone/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/junit5/container/pom.xml b/junit5/container/pom.xml index 7a4fba606..7775c0a9e 100644 --- a/junit5/container/pom.xml +++ b/junit5/container/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/junit5/core/pom.xml b/junit5/core/pom.xml index 97ecb2edf..27208b4a0 100644 --- a/junit5/core/pom.xml +++ b/junit5/core/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/junit5/pom.xml b/junit5/pom.xml index 23261a00c..b196d4d5f 100644 --- a/junit5/pom.xml +++ b/junit5/pom.xml @@ -4,7 +4,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final + 1.9.1.Final-SNAPSHOT diff --git a/pom.xml b/pom.xml index 2c587be21..5d5d7f545 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final + 1.9.1.Final-SNAPSHOT pom Arquillian Aggregator http://arquillian.org @@ -53,7 +53,7 @@ scm:git:git://git@github.com:arquillian/arquillian-core.git scm:git:ssh://github.com/arquillian/arquillian-core.git git://github.com/arquillian/arquillian-core.git - 1.9.0.Final + HEAD diff --git a/protocols/jmx/pom.xml b/protocols/jmx/pom.xml index 933be94fc..2faa172ad 100644 --- a/protocols/jmx/pom.xml +++ b/protocols/jmx/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/protocols/pom.xml b/protocols/pom.xml index 26a4ee93e..1097d3708 100644 --- a/protocols/pom.xml +++ b/protocols/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final + 1.9.1.Final-SNAPSHOT diff --git a/protocols/servlet/pom.xml b/protocols/servlet/pom.xml index c29be10c4..406c9774a 100644 --- a/protocols/servlet/pom.xml +++ b/protocols/servlet/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/test/api/pom.xml b/test/api/pom.xml index 5d641835d..bf811ec66 100644 --- a/test/api/pom.xml +++ b/test/api/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/test/impl-base/pom.xml b/test/impl-base/pom.xml index 30c57b365..a8c0aa7b5 100644 --- a/test/impl-base/pom.xml +++ b/test/impl-base/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/test/pom.xml b/test/pom.xml index 16544d923..2b4fcbf48 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final + 1.9.1.Final-SNAPSHOT diff --git a/test/spi/pom.xml b/test/spi/pom.xml index b5a33a921..4bd51745e 100644 --- a/test/spi/pom.xml +++ b/test/spi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/testenrichers/cdi/pom.xml b/testenrichers/cdi/pom.xml index 13aec1b1b..2c3972165 100644 --- a/testenrichers/cdi/pom.xml +++ b/testenrichers/cdi/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/testenrichers/ejb/pom.xml b/testenrichers/ejb/pom.xml index e1254a2d0..80d341614 100644 --- a/testenrichers/ejb/pom.xml +++ b/testenrichers/ejb/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/testenrichers/initialcontext/pom.xml b/testenrichers/initialcontext/pom.xml index a2c0cd6b2..bbc2bc322 100644 --- a/testenrichers/initialcontext/pom.xml +++ b/testenrichers/initialcontext/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/testenrichers/pom.xml b/testenrichers/pom.xml index 0e2efba22..a3e49003e 100644 --- a/testenrichers/pom.xml +++ b/testenrichers/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final + 1.9.1.Final-SNAPSHOT diff --git a/testenrichers/resource/pom.xml b/testenrichers/resource/pom.xml index 56825f2ce..50b443828 100644 --- a/testenrichers/resource/pom.xml +++ b/testenrichers/resource/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/testng/container/pom.xml b/testng/container/pom.xml index b954c4e27..aea27f41f 100644 --- a/testng/container/pom.xml +++ b/testng/container/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/testng/core/pom.xml b/testng/core/pom.xml index cb6896a41..62638751b 100644 --- a/testng/core/pom.xml +++ b/testng/core/pom.xml @@ -5,7 +5,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml diff --git a/testng/pom.xml b/testng/pom.xml index 09b396e66..ec90bf93a 100644 --- a/testng/pom.xml +++ b/testng/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-parent - 1.9.0.Final + 1.9.1.Final-SNAPSHOT diff --git a/testng/standalone/pom.xml b/testng/standalone/pom.xml index ba66fd83b..c3bbc4b6e 100644 --- a/testng/standalone/pom.xml +++ b/testng/standalone/pom.xml @@ -6,7 +6,7 @@ org.jboss.arquillian arquillian-build - 1.9.0.Final + 1.9.1.Final-SNAPSHOT ../../build/pom.xml From 85c2c3a9ebc186ba24362bcb43361472c4f8dd86 Mon Sep 17 00:00:00 2001 From: lprimak Date: Tue, 2 Jul 2024 17:38:58 -0500 Subject: [PATCH 12/12] enh(integration-tests): added integration tests for lifecycle methods --- junit5/integration-test/pom.xml | 237 ++++++++++++++++++ .../junit5/lifecycle/FileWriterExtension.java | 122 +++++++++ .../arquillian/junit5/lifecycle/Greeter.java | 34 +++ .../lifecycle/LifecycleMethodsTestCase.java | 98 ++++++++ junit5/pom.xml | 12 + 5 files changed, 503 insertions(+) create mode 100644 junit5/integration-test/pom.xml create mode 100644 junit5/integration-test/src/test/java/org/jboss/arquillian/junit5/lifecycle/FileWriterExtension.java create mode 100644 junit5/integration-test/src/test/java/org/jboss/arquillian/junit5/lifecycle/Greeter.java create mode 100644 junit5/integration-test/src/test/java/org/jboss/arquillian/junit5/lifecycle/LifecycleMethodsTestCase.java diff --git a/junit5/integration-test/pom.xml b/junit5/integration-test/pom.xml new file mode 100644 index 000000000..aaa624984 --- /dev/null +++ b/junit5/integration-test/pom.xml @@ -0,0 +1,237 @@ + + + 4.0.0 + + org.jboss.arquillian.junit5 + arquillian-junit5-integration-test + + + org.jboss.arquillian + 1.8.2.Final-SNAPSHOT + arquillian-build + ../../build + + + + UTF-8 + 11 + ${jdk.version} + ${jdk.version} + ${jdk.version} + ${skipITs} + 6.2024.6 + 1.8.1.Final + + + Arquillian JUnit 5 Container Integration Test + + + + org.junit.jupiter + junit-jupiter-api + test + + + + org.jboss.arquillian.junit5 + arquillian-junit5-container + ${project.version} + test + + + + jakarta.inject + jakarta.inject-api + 2.0.1 + provided + + + jakarta.enterprise + jakarta.enterprise.cdi-api + 4.0.1 + provided + + + jakarta.activation + jakarta.activation-api + 2.1.0 + provided + + + + + fish.payara.arquillian + arquillian-payara-server-remote + 3.0 + test + + + org.jboss.arquillian.testenricher + * + + + org.jboss.arquillian.protocol + * + + + org.jboss.arquillian.container + * + + + + + org.jboss.arquillian.container + arquillian-container-spi + ${project.version} + test + + + org.jboss.arquillian.testenricher + arquillian-testenricher-cdi-jakarta + ${jakartaArquillianDependencies} + test + + + org.jboss.arquillian.testenricher + arquillian-testenricher-ejb-jakarta + ${jakartaArquillianDependencies} + test + + + org.jboss.arquillian.testenricher + arquillian-testenricher-initialcontext + ${project.version} + test + + + org.jboss.arquillian.testenricher + arquillian-testenricher-resource-jakarta + ${jakartaArquillianDependencies} + test + + + org.jboss.arquillian.protocol + arquillian-protocol-servlet-jakarta + ${jakartaArquillianDependencies} + test + + + + + + + + maven-surefire-plugin + + + default-test + none + + + + + maven-failsafe-plugin + + + + + maven-dependency-plugin + 3.7.1 + + + pre-integration-test + + unpack + + + + + false + ${basedir}/target + ${basedir}/target/dependency-maven-plugin-markers + + + fish.payara.distributions + payara + ${payara.version} + zip + + + ${payara.start.skip} + + + + + + org.codehaus.mojo + exec-maven-plugin + + + start-domain + pre-integration-test + + + start-domain + + + + exec + + + + stop-domain + post-integration-test + + + stop-domain + + + + exec + + + + + + org.apache.maven.plugins + maven-jar-plugin + + true + + + + + + + + maven-failsafe-plugin + 3.3.0 + + + integration-test + + integration-test + verify + + + + + + **/*TestCase.java + + + + + org.codehaus.mojo + exec-maven-plugin + 3.3.0 + + ${basedir}/target/payara6/bin/asadmin + ${payara.start.skip} + + + + + + diff --git a/junit5/integration-test/src/test/java/org/jboss/arquillian/junit5/lifecycle/FileWriterExtension.java b/junit5/integration-test/src/test/java/org/jboss/arquillian/junit5/lifecycle/FileWriterExtension.java new file mode 100644 index 000000000..cabccb5fb --- /dev/null +++ b/junit5/integration-test/src/test/java/org/jboss/arquillian/junit5/lifecycle/FileWriterExtension.java @@ -0,0 +1,122 @@ +/* + * Copyright 2021 JBoss by Red Hat. + * + * 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.junit5.lifecycle; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.extension.BeforeAllCallback; +import org.junit.jupiter.api.extension.ExtensionContext; + +/** + * + * @author lprimak + */ +public class FileWriterExtension implements BeforeAllCallback, ExtensionContext.Store.CloseableResource { + private static Path TMP_FILE_PATH; + static final String TMP_FILE_ASSET_NAME = "temporaryFileAsset"; + + enum RunsWhere { + CLIENT, + SERVER, + } + + @Override + public void beforeAll(ExtensionContext extensionContext) throws Exception { + if (!isRunningOnServer()) { + Path tempDir = Files.createTempDirectory("arquillianLifecycleTest"); + initTmpFileName(tempDir); + assertTrue(tempDir.toFile().delete(), "Cleanup Failed"); + createTmpFile(); + } + extensionContext.getRoot().getStore(ExtensionContext.Namespace.GLOBAL).put(this.getClass().getName(), this); + } + + @Override + public void close() throws Throwable { + if (isRunningOnServer()) { + return; + } + String contents; + try (FileReader fileReader = new FileReader(getTmpFilePath().toFile())) { + char[] buf = new char[1000]; + int length = fileReader.read(buf); + contents = new String(buf, 0, length - 1); + } + Path tempDir = getTmpFilePath().getParent(); + Files.walk(tempDir).map(Path::toFile).forEach(File::delete); + assertTrue(tempDir.toFile().delete(), "Cleanup Failed"); + assertEquals("before_all,before_each,test_one,after_each,before_each,test_two,after_each,after_all", contents); + } + + static void initTmpFileName(Path tmpDirBase) { + TMP_FILE_PATH = tmpDirBase.getParent().resolve( + tmpDirBase.getFileName() + "-arquillianLifecycleTest") + .resolve("lifecycleOutput"); + } + + void createTmpFile() throws IOException { + TMP_FILE_PATH.getParent().toFile().mkdir(); + File tmpFile = TMP_FILE_PATH.toFile(); + tmpFile.delete(); + assertTrue(tmpFile.createNewFile(), "cannot create results file"); + } + + static Path getTmpFilePath() { + if (isRunningOnServer()) { + try (InputStream istrm = Thread.currentThread().getContextClassLoader() + .getResourceAsStream(TMP_FILE_ASSET_NAME)) { + return Paths.get(new BufferedReader(new InputStreamReader(istrm)).readLine()); + } catch (IOException ioe) { + throw new RuntimeException(ioe); + } + } else { + return TMP_FILE_PATH; + } + } + + static void appendToFile(String str) { + try (FileWriter fw = new FileWriter(getTmpFilePath().toFile(), true)) { + fw.append(str + ","); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + } + + static void checkRunsWhere(RunsWhere expected) { + assertEquals(expected, isRunningOnServer() ? RunsWhere.SERVER : RunsWhere.CLIENT); + } + + static boolean isRunningOnServer() { + try { + new InitialContext().lookup("java:comp/env"); + return true; + } catch (NamingException ex) { + return false; + } + } +} diff --git a/junit5/integration-test/src/test/java/org/jboss/arquillian/junit5/lifecycle/Greeter.java b/junit5/integration-test/src/test/java/org/jboss/arquillian/junit5/lifecycle/Greeter.java new file mode 100644 index 000000000..92d231059 --- /dev/null +++ b/junit5/integration-test/src/test/java/org/jboss/arquillian/junit5/lifecycle/Greeter.java @@ -0,0 +1,34 @@ +/* + * Copyright 2021 JBoss by Red Hat. + * + * 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.junit5.lifecycle; + +import jakarta.enterprise.context.Dependent; +import java.io.PrintStream; + +/** + * + * @author lprimak + */ +@Dependent +public class Greeter { + public void greet(PrintStream to, String name) { + to.println(createGreeting(name)); + } + + public String createGreeting(String name) { + return "Hello, " + name + "!"; + } +} diff --git a/junit5/integration-test/src/test/java/org/jboss/arquillian/junit5/lifecycle/LifecycleMethodsTestCase.java b/junit5/integration-test/src/test/java/org/jboss/arquillian/junit5/lifecycle/LifecycleMethodsTestCase.java new file mode 100644 index 000000000..1e3f8cdf4 --- /dev/null +++ b/junit5/integration-test/src/test/java/org/jboss/arquillian/junit5/lifecycle/LifecycleMethodsTestCase.java @@ -0,0 +1,98 @@ +/* + * Copyright 2021 JBoss by Red Hat. + * + * 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.junit5.lifecycle; + +import jakarta.inject.Inject; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit5.ArquillianExtension; +import static org.jboss.arquillian.junit5.lifecycle.FileWriterExtension.RunsWhere.CLIENT; +import static org.jboss.arquillian.junit5.lifecycle.FileWriterExtension.RunsWhere.SERVER; +import static org.jboss.arquillian.junit5.lifecycle.FileWriterExtension.TMP_FILE_ASSET_NAME; +import static org.jboss.arquillian.junit5.lifecycle.FileWriterExtension.appendToFile; +import static org.jboss.arquillian.junit5.lifecycle.FileWriterExtension.checkRunsWhere; +import static org.jboss.arquillian.junit5.lifecycle.FileWriterExtension.getTmpFilePath; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +/** + * + * @author lprimak + */ +@ExtendWith(FileWriterExtension.class) +@ExtendWith(ArquillianExtension.class) +public class LifecycleMethodsTestCase { + @Inject + Greeter greeter; + + @Test + @Order(1) + void one() { + assertEquals("one", "one"); + appendToFile("test_one"); + checkRunsWhere(SERVER); + } + + @Test + @Order(2) + void should_create_greeting() { + assertEquals("Hello, Earthling!", greeter.createGreeting("Earthling")); + greeter.greet(System.out, "Earthling"); + appendToFile("test_two"); + checkRunsWhere(SERVER); + } + + @BeforeAll + static void beforeAll() { + appendToFile("before_all"); + checkRunsWhere(CLIENT); + } + + @BeforeEach + void beforeEach() { + appendToFile("before_each"); + checkRunsWhere(SERVER); + } + + @AfterEach + void afterEeach() { + appendToFile("after_each"); + checkRunsWhere(SERVER); + } + + @AfterAll + static void afterAll() { + appendToFile("after_all"); + checkRunsWhere(CLIENT); + } + + + @Deployment + static JavaArchive createDeployment() { + JavaArchive jar = ShrinkWrap.create(JavaArchive.class) + .addClass(FileWriterExtension.class) + .addAsResource(new StringAsset(getTmpFilePath().toString()), TMP_FILE_ASSET_NAME); + return jar; + } +} diff --git a/junit5/pom.xml b/junit5/pom.xml index b196d4d5f..87e09501f 100644 --- a/junit5/pom.xml +++ b/junit5/pom.xml @@ -29,4 +29,16 @@ container + + + activate-integration-tests + + [11,) + + + integration-test + + + +