You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2025/08/26 08:12:40 UTC
(myfaces) branch main updated: try to fix chromedriver + add some subfolder integration tests for extensionless mapping
This is an automated email from the ASF dual-hosted git repository.
tandraschko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/myfaces.git
The following commit(s) were added to refs/heads/main by this push:
new 3aa81c74f try to fix chromedriver + add some subfolder integration tests for extensionless mapping
3aa81c74f is described below
commit 3aa81c74f80622fcc8836f32666e43b1ad9e0c2c
Author: tandraschko <ta...@apache.org>
AuthorDate: Tue Aug 26 10:12:29 2025 +0200
try to fix chromedriver + add some subfolder integration tests for extensionless mapping
---
.../integrationtests/ajax/IntegrationTest.java | 5 +++
.../ajax/src/test/resources/arquillian.xml | 3 +-
.../core/integrationtests/IntegrationTest.java | 6 +++
.../src/test/resources/arquillian.xml | 5 +--
.../src/main/webapp/some-folder/bar.xhtml | 40 ++++++++++++++++++++
.../src/main/webapp/someFolder/bar.xhtml | 40 ++++++++++++++++++++
.../core/integrationtests/IntegrationTest.java | 43 ++++++++++++++++++++++
.../src/test/resources/arquillian.xml | 5 +--
.../core/integrationtests/IntegrationTest.java | 6 +++
.../exactMapping/src/test/resources/arquillian.xml | 5 +--
.../core/integrationtests/IntegrationTest.java | 6 +++
.../src/test/resources/arquillian.xml | 5 +--
.../core/integrationtests/IntegrationTest.java | 6 +++
.../src/test/resources/arquillian.xml | 5 +--
.../core/integrationtests/IntegrationTest.java | 6 +++
.../myfaces4623/src/test/resources/arquillian.xml | 5 +--
integration-tests/pom.xml | 7 ++++
.../core/integrationtests/IntegrationTest.java | 6 +++
.../src/test/resources/arquillian.xml | 5 +--
19 files changed, 186 insertions(+), 23 deletions(-)
diff --git a/integration-tests/ajax/src/test/java/org/apache/myfaces/core/integrationtests/ajax/IntegrationTest.java b/integration-tests/ajax/src/test/java/org/apache/myfaces/core/integrationtests/ajax/IntegrationTest.java
index 460bdd7e8..46a966192 100644
--- a/integration-tests/ajax/src/test/java/org/apache/myfaces/core/integrationtests/ajax/IntegrationTest.java
+++ b/integration-tests/ajax/src/test/java/org/apache/myfaces/core/integrationtests/ajax/IntegrationTest.java
@@ -90,6 +90,11 @@ public static WebArchive createDeployment()
@ArquillianResource
protected URL contextPath;
+ @org.junit.BeforeClass
+ public static void setupDriver()
+ {
+ io.github.bonigarcia.wdm.WebDriverManager.chromedriver().setup();
+ }
@After
public void after()
diff --git a/integration-tests/ajax/src/test/resources/arquillian.xml b/integration-tests/ajax/src/test/resources/arquillian.xml
index b472092b6..f3e40883d 100644
--- a/integration-tests/ajax/src/test/resources/arquillian.xml
+++ b/integration-tests/ajax/src/test/resources/arquillian.xml
@@ -23,8 +23,7 @@
<extension qualifier="webdriver">
<property name="browser">chromeHeadless</property>
- <property name="browserVersion">100</property>
- <property name="chromeDriverVersion">${chromeDriverVersion:}</property>
+ <property name="browserVersion">139.0</property>
</extension>
<container qualifier="tomcat" default="true">
diff --git a/integration-tests/autoLookupExpressionFactoryWithoutJSP/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java b/integration-tests/autoLookupExpressionFactoryWithoutJSP/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
index 0d40a8bce..794f648d1 100644
--- a/integration-tests/autoLookupExpressionFactoryWithoutJSP/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
+++ b/integration-tests/autoLookupExpressionFactoryWithoutJSP/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
@@ -71,6 +71,12 @@ public static WebArchive createDeployment()
@ArquillianResource
protected URL contextPath;
+ @org.junit.BeforeClass
+ public static void setupDriver()
+ {
+ io.github.bonigarcia.wdm.WebDriverManager.chromedriver().setup();
+ }
+
@Before
public void before()
{
diff --git a/integration-tests/autoLookupExpressionFactoryWithoutJSP/src/test/resources/arquillian.xml b/integration-tests/autoLookupExpressionFactoryWithoutJSP/src/test/resources/arquillian.xml
index b472092b6..ff8d63b3e 100644
--- a/integration-tests/autoLookupExpressionFactoryWithoutJSP/src/test/resources/arquillian.xml
+++ b/integration-tests/autoLookupExpressionFactoryWithoutJSP/src/test/resources/arquillian.xml
@@ -23,9 +23,8 @@
<extension qualifier="webdriver">
<property name="browser">chromeHeadless</property>
- <property name="browserVersion">100</property>
- <property name="chromeDriverVersion">${chromeDriverVersion:}</property>
- </extension>
+ <property name="browserVersion">139.0</property>
+ </extension>
<container qualifier="tomcat" default="true">
<configuration>
diff --git a/integration-tests/automaticExtensionlessMapping/src/main/webapp/some-folder/bar.xhtml b/integration-tests/automaticExtensionlessMapping/src/main/webapp/some-folder/bar.xhtml
new file mode 100644
index 000000000..e7f850848
--- /dev/null
+++ b/integration-tests/automaticExtensionlessMapping/src/main/webapp/some-folder/bar.xhtml
@@ -0,0 +1,40 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
+ xmlns:f="http://xmlns.jcp.org/jsf/core"
+ xmlns:jsf="http://xmlns.jcp.org/jsf"
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
+
+ <h:head>
+ <title>test</title>
+ <h:outputScript library="jakarta.faces" name="faces.js" />
+ </h:head>
+
+ <h:body>
+ <h:form id="form">
+ <h:link outcome="/foo.xhtml">Foo</h:link>
+ <h:link outcome="/someFolder/bar">Sub-Bar</h:link>
+ <h:link outcome="/someFolder/bar.xhtml">Sub-Bar</h:link>
+ </h:form>
+ </h:body>
+</html>
+
diff --git a/integration-tests/automaticExtensionlessMapping/src/main/webapp/someFolder/bar.xhtml b/integration-tests/automaticExtensionlessMapping/src/main/webapp/someFolder/bar.xhtml
new file mode 100644
index 000000000..5d52dd499
--- /dev/null
+++ b/integration-tests/automaticExtensionlessMapping/src/main/webapp/someFolder/bar.xhtml
@@ -0,0 +1,40 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+-->
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
+ xmlns:f="http://xmlns.jcp.org/jsf/core"
+ xmlns:jsf="http://xmlns.jcp.org/jsf"
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
+
+ <h:head>
+ <title>test</title>
+ <h:outputScript library="jakarta.faces" name="faces.js" />
+ </h:head>
+
+ <h:body>
+ <h:form id="form">
+ <h:link outcome="/foo.xhtml">Foo</h:link>
+ <h:link outcome="/some-folder/bar">Sub-Bar</h:link>
+ <h:link outcome="/some-folder/bar.xhtml">Sub-Bar</h:link>
+ </h:form>
+ </h:body>
+</html>
+
diff --git a/integration-tests/automaticExtensionlessMapping/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java b/integration-tests/automaticExtensionlessMapping/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
index 1cf406e54..5b2682977 100644
--- a/integration-tests/automaticExtensionlessMapping/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
+++ b/integration-tests/automaticExtensionlessMapping/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
@@ -71,6 +71,12 @@ public static WebArchive createDeployment()
@ArquillianResource
protected URL contextPath;
+ @org.junit.BeforeClass
+ public static void setupDriver()
+ {
+ io.github.bonigarcia.wdm.WebDriverManager.chromedriver().setup();
+ }
+
@Before
public void before()
{
@@ -116,6 +122,43 @@ public void bar()
Assert.assertTrue(webDriver.getPageSource().contains("/jakarta.faces.resource/faces.js.xhtml?ln=jakarta.faces"));
}
+ @Test
+ public void subfolder()
+ {
+ webDriver.get(contextPath + "some-folder/bar");
+
+ // check that URLs are rendered as exact mapping
+ Assert.assertTrue(webDriver.getPageSource().contains("/bar\""));
+
+ // check if served as non-exact-mapping
+ Assert.assertTrue(webDriver.getCurrentUrl().endsWith("some-folder/bar"));
+
+ Assert.assertTrue(webDriver.getPageSource().contains("/foo\""));
+ Assert.assertTrue(webDriver.getPageSource().contains("/someFolder/bar\""));
+ Assert.assertFalse(webDriver.getPageSource().contains("/someFolder/bar.xhtml\""));
+
+ // resources must NOT use exact mapping
+ Assert.assertTrue(webDriver.getPageSource().contains("/jakarta.faces.resource/faces.js.xhtml?ln=jakarta.faces"));
+ }
+
+ @Test
+ public void subfolder2()
+ {
+ webDriver.get(contextPath + "someFolder/bar");
+
+ // check that URLs are rendered as exact mapping
+ Assert.assertTrue(webDriver.getPageSource().contains("/bar\""));
+
+ // check if served as non-exact-mapping
+ Assert.assertTrue(webDriver.getCurrentUrl().endsWith("someFolder/bar"));
+
+ Assert.assertTrue(webDriver.getPageSource().contains("/foo\""));
+ Assert.assertTrue(webDriver.getPageSource().contains("/some-folder/bar\""));
+ Assert.assertFalse(webDriver.getPageSource().contains("/some-folder/bar.xhtml\""));
+
+ // resources must NOT use exact mapping
+ Assert.assertTrue(webDriver.getPageSource().contains("/jakarta.faces.resource/faces.js.xhtml?ln=jakarta.faces"));
+ }
/*
* MYFACES-4644: Ensure Programmatic Views can be accesssed without extensions
diff --git a/integration-tests/automaticExtensionlessMapping/src/test/resources/arquillian.xml b/integration-tests/automaticExtensionlessMapping/src/test/resources/arquillian.xml
index b472092b6..ff8d63b3e 100644
--- a/integration-tests/automaticExtensionlessMapping/src/test/resources/arquillian.xml
+++ b/integration-tests/automaticExtensionlessMapping/src/test/resources/arquillian.xml
@@ -23,9 +23,8 @@
<extension qualifier="webdriver">
<property name="browser">chromeHeadless</property>
- <property name="browserVersion">100</property>
- <property name="chromeDriverVersion">${chromeDriverVersion:}</property>
- </extension>
+ <property name="browserVersion">139.0</property>
+ </extension>
<container qualifier="tomcat" default="true">
<configuration>
diff --git a/integration-tests/exactMapping/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java b/integration-tests/exactMapping/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
index 4372cc4d7..15dee1585 100644
--- a/integration-tests/exactMapping/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
+++ b/integration-tests/exactMapping/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
@@ -77,6 +77,12 @@ public static WebArchive createDeployment()
@ArquillianResource
protected URL contextPath;
+ @org.junit.BeforeClass
+ public static void setupDriver()
+ {
+ io.github.bonigarcia.wdm.WebDriverManager.chromedriver().setup();
+ }
+
@Before
public void before()
{
diff --git a/integration-tests/exactMapping/src/test/resources/arquillian.xml b/integration-tests/exactMapping/src/test/resources/arquillian.xml
index b472092b6..ff8d63b3e 100644
--- a/integration-tests/exactMapping/src/test/resources/arquillian.xml
+++ b/integration-tests/exactMapping/src/test/resources/arquillian.xml
@@ -23,9 +23,8 @@
<extension qualifier="webdriver">
<property name="browser">chromeHeadless</property>
- <property name="browserVersion">100</property>
- <property name="chromeDriverVersion">${chromeDriverVersion:}</property>
- </extension>
+ <property name="browserVersion">139.0</property>
+ </extension>
<container qualifier="tomcat" default="true">
<configuration>
diff --git a/integration-tests/faceletToXhtmlMapping/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java b/integration-tests/faceletToXhtmlMapping/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
index a3d8caefa..a55e73b4d 100644
--- a/integration-tests/faceletToXhtmlMapping/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
+++ b/integration-tests/faceletToXhtmlMapping/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
@@ -71,6 +71,12 @@ public static WebArchive createDeployment()
@ArquillianResource
protected URL contextPath;
+ @org.junit.BeforeClass
+ public static void setupDriver()
+ {
+ io.github.bonigarcia.wdm.WebDriverManager.chromedriver().setup();
+ }
+
@Before
public void before()
{
diff --git a/integration-tests/faceletToXhtmlMapping/src/test/resources/arquillian.xml b/integration-tests/faceletToXhtmlMapping/src/test/resources/arquillian.xml
index b472092b6..ff8d63b3e 100644
--- a/integration-tests/faceletToXhtmlMapping/src/test/resources/arquillian.xml
+++ b/integration-tests/faceletToXhtmlMapping/src/test/resources/arquillian.xml
@@ -23,9 +23,8 @@
<extension qualifier="webdriver">
<property name="browser">chromeHeadless</property>
- <property name="browserVersion">100</property>
- <property name="chromeDriverVersion">${chromeDriverVersion:}</property>
- </extension>
+ <property name="browserVersion">139.0</property>
+ </extension>
<container qualifier="tomcat" default="true">
<configuration>
diff --git a/integration-tests/faceletToXhtmlMappingDisabled/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java b/integration-tests/faceletToXhtmlMappingDisabled/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
index e2d7f8334..7e0cd807d 100644
--- a/integration-tests/faceletToXhtmlMappingDisabled/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
+++ b/integration-tests/faceletToXhtmlMappingDisabled/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
@@ -71,6 +71,12 @@ public static WebArchive createDeployment()
@ArquillianResource
protected URL contextPath;
+ @org.junit.BeforeClass
+ public static void setupDriver()
+ {
+ io.github.bonigarcia.wdm.WebDriverManager.chromedriver().setup();
+ }
+
@Before
public void before()
{
diff --git a/integration-tests/faceletToXhtmlMappingDisabled/src/test/resources/arquillian.xml b/integration-tests/faceletToXhtmlMappingDisabled/src/test/resources/arquillian.xml
index 4b530aa81..d155fe476 100644
--- a/integration-tests/faceletToXhtmlMappingDisabled/src/test/resources/arquillian.xml
+++ b/integration-tests/faceletToXhtmlMappingDisabled/src/test/resources/arquillian.xml
@@ -23,9 +23,8 @@
<extension qualifier="webdriver">
<property name="browser">chromeHeadless</property>
- <property name="browserVersion">100</property>
- <property name="chromeDriverVersion">${chromeDriverVersion:}</property>
- </extension>
+ <property name="browserVersion">139.0</property>
+ </extension>
<container qualifier="tomcat" default="true">
<configuration>
diff --git a/integration-tests/myfaces4623/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java b/integration-tests/myfaces4623/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
index 8dee9f724..cc2b7172c 100644
--- a/integration-tests/myfaces4623/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
+++ b/integration-tests/myfaces4623/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
@@ -78,6 +78,12 @@ public static WebArchive createDeployment()
@ArquillianResource
protected URL contextPath;
+ @org.junit.BeforeClass
+ public static void setupDriver()
+ {
+ io.github.bonigarcia.wdm.WebDriverManager.chromedriver().setup();
+ }
+
@Before
public void before()
{
diff --git a/integration-tests/myfaces4623/src/test/resources/arquillian.xml b/integration-tests/myfaces4623/src/test/resources/arquillian.xml
index 559c8f11e..ff8d63b3e 100644
--- a/integration-tests/myfaces4623/src/test/resources/arquillian.xml
+++ b/integration-tests/myfaces4623/src/test/resources/arquillian.xml
@@ -23,9 +23,8 @@
<extension qualifier="webdriver">
<property name="browser">chromeHeadless</property>
- <property name="browserVersion">100</property>
- <property name="chromeDriverBinary">/Users/volosied/Downloads/chromedriver-mac-arm64/chromedriver</property>
- </extension>
+ <property name="browserVersion">139.0</property>
+ </extension>
<container qualifier="tomcat" default="true">
<configuration>
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 001e94022..faaa148e0 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -106,6 +106,13 @@
</build>
<dependencies>
+ <dependency>
+ <groupId>io.github.bonigarcia</groupId>
+ <artifactId>webdrivermanager</artifactId>
+ <version>5.6.4</version>
+ <scope>test</scope>
+ </dependency>
+
<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
diff --git a/integration-tests/protectedViews/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java b/integration-tests/protectedViews/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
index 9e95875ca..01728110c 100644
--- a/integration-tests/protectedViews/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
+++ b/integration-tests/protectedViews/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
@@ -73,6 +73,12 @@ public static WebArchive createDeployment()
@ArquillianResource
protected URL contextPath;
+ @org.junit.BeforeClass
+ public static void setupDriver()
+ {
+ io.github.bonigarcia.wdm.WebDriverManager.chromedriver().setup();
+ }
+
@Before
public void before()
{
diff --git a/integration-tests/protectedViews/src/test/resources/arquillian.xml b/integration-tests/protectedViews/src/test/resources/arquillian.xml
index b472092b6..ff8d63b3e 100644
--- a/integration-tests/protectedViews/src/test/resources/arquillian.xml
+++ b/integration-tests/protectedViews/src/test/resources/arquillian.xml
@@ -23,9 +23,8 @@
<extension qualifier="webdriver">
<property name="browser">chromeHeadless</property>
- <property name="browserVersion">100</property>
- <property name="chromeDriverVersion">${chromeDriverVersion:}</property>
- </extension>
+ <property name="browserVersion">139.0</property>
+ </extension>
<container qualifier="tomcat" default="true">
<configuration>