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 2023/10/30 09:07:57 UTC
(myfaces) branch main updated: Fix Myfaces 4623 & Add Test for 5.0.x (#636)
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 c82a91915 Fix Myfaces 4623 & Add Test for 5.0.x (#636)
c82a91915 is described below
commit c82a9191535f6ec3f9a647468f8a479d09821d0f
Author: Volodymyr Siedlecki <vo...@gmail.com>
AuthorDate: Mon Oct 30 05:07:52 2023 -0400
Fix Myfaces 4623 & Add Test for 5.0.x (#636)
* myfaces-4623 check for dup ids to avoid DuplicateIdException
* Loop through children to check all ids before adding
* Create integration test for myfaces-4623
---
.../facelets/PartialStateManagementStrategy.java | 22 +++-
integration-tests/myfaces4623/pom.xml | 33 ++++++
.../apache/myfaces/core/integrationtests/Bean.java | 51 ++++++++
.../core/integrationtests/CustomComponent.java | 40 +++++++
.../myfaces4623/src/main/webapp/WEB-INF/beans.xml | 24 ++++
.../src/main/webapp/WEB-INF/faces-config.xml | 26 ++++
.../myfaces4623/src/main/webapp/WEB-INF/web.xml | 54 +++++++++
.../myfaces4623/src/main/webapp/index.xhtml | 55 +++++++++
.../src/main/webapp/resources/default/js/test.js | 19 +++
.../core/integrationtests/IntegrationTest.java | 131 +++++++++++++++++++++
.../myfaces4623/src/test/resources/arquillian.xml | 39 ++++++
integration-tests/pom.xml | 1 +
12 files changed, 494 insertions(+), 1 deletion(-)
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/PartialStateManagementStrategy.java b/impl/src/main/java/org/apache/myfaces/view/facelets/PartialStateManagementStrategy.java
index ca0c8e533..43360f83d 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/PartialStateManagementStrategy.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/PartialStateManagementStrategy.java
@@ -52,6 +52,7 @@ import jakarta.faces.view.ViewMetadata;
import org.apache.myfaces.application.StateManagerImpl;
import org.apache.myfaces.application.viewstate.StateCacheUtils;
import org.apache.myfaces.context.RequestViewContext;
+import org.apache.myfaces.core.api.shared.ComponentUtils;
import org.apache.myfaces.util.lang.ClassUtils;
import org.apache.myfaces.util.lang.HashMapUtils;
import org.apache.myfaces.component.visit.MyFacesVisitHints;
@@ -642,7 +643,25 @@ public class PartialStateManagementStrategy extends StateManagementStrategy
{
try
{
- target.getChildren().add(childIndex, child);
+ UIComponent parent = target;
+ for (int i = 0, childCount = parent.getChildCount(); i < childCount; i ++)
+ {
+ UIComponent dup = parent.getChildren().get(i);
+ // myfaces-4623: avoid duplicate id exceptions w/ c:forEach for Resource Dependencies
+ if (child.getId().startsWith(UIViewRoot.UNIQUE_ID_PREFIX + ComponentUtils.RD_ID_PREFIX)
+ && child.getId().equals(dup.getId()))
+ {
+ // Replace
+ parent.getChildren().remove(i);
+ parent.getChildren().add(i, child);
+ done = true;
+ break;
+ }
+ }
+ if(!done) // if not replaced yet, then just add it.
+ {
+ target.getChildren().add(childIndex, child);
+ }
}
catch (IndexOutOfBoundsException e)
{
@@ -650,6 +669,7 @@ public class PartialStateManagementStrategy extends StateManagementStrategy
// item, so just add it.
target.getChildren().add(child);
}
+
}
}
}
diff --git a/integration-tests/myfaces4623/pom.xml b/integration-tests/myfaces4623/pom.xml
new file mode 100644
index 000000000..7638391ae
--- /dev/null
+++ b/integration-tests/myfaces4623/pom.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-integration-tests</artifactId>
+ <version>5.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.myfaces.core.integration-tests</groupId>
+ <artifactId>myfaces4623</artifactId>
+ <name>Apache MyFaces Core 5.0 - Integration Tests - myfaces4623</name>
+ <packaging>war</packaging>
+
+</project>
diff --git a/integration-tests/myfaces4623/src/main/java/org/apache/myfaces/core/integrationtests/Bean.java b/integration-tests/myfaces4623/src/main/java/org/apache/myfaces/core/integrationtests/Bean.java
new file mode 100644
index 000000000..32fa4e966
--- /dev/null
+++ b/integration-tests/myfaces4623/src/main/java/org/apache/myfaces/core/integrationtests/Bean.java
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.core.integrationtests;
+
+import jakarta.inject.Named;
+
+import jakarta.enterprise.context.SessionScoped;
+
+@SessionScoped
+@Named("bean")
+public class Bean implements java.io.Serializable
+{
+
+ private Integer arraySize = 0;
+
+ public Integer[] getCount()
+ {
+ if(arraySize == 1)
+ {
+ return new Integer[]{1};
+ }
+ return new Integer[]{};
+ }
+
+ public void setToOne()
+ {
+ this.arraySize = 1;
+ }
+
+ public void resetToZero()
+ {
+ this.arraySize = 0;
+ }
+
+}
diff --git a/integration-tests/myfaces4623/src/main/java/org/apache/myfaces/core/integrationtests/CustomComponent.java b/integration-tests/myfaces4623/src/main/java/org/apache/myfaces/core/integrationtests/CustomComponent.java
new file mode 100644
index 000000000..f7a7bc852
--- /dev/null
+++ b/integration-tests/myfaces4623/src/main/java/org/apache/myfaces/core/integrationtests/CustomComponent.java
@@ -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.
+ */
+package org.apache.myfaces.core.integrationtests;
+
+import jakarta.faces.application.ResourceDependency;
+import jakarta.faces.component.FacesComponent;
+import jakarta.faces.component.html.HtmlOutputText;
+import jakarta.faces.event.ComponentSystemEvent;
+
+@FacesComponent(
+ createTag = true,
+ namespace = "test"
+)
+@ResourceDependency(
+ library = "default",
+ name = "js/test.js"
+)
+public class CustomComponent extends HtmlOutputText
+{
+ public void processEvent(ComponentSystemEvent event)
+ {
+ super.processEvent(event);
+ }
+}
diff --git a/integration-tests/myfaces4623/src/main/webapp/WEB-INF/beans.xml b/integration-tests/myfaces4623/src/main/webapp/WEB-INF/beans.xml
new file mode 100644
index 000000000..ece154ff0
--- /dev/null
+++ b/integration-tests/myfaces4623/src/main/webapp/WEB-INF/beans.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
+ bean-discovery-mode="annotated">
+</beans>
diff --git a/integration-tests/myfaces4623/src/main/webapp/WEB-INF/faces-config.xml b/integration-tests/myfaces4623/src/main/webapp/WEB-INF/faces-config.xml
new file mode 100644
index 000000000..ec35a6c5c
--- /dev/null
+++ b/integration-tests/myfaces4623/src/main/webapp/WEB-INF/faces-config.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<faces-config version="2.2"
+ xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
+
+
+</faces-config>
diff --git a/integration-tests/myfaces4623/src/main/webapp/WEB-INF/web.xml b/integration-tests/myfaces4623/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 000000000..0d27453cd
--- /dev/null
+++ b/integration-tests/myfaces4623/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
+
+ <context-param>
+ <param-name>jakarta.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>jakarta.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.xhtml</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list>
+ <welcome-file>index.xhtml</welcome-file>
+ </welcome-file-list>
+
+ <context-param>
+ <param-name>org.apache.myfaces.STRICT_JSF_2_FACELETS_COMPATIBILITY</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.apache.myfaces.CHECK_ID_PRODUCTION_MODE</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+</web-app>
diff --git a/integration-tests/myfaces4623/src/main/webapp/index.xhtml b/integration-tests/myfaces4623/src/main/webapp/index.xhtml
new file mode 100644
index 000000000..132b551cc
--- /dev/null
+++ b/integration-tests/myfaces4623/src/main/webapp/index.xhtml
@@ -0,0 +1,55 @@
+<!--
+ 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:f="http://xmlns.jcp.org/jsf/core" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:jsf="http://xmlns.jcp.org/jsf" xmlns:test="test">
+<h:head>
+ <title>Test DupId with c:ForEach</title>
+</h:head>
+<h:body>
+ <h:form id="form1">
+
+ <script type="text/javascript">
+ faces.ajax.addOnError(function(data){
+ //alert("error occurred! " + data.message);
+ document.querySelector("#message").innerHTML = data.errorName;
+ });
+ </script>
+
+ <div jsf:id="loop">
+ <c:forEach var="item" items="${bean.count}">
+ <test:customComponent id="text" value="DISPLAYING COMPONENT" styleClass="input" />
+ </c:forEach>
+ </div>
+
+ <h:commandButton id="display" value="display" action="${bean.setToOne()}">
+ <f:ajax execute="@form" render="loop" />
+ </h:commandButton>
+
+ <h:commandButton id="close" value="close" action="${bean.resetToZero()}">
+ <f:ajax execute="@form" render="loop" />
+ </h:commandButton>
+
+ <div id="message"> </div>
+ </h:form>
+
+</h:body>
+
+</html>
diff --git a/integration-tests/myfaces4623/src/main/webapp/resources/default/js/test.js b/integration-tests/myfaces4623/src/main/webapp/resources/default/js/test.js
new file mode 100644
index 000000000..3cc487229
--- /dev/null
+++ b/integration-tests/myfaces4623/src/main/webapp/resources/default/js/test.js
@@ -0,0 +1,19 @@
+/*
+ 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.
+*/
+console.log("js resource added succesfully!");
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
new file mode 100644
index 000000000..8dee9f724
--- /dev/null
+++ b/integration-tests/myfaces4623/src/test/java/org/apache/myfaces/core/integrationtests/IntegrationTest.java
@@ -0,0 +1,131 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.core.integrationtests;
+
+import java.io.File;
+import java.net.URL;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.drone.api.annotation.Drone;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.importer.ZipImporter;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.ByIdOrName;
+import org.openqa.selenium.support.ui.ExpectedCondition;
+import org.openqa.selenium.support.ui.WebDriverWait;
+
+import java.time.Duration;
+
+@RunWith(Arquillian.class)
+@RunAsClient
+public class IntegrationTest
+{
+ @Deployment(testable = false)
+ public static WebArchive createDeployment()
+ {
+ // Fix for 'Failed to scan serializer.jar' error message
+ String key = "tomcat.util.scan.StandardJarScanFilter.jarsToSkip";
+ String value = "bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,annotations-api.jar,el-api.jar,jsp-api.jar," +
+ "servlet-api.jar,websocket-api.jar,jaspic-api.jar,catalina.jar,catalina-ant.jar,catalina-ha.jar," +
+ "catalina-storeconfig.jar,catalina-tribes.jar,jasper.jar,jasper-el.jar,ecj-*.jar,tomcat-api.jar," +
+ "tomcat-util.jar,tomcat-util-scan.jar,tomcat-coyote.jar,tomcat-dbcp.jar,tomcat-jni.jar," +
+ "tomcat-websocket.jar,tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar," +
+ "tomcat-juli-adapters.jar,catalina-jmx-remote.jar,catalina-ws.jar,tomcat-jdbc.jar,tools.jar," +
+ "commons-beanutils*.jar,commons-codec*.jar,commons-collections*.jar,commons-dbcp*.jar," +
+ "commons-digester*.jar,commons-fileupload*.jar,commons-httpclient*.jar,commons-io*.jar," +
+ "commons-lang*.jar,commons-logging*.jar,commons-math*.jar,commons-pool*.jar,jstl.jar," +
+ "taglibs-standard-spec-*.jar,geronimo-spec-jaxrpc*.jar,wsdl4j*.jar,ant.jar,ant-junit*.jar," +
+ "aspectj*.jar,jmx.jar,h2*.jar,hibernate*.jar,httpclient*.jar,jmx-tools.jar,jta*.jar,log4j*.jar," +
+ "mail*.jar,slf4j*.jar,xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,junit.jar,junit-*.jar," +
+ "ant-launcher.jar,cobertura-*.jar,asm-*.jar,dom4j-*.jar,icu4j-*.jar,jaxen-*.jar,jdom-*.jar," +
+ "jetty-*.jar,oro-*.jar,servlet-api-*.jar,tagsoup-*.jar,xmlParserAPIs-*.jar,xom-*.jar,serializer.jar";
+ System.setProperty(key, value);
+
+ return ShrinkWrap.create(ZipImporter.class, "myfaces4623.war")
+ .importFrom(new File("target/myfaces4623.war"))
+ .as(WebArchive.class);
+ }
+
+ @Drone
+ protected WebDriver webDriver;
+
+ @ArquillianResource
+ protected URL contextPath;
+
+ @Before
+ public void before()
+ {
+ }
+
+ @After
+ public void after()
+ {
+ webDriver.manage().deleteAllCookies();
+ }
+
+ /*
+ * Test for https://issues.apache.org/jira/browse/MYFACES-4623
+ */
+ @Test
+ public void test()
+ {
+ webDriver.get(contextPath + "index.xhtml");
+
+ Assert.assertTrue(webDriver.getPageSource().contains("display"));
+ Assert.assertTrue(webDriver.getPageSource().contains("close"));
+
+ trigger("form1:display", webDriver ->
+ {
+ return webDriver.getPageSource().contains("DISPLAYING COMPONENT");
+ });
+ Assert.assertTrue(webDriver.getPageSource().contains("DISPLAYING COMPONENT"));
+
+ trigger("form1:close", webDriver ->
+ {
+ return !webDriver.getPageSource().contains("DISPLAYING COMPONENT");
+ });
+ Assert.assertFalse(webDriver.getPageSource().contains("DuplicateIdException"));
+ }
+
+
+ /**
+ * taken from ajax test
+ * recurring trigger, wait until ajax processing is done function
+ *
+ * @param id the trigger element id
+ * @param condition a condition resolver which should return true if the condition is met
+ */
+ void trigger(String id, ExpectedCondition<Boolean> condition)
+ {
+ webDriver.findElement(By.id(id)).click();
+ WebDriverWait wait = new WebDriverWait(webDriver, Duration.ofMillis(200));
+ wait.until(condition);
+ }
+
+}
diff --git a/integration-tests/myfaces4623/src/test/resources/arquillian.xml b/integration-tests/myfaces4623/src/test/resources/arquillian.xml
new file mode 100644
index 000000000..559c8f11e
--- /dev/null
+++ b/integration-tests/myfaces4623/src/test/resources/arquillian.xml
@@ -0,0 +1,39 @@
+<!--
+ 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.
+-->
+<arquillian
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd"
+ xmlns="http://jboss.org/schema/arquillian">
+
+ <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>
+
+ <container qualifier="tomcat" default="true">
+ <configuration>
+ <property name="tomcatHome">target/tomcat-embedded-10</property>
+ <property name="workDir">work</property>
+ <property name="bindHttpPort">8888</property>
+ <property name="unpackArchive">true</property>
+ <property name="serverName">arquillian-tomcat-embedded-10</property>
+ </configuration>
+ </container>
+</arquillian>
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 9633510fe..eb07686f3 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -215,6 +215,7 @@
<module>protectedViews</module>
<module>ajax</module>
<module>automaticExtensionlessMapping</module>
+ <module>myfaces4623</module>
</modules>
<profiles>