From 00660b7a2dab4043619ec70963d1d914e20d267b Mon Sep 17 00:00:00 2001 From: Manfred Riem Date: Tue, 26 Nov 2024 16:01:09 -0600 Subject: [PATCH 1/3] Fixes #4257 - Fix tests in test/server/wasp module (#4277) --- test/server/wasp/pom.xml | 2 ++ test/server/wasp/src/test/java/wasp/HelloTagJspIT.java | 2 -- test/server/wasp/src/test/java/wasp/HelloTld2JspIT.java | 2 -- test/server/wasp/src/test/java/wasp/HelloTldJspIT.java | 2 -- test/server/wasp/src/test/java/wasp/IndexJspIT.java | 3 --- 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/test/server/wasp/pom.xml b/test/server/wasp/pom.xml index 76308647f8..f778805bfa 100644 --- a/test/server/wasp/pom.xml +++ b/test/server/wasp/pom.xml @@ -104,6 +104,8 @@ maven-failsafe-plugin 1 + false + 100 ${httpPort} diff --git a/test/server/wasp/src/test/java/wasp/HelloTagJspIT.java b/test/server/wasp/src/test/java/wasp/HelloTagJspIT.java index e6a256cf86..3541116596 100644 --- a/test/server/wasp/src/test/java/wasp/HelloTagJspIT.java +++ b/test/server/wasp/src/test/java/wasp/HelloTagJspIT.java @@ -33,7 +33,6 @@ import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** @@ -48,7 +47,6 @@ class HelloTagJspIT { * * @throws Exception when a serious error occurs. */ - @Disabled @Test void testHelloTagJsp() throws Exception { HttpClient client = HttpClient.newHttpClient(); diff --git a/test/server/wasp/src/test/java/wasp/HelloTld2JspIT.java b/test/server/wasp/src/test/java/wasp/HelloTld2JspIT.java index 3db74772f7..af6cff0370 100644 --- a/test/server/wasp/src/test/java/wasp/HelloTld2JspIT.java +++ b/test/server/wasp/src/test/java/wasp/HelloTld2JspIT.java @@ -33,7 +33,6 @@ import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** @@ -48,7 +47,6 @@ class HelloTld2JspIT { * * @throws Exception when a serious error occurs. */ - @Disabled @Test void testHelloTld2Jsp() throws Exception { HttpClient client = HttpClient.newHttpClient(); diff --git a/test/server/wasp/src/test/java/wasp/HelloTldJspIT.java b/test/server/wasp/src/test/java/wasp/HelloTldJspIT.java index e046586f04..0ffc9e37fd 100644 --- a/test/server/wasp/src/test/java/wasp/HelloTldJspIT.java +++ b/test/server/wasp/src/test/java/wasp/HelloTldJspIT.java @@ -33,7 +33,6 @@ import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** @@ -48,7 +47,6 @@ class HelloTldJspIT { * * @throws Exception when a serious error occurs. */ - @Disabled @Test void testHelloTldJsp() throws Exception { HttpClient client = HttpClient.newHttpClient(); diff --git a/test/server/wasp/src/test/java/wasp/IndexJspIT.java b/test/server/wasp/src/test/java/wasp/IndexJspIT.java index 6e3372e0ed..a3a18a669d 100644 --- a/test/server/wasp/src/test/java/wasp/IndexJspIT.java +++ b/test/server/wasp/src/test/java/wasp/IndexJspIT.java @@ -34,7 +34,6 @@ import java.net.http.HttpResponse.BodyHandlers; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** @@ -49,7 +48,6 @@ class IndexJspIT { * * @throws Exception when a serious error occurs. */ - @Disabled @Test void testIndexJsp() throws Exception { HttpClient client = HttpClient.newHttpClient(); @@ -66,7 +64,6 @@ void testIndexJsp() throws Exception { * * @throws Exception when a serious error occurs. */ - @Disabled @Test void testIndexJsp2() throws Exception { HttpClient client = HttpClient.newHttpClient(); From d43ae99e991adcd367fb25c129a3e53e6eff67a3 Mon Sep 17 00:00:00 2001 From: Manfred Riem Date: Tue, 26 Nov 2024 16:35:51 -0600 Subject: [PATCH 2/3] Fixes #4258 - Fix tests in test/servlet/crac module (#4279) --- test/servlet/crac/pom.xml | 201 +++++++++--------- .../piranha/test/servlet/crac/CracBean.java} | 6 +- .../main/webapp/{hello.xhtml => crac.xhtml} | 7 +- .../piranha/test/servlet/crac/CracIT.java} | 4 +- 4 files changed, 110 insertions(+), 108 deletions(-) rename test/servlet/crac/src/main/java/{hello/HelloBean.java => cloud/piranha/test/servlet/crac/CracBean.java} (95%) rename test/servlet/crac/src/main/webapp/{hello.xhtml => crac.xhtml} (68%) rename test/servlet/crac/src/test/java/{hello/HelloIT.java => cloud/piranha/test/servlet/crac/CracIT.java} (97%) diff --git a/test/servlet/crac/pom.xml b/test/servlet/crac/pom.xml index 57580149df..3f2887d565 100644 --- a/test/servlet/crac/pom.xml +++ b/test/servlet/crac/pom.xml @@ -14,37 +14,33 @@ war Piranha - Test - Servlet - CRaC application - - ${project.version} - 6.0.0.Beta4 - 21 servlet UTF-8 - - 3.6.0 - 3.13.0 - 3.2.5 - 3.4.0 - + + + jakarta.enterprise + jakarta.enterprise.cdi-api + provided + + org.glassfish jakarta.faces - compile + runtime + + + cloud.piranha.extension + piranha-extension-weld + ${project.version} + runtime org.jboss.weld.servlet weld-servlet-shaded ${weld.version} - compile - - - - cloud.piranha.extension - piranha-extension-weld - ${piranha.version} runtime @@ -66,86 +62,95 @@ crac - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${java.version} - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - - integration-test - verify - - - - - 1 - - ${httpPort} - - - - - org.apache.maven.plugins - maven-war-plugin - - false - - - - org.codehaus.mojo - build-helper-maven-plugin - - - reserve-network-port - - reserve-network-port - - package + + + + unix + + + unix + + + + + + cloud.piranha.maven + piranha-maven-plugin + ${project.version} + + + pre-integration-test + pre-integration-test + + start + + + + post-integration-test + post-integration-test + + stop + + + - - httpPort - + servlet + ${httpPort} - - - - - + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.version} + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + integration-test + verify + + + + + 1 + + ${httpPort} + + + + + org.apache.maven.plugins + maven-war-plugin + + false + + + + org.codehaus.mojo + build-helper-maven-plugin + + + reserve-network-port + + reserve-network-port + + validate + + + httpPort + + + + + + + + + diff --git a/test/servlet/crac/src/main/java/hello/HelloBean.java b/test/servlet/crac/src/main/java/cloud/piranha/test/servlet/crac/CracBean.java similarity index 95% rename from test/servlet/crac/src/main/java/hello/HelloBean.java rename to test/servlet/crac/src/main/java/cloud/piranha/test/servlet/crac/CracBean.java index 51e1102152..d9b78f24ae 100644 --- a/test/servlet/crac/src/main/java/hello/HelloBean.java +++ b/test/servlet/crac/src/main/java/cloud/piranha/test/servlet/crac/CracBean.java @@ -25,14 +25,14 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package hello; +package cloud.piranha.test.servlet.crac; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Named; -@Named(value = "helloBean") +@Named(value = "cracBean") @RequestScoped -public class HelloBean { +public class CracBean { /** * Stores the 'Hello from CRaC!' message. diff --git a/test/servlet/crac/src/main/webapp/hello.xhtml b/test/servlet/crac/src/main/webapp/crac.xhtml similarity index 68% rename from test/servlet/crac/src/main/webapp/hello.xhtml rename to test/servlet/crac/src/main/webapp/crac.xhtml index 0dd605ba4a..8f3044520f 100644 --- a/test/servlet/crac/src/main/webapp/hello.xhtml +++ b/test/servlet/crac/src/main/webapp/crac.xhtml @@ -4,17 +4,14 @@ + xmlns:h="jakarta.faces.html"> Jakarta Faces application -
Jakarta Faces application
- +
diff --git a/test/servlet/crac/src/test/java/hello/HelloIT.java b/test/servlet/crac/src/test/java/cloud/piranha/test/servlet/crac/CracIT.java similarity index 97% rename from test/servlet/crac/src/test/java/hello/HelloIT.java rename to test/servlet/crac/src/test/java/cloud/piranha/test/servlet/crac/CracIT.java index 98650b1753..8cb5f8c6f9 100644 --- a/test/servlet/crac/src/test/java/hello/HelloIT.java +++ b/test/servlet/crac/src/test/java/cloud/piranha/test/servlet/crac/CracIT.java @@ -25,7 +25,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -package hello; +package cloud.piranha.test.servlet.crac; import java.net.URI; import java.net.http.HttpClient; @@ -38,7 +38,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -public class HelloIT { +public class CracIT { private String portNumber = System.getProperty("httpPort"); From 4f3198938ce3dea1e29d0abd09f4ceb330883aa3 Mon Sep 17 00:00:00 2001 From: Manfred Riem Date: Tue, 26 Nov 2024 17:05:56 -0600 Subject: [PATCH 3/3] Fixes #4271 - Update Testing with JUnit 5 and Playwright guide in dist/webprofile module (#4280) --- .../testing_with_junit5_and_playwright.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/webprofile/src/site/markdown/testing_with_junit5_and_playwright.md b/dist/webprofile/src/site/markdown/testing_with_junit5_and_playwright.md index 74defe2db3..4475542b11 100644 --- a/dist/webprofile/src/site/markdown/testing_with_junit5_and_playwright.md +++ b/dist/webprofile/src/site/markdown/testing_with_junit5_and_playwright.md @@ -27,21 +27,21 @@ create the ```pom.xml``` file with the content as below. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - cloud.piranha.guides.webprofile - playwright + cloud.piranha.dist.webprofile.guide + junit5-and-playwright 24.11.0-SNAPSHOT war Testing with JUnit 5 and Playwright 11.0.0-M4 21 - 5.10.0 - 3.11.0 - 3.1.2 + 5.11.3 + 3.13.0 + 3.5.2 3.4.0 webprofile - 23.9.0 - 1.38.0 + 24.11.0 + 1.48.0 UTF-8 @@ -80,7 +80,7 @@ create the ```pom.xml``` file with the content as below. playwright - cloud.piranha.maven.plugins + cloud.piranha.maven piranha-maven-plugin ${piranha.version}