From a07b29cd68c556a5e12bef544d69c08a1b1615b7 Mon Sep 17 00:00:00 2001 From: WolfgangHG Date: Wed, 16 Oct 2024 19:28:42 +0200 Subject: [PATCH 1/4] TomEE profile: switch to TomEE 10 M3, update wildfly-arquillian-container --- build/ftest-base/pom.xml | 43 ++++++++++++++++--- .../src/main/webapp/WEB-INF/beans.xml | 5 ++- .../jsf-ftest/src/main/webapp/WEB-INF/web.xml | 7 +-- .../jsf-ftest/src/main/webapp/index.xhtml | 6 +-- .../ftest/producer/TestJSFTestEnrichers.java | 3 ++ pom.xml | 8 +++- 6 files changed, 57 insertions(+), 15 deletions(-) diff --git a/build/ftest-base/pom.xml b/build/ftest-base/pom.xml index 13b82b5a..7a92d205 100644 --- a/build/ftest-base/pom.xml +++ b/build/ftest-base/pom.xml @@ -188,22 +188,53 @@ - - org.apache.tomee - arquillian-tomee-remote - ${version.tomee} - test - org.apache.tomcat tomcat-servlet-api provided + ${version.tomee.tomcat} + + + org.apache.tomee + arquillian-tomee-remote ${version.tomee} + test + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.5.0 + + + enforce-java + + enforce + + + + + 17 + + + + + + + + - + diff --git a/extension/jsf-ftest/src/main/webapp/WEB-INF/web.xml b/extension/jsf-ftest/src/main/webapp/WEB-INF/web.xml index a5482271..5f2bc87a 100644 --- a/extension/jsf-ftest/src/main/webapp/WEB-INF/web.xml +++ b/extension/jsf-ftest/src/main/webapp/WEB-INF/web.xml @@ -17,9 +17,10 @@ limitations under the License. --> - + diff --git a/extension/jsf-ftest/src/main/webapp/index.xhtml b/extension/jsf-ftest/src/main/webapp/index.xhtml index 08bcba4d..8d3bdc77 100644 --- a/extension/jsf-ftest/src/main/webapp/index.xhtml +++ b/extension/jsf-ftest/src/main/webapp/index.xhtml @@ -19,9 +19,9 @@ + xmlns:ui="jakarta.faces.facelets" + xmlns:h="jakarta.faces.html" + xmlns:f="jakarta.faces.core"> diff --git a/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFTestEnrichers.java b/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFTestEnrichers.java index 7baad93f..9ce82ab3 100644 --- a/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFTestEnrichers.java +++ b/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFTestEnrichers.java @@ -36,6 +36,7 @@ import org.jboss.arquillian.warp.jsf.AfterPhase; import org.jboss.arquillian.warp.jsf.BeforePhase; import org.jboss.arquillian.warp.jsf.Phase; +import org.jboss.arquillian.warp.jsf.ftest.cdi.CdiBean; import org.jboss.arquillian.warp.jsf.ftest.faces.FacesBean; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; @@ -59,6 +60,8 @@ public static WebArchive createDeployment() { return ShrinkWrap.create(WebArchive.class, "jsf-test.war") .addClasses(FacesBean.class) + //Not required for a successful unit test, but it is used on "index.xhtml". + .addClasses(CdiBean.class) .addAsWebResource(new File("src/main/webapp/index.xhtml")) .addAsWebResource(new File("src/main/webapp/templates/template.xhtml"), "templates/template.xhtml") .addAsWebInfResource(new File("src/main/webapp/WEB-INF/web.xml")) diff --git a/pom.xml b/pom.xml index bf7c0840..b00e5cc1 100644 --- a/pom.xml +++ b/pom.xml @@ -95,10 +95,14 @@ - 8.0.14 + 10.0.0-M3 + + 10.1.30 5.1.0 33.0.0.Final - 5.0.0.Final + 5.0.1.Final From 5a7bd4308a2ca669aae6ea5e73bc0eba129f7cb5 Mon Sep 17 00:00:00 2001 From: WolfgangHG Date: Wed, 16 Oct 2024 19:47:25 +0200 Subject: [PATCH 2/4] updated another web.xml to JakartaEE 10 --- ftest/src/main/webapp/WEB-INF/web-redirect.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ftest/src/main/webapp/WEB-INF/web-redirect.xml b/ftest/src/main/webapp/WEB-INF/web-redirect.xml index 653f1626..fbd492ad 100644 --- a/ftest/src/main/webapp/WEB-INF/web-redirect.xml +++ b/ftest/src/main/webapp/WEB-INF/web-redirect.xml @@ -17,9 +17,10 @@ limitations under the License. --> - + RedirectFilter From 757caadfea4d62e258b342f460143410e69ab806 Mon Sep 17 00:00:00 2001 From: WolfgangHG Date: Wed, 16 Oct 2024 21:09:26 +0200 Subject: [PATCH 3/4] exclude failing tests for TomEE, activate profile in CI --- .github/workflows/ci.yml | 8 ++++++-- .../jboss/arquillian/warp/jsf/ftest/BasicJsfTest.java | 11 +++++++++++ .../failure/TestInspectionFailurePropagation.java | 11 +++++++++++ .../warp/jsf/ftest/lifecycle/TestJsfLifecycle.java | 11 +++++++++++ .../jsf/ftest/producer/TestJSFInstanceProducers.java | 11 +++++++++++ .../jsf/ftest/producer/TestJSFResourceProviders.java | 11 +++++++++++ .../warp/jsf/ftest/producer/TestJSFTestEnrichers.java | 11 +++++++++++ 7 files changed, 72 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f700bb3..6c634b15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,12 @@ jobs: - wildfly-managed # TODO GlassFish 5 is not compatible with JDK 9 and newer # - glassfish-managed - # TODO Upgrade to compatible TomEE version - # - tomee-managed + - tomee-managed + exclude: + # TomEE 10 requires Java 17. + - os: ubuntu-latest + java: 11 + container: tomee-managed steps: - name: Checkout uses: actions/checkout@v3 diff --git a/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/BasicJsfTest.java b/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/BasicJsfTest.java index cb700fd4..c720533f 100644 --- a/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/BasicJsfTest.java +++ b/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/BasicJsfTest.java @@ -21,6 +21,7 @@ import static org.junit.Assert.assertEquals; import java.io.File; +import java.io.IOException; import java.net.URL; import java.time.Duration; import java.util.function.Function; @@ -41,6 +42,8 @@ import org.jboss.arquillian.warp.jsf.ftest.cdi.CdiBean; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.Assume; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.By; @@ -71,6 +74,14 @@ public static WebArchive createDeployment() { .addAsWebInfResource(new File("src/main/webapp/WEB-INF/faces-config.xml")); } + /**Exclude this test for TomEE as long as the HtmlUnit issue is not fixed, + * see https://github.com/arquillian/arquillian-extension-warp/issues/242 */ + @BeforeClass + public static void beforeClass() throws IOException, InterruptedException { + String tomEEHome = (String) System.getProperty("tomee.home"); + Assume.assumeTrue(tomEEHome == null || tomEEHome.length() == 0); + } + @Test public void test() { Warp diff --git a/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/failure/TestInspectionFailurePropagation.java b/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/failure/TestInspectionFailurePropagation.java index c46d97ca..d9291591 100644 --- a/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/failure/TestInspectionFailurePropagation.java +++ b/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/failure/TestInspectionFailurePropagation.java @@ -19,6 +19,7 @@ import static org.junit.Assert.fail; import java.io.File; +import java.io.IOException; import java.net.URL; import org.jboss.arquillian.container.test.api.Deployment; @@ -34,6 +35,8 @@ import org.jboss.arquillian.warp.servlet.BeforeServlet; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.Assume; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.WebDriver; @@ -60,6 +63,14 @@ public static WebArchive createDeployment() { .addAsWebInfResource(new File("src/main/webapp/WEB-INF/faces-config.xml")); } + /**Exclude this test for TomEE as long as the HtmlUnit issue is not fixed, + * see https://github.com/arquillian/arquillian-extension-warp/issues/242 */ + @BeforeClass + public static void beforeClass() throws IOException, InterruptedException { + String tomEEHome = (String) System.getProperty("tomee.home"); + Assume.assumeTrue(tomEEHome == null || tomEEHome.length() == 0); + } + @Test(expected = AssertionError.class) public void test() { Warp diff --git a/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/lifecycle/TestJsfLifecycle.java b/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/lifecycle/TestJsfLifecycle.java index 946319a2..477b11cf 100644 --- a/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/lifecycle/TestJsfLifecycle.java +++ b/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/lifecycle/TestJsfLifecycle.java @@ -17,6 +17,7 @@ package org.jboss.arquillian.warp.jsf.ftest.lifecycle; import java.io.File; +import java.io.IOException; import java.net.URL; import java.time.Duration; import java.util.function.Function; @@ -37,6 +38,8 @@ import org.jboss.arquillian.warp.servlet.BeforeServlet; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.Assume; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.By; @@ -66,6 +69,14 @@ public static WebArchive createDeployment() { .addAsWebInfResource(new File("src/main/webapp/WEB-INF/faces-config.xml")); } + /**Exclude this test for TomEE as long as the HtmlUnit issue is not fixed, + * see https://github.com/arquillian/arquillian-extension-warp/issues/242 */ + @BeforeClass + public static void beforeClass() throws IOException, InterruptedException { + String tomEEHome = (String) System.getProperty("tomee.home"); + Assume.assumeTrue(tomEEHome == null || tomEEHome.length() == 0); + } + @Test public void test() { diff --git a/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFInstanceProducers.java b/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFInstanceProducers.java index 08b3e4fa..8e3fda96 100644 --- a/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFInstanceProducers.java +++ b/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFInstanceProducers.java @@ -17,6 +17,7 @@ package org.jboss.arquillian.warp.jsf.ftest.producer; import java.io.File; +import java.io.IOException; import java.net.URL; import org.jboss.arquillian.container.test.api.Deployment; @@ -32,6 +33,8 @@ import org.jboss.arquillian.warp.jsf.ftest.cdi.CdiBean; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.Assume; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.WebDriver; @@ -60,6 +63,14 @@ public static WebArchive createDeployment() { .addAsServiceProvider(RemoteLoadableExtension.class, TestingExtension.class); } + /**Exclude this test for TomEE as long as the HtmlUnit issue is not fixed, + * see https://github.com/arquillian/arquillian-extension-warp/issues/242 */ + @BeforeClass + public static void beforeClass() throws IOException, InterruptedException { + String tomEEHome = (String) System.getProperty("tomee.home"); + Assume.assumeTrue(tomEEHome == null || tomEEHome.length() == 0); + } + @Test public void test() { Warp diff --git a/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFResourceProviders.java b/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFResourceProviders.java index da9d48c5..d369c4a9 100644 --- a/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFResourceProviders.java +++ b/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFResourceProviders.java @@ -19,6 +19,7 @@ import static org.junit.Assert.assertNotNull; import java.io.File; +import java.io.IOException; import java.net.URL; import jakarta.el.ELContext; @@ -52,6 +53,8 @@ import org.jboss.arquillian.warp.jsf.ftest.cdi.CdiBean; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.Assume; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.WebDriver; @@ -79,6 +82,14 @@ public static WebArchive createDeployment() { .addAsWebInfResource(new File("src/main/webapp/WEB-INF/faces-config.xml")); } + /**Exclude this test for TomEE as long as the HtmlUnit issue is not fixed, + * see https://github.com/arquillian/arquillian-extension-warp/issues/242 */ + @BeforeClass + public static void beforeClass() throws IOException, InterruptedException { + String tomEEHome = (String) System.getProperty("tomee.home"); + Assume.assumeTrue(tomEEHome == null || tomEEHome.length() == 0); + } + @Test public void test() { Warp diff --git a/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFTestEnrichers.java b/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFTestEnrichers.java index 9ce82ab3..c71b4c1c 100644 --- a/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFTestEnrichers.java +++ b/extension/jsf-ftest/src/test/java/org/jboss/arquillian/warp/jsf/ftest/producer/TestJSFTestEnrichers.java @@ -19,6 +19,7 @@ import static org.junit.Assert.assertEquals; import java.io.File; +import java.io.IOException; import java.net.URL; import jakarta.faces.event.PhaseId; @@ -40,6 +41,8 @@ import org.jboss.arquillian.warp.jsf.ftest.faces.FacesBean; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.WebArchive; +import org.junit.Assume; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.openqa.selenium.WebDriver; @@ -68,6 +71,14 @@ public static WebArchive createDeployment() { .addAsWebInfResource(new File("src/main/webapp/WEB-INF/faces-config.xml")); } + /**Exclude this test for TomEE as long as the HtmlUnit issue is not fixed, + * see https://github.com/arquillian/arquillian-extension-warp/issues/242 */ + @BeforeClass + public static void beforeClass() throws IOException, InterruptedException { + String tomEEHome = (String) System.getProperty("tomee.home"); + Assume.assumeTrue(tomEEHome == null || tomEEHome.length() == 0); + } + @Test public void test() { Warp From 4c246bf538317f11ce6c21d1fc4849bd10a9d88f Mon Sep 17 00:00:00 2001 From: WolfgangHG Date: Wed, 16 Oct 2024 21:11:51 +0200 Subject: [PATCH 4/4] fix syntax error in ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c634b15..3a57a010 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: - wildfly-managed # TODO GlassFish 5 is not compatible with JDK 9 and newer # - glassfish-managed - - tomee-managed + - tomee-managed exclude: # TomEE 10 requires Java 17. - os: ubuntu-latest