-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1720 from jakartaee/mojarra_issue_5171
Mojarra issue 5171
- Loading branch information
Showing
9 changed files
with
284 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2022 Contributors to Eclipse Foundation. | ||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
--> | ||
|
||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.eclipse.ee4j.tck.faces.faces40</groupId> | ||
<artifactId>pom</artifactId> | ||
<version>4.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>beanValidation</artifactId> | ||
<packaging>war</packaging> | ||
|
||
<name>Jakarta Faces TCK ${project.version} - Test - Faces 4.0 - beanValidation</name> | ||
|
||
<build> | ||
<finalName>test-faces40-beanValidation</finalName> | ||
</build> | ||
</project> |
48 changes: 48 additions & 0 deletions
48
...ation/src/main/java/ee/jakarta/tck/faces/test/servlet50/beanValidation/Issue5171Bean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (c) 2022 Contributors to Eclipse Foundation. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package ee.jakarta.tck.faces.test.servlet50.beanValidation; | ||
|
||
import jakarta.enterprise.context.RequestScoped; | ||
import jakarta.inject.Named; | ||
import jakarta.validation.constraints.NotEmpty; | ||
|
||
@Named | ||
@RequestScoped | ||
public class Issue5171Bean { | ||
|
||
@NotEmpty | ||
private String string1; | ||
|
||
@NotEmpty | ||
private String string2; | ||
|
||
public String getString1() { | ||
return string1; | ||
} | ||
|
||
public void setString1(String string1) { | ||
this.string1 = string1; | ||
} | ||
|
||
public String getString2() { | ||
return string2; | ||
} | ||
|
||
public void setString2(String string2) { | ||
this.string2 = string2; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
tck/faces40/beanValidation/src/main/webapp/WEB-INF/faces-config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2022 Contributors to Eclipse Foundation. | ||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
--> | ||
<faces-config | ||
xmlns="https://jakarta.ee/xml/ns/jakartaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-facesconfig_4_0.xsd" | ||
version="4.0" | ||
> | ||
</faces-config> |
45 changes: 45 additions & 0 deletions
45
tck/faces40/beanValidation/src/main/webapp/WEB-INF/web.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2022 Contributors to Eclipse Foundation. | ||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
--> | ||
<web-app | ||
xmlns="https://jakarta.ee/xml/ns/jakartaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd" | ||
version="5.0" | ||
> | ||
<context-param> | ||
<param-name>jakarta.faces.PROJECT_STAGE</param-name> | ||
<param-value>${webapp.projectStage}</param-value> | ||
</context-param> | ||
<context-param> | ||
<param-name>jakarta.faces.PARTIAL_STATE_SAVING</param-name> | ||
<param-value>${webapp.partialStateSaving}</param-value> | ||
</context-param> | ||
<context-param> | ||
<param-name>jakarta.faces.STATE_SAVING_METHOD</param-name> | ||
<param-value>${webapp.stateSavingMethod}</param-value> | ||
</context-param> | ||
<context-param> | ||
<param-name>jakarta.faces.SERIALIZE_SERVER_STATE</param-name> | ||
<param-value>${webapp.serializeServerState}</param-value> | ||
</context-param> | ||
|
||
<welcome-file-list> | ||
<welcome-file>issue5171.xhtml</welcome-file> | ||
</welcome-file-list> | ||
</web-app> |
40 changes: 40 additions & 0 deletions
40
tck/faces40/beanValidation/src/main/webapp/issue5171.xhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<!-- | ||
Copyright (c) 2022 Contributors to Eclipse Foundation. | ||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
--> | ||
<html | ||
xmlns:f="jakarta.faces.core" | ||
xmlns:h="jakarta.faces.html" | ||
xmlns:my="jakarta.faces.composite/components" | ||
> | ||
<h:head> | ||
<title>Issue5171IT</title> | ||
</h:head> | ||
<h:body> | ||
<h:form id="form"> | ||
<div> | ||
<h:inputText id="simpleInput" value="#{issue5171Bean.string1}"/> | ||
<h:message id="simpleInputMessage" for="simpleInput"/> | ||
</div> | ||
<div> | ||
<my:component id="composite" value="#{issue5171Bean.string2}"/> | ||
<h:message id="compositeInputMessage" for="composite:input"/> | ||
</div> | ||
<h:commandButton id="submit" value="Submit"/> | ||
</h:form> | ||
</h:body> | ||
</html> |
30 changes: 30 additions & 0 deletions
30
tck/faces40/beanValidation/src/main/webapp/resources/components/component.xhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!-- | ||
Copyright (c) 2022 Contributors to Eclipse Foundation. | ||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
--> | ||
<ui:component | ||
xmlns:ui="jakarta.faces.facelets" | ||
xmlns:f="jakarta.faces.core" | ||
xmlns:h="jakarta.faces.html" | ||
xmlns:cc="jakarta.faces.composite" | ||
> | ||
<cc:interface> | ||
<cc:attribute name="value"/> | ||
</cc:interface> | ||
<cc:implementation> | ||
<h:inputText id="input" value="#{cc.attrs.value}" rendered="#{cc.rendered}" label="Composite input"/> | ||
</cc:implementation> | ||
</ui:component> |
52 changes: 52 additions & 0 deletions
52
...idation/src/test/java/ee/jakarta/tck/faces/test/servlet50/beanValidation/Issue5171IT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (c) 2022 Contributors to Eclipse Foundation. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package ee.jakarta.tck.faces.test.servlet50.beanValidation; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.junit.Test; | ||
|
||
import com.gargoylesoftware.htmlunit.html.HtmlPage; | ||
import com.gargoylesoftware.htmlunit.html.HtmlTextInput; | ||
|
||
import ee.jakarta.tck.faces.test.util.arquillian.ITBase; | ||
|
||
public class Issue5171IT extends ITBase { | ||
|
||
/** | ||
* @see https://github.com/eclipse-ee4j/mojarra/issues/5171 | ||
*/ | ||
@Test | ||
public void test() throws Exception { | ||
HtmlPage page = getPage("issue5171.xhtml"); | ||
page = page.getElementById("form:submit").click(); | ||
String simpleInputMessage = page.getElementById("form:simpleInputMessage").asNormalizedText(); | ||
String compositeInputMessage = page.getElementById("form:compositeInputMessage").asNormalizedText(); | ||
assertEquals("simple input must trigger bean validation and show message", "must not be empty", simpleInputMessage); | ||
assertEquals("composite input must trigger bean validation and show message", "must not be empty", compositeInputMessage); | ||
|
||
HtmlTextInput simpleInput = (HtmlTextInput) page.getElementById("form:simpleInput"); | ||
HtmlTextInput compositeInput = (HtmlTextInput) page.getElementById("form:composite:input"); | ||
simpleInput.setValueAttribute("not empty"); | ||
compositeInput.setValueAttribute("not empty"); | ||
page = page.getElementById("form:submit").click(); | ||
simpleInputMessage = page.getElementById("form:simpleInputMessage").asNormalizedText(); | ||
compositeInputMessage = page.getElementById("form:compositeInputMessage").asNormalizedText(); | ||
assertEquals("simple input must pass bean validation and clear out message", "", simpleInputMessage); | ||
assertEquals("composite input must pass bean validation and clear out message", "", compositeInputMessage); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters