Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCK Challenge: faces23/validateWholeBean test does not meet spec requirements #1715

Closed
brideck opened this issue Nov 9, 2022 · 7 comments
Closed
Labels
accepted Accepted certification request challenge TCK challenge

Comments

@brideck
Copy link
Contributor

brideck commented Nov 9, 2022

Challenged Tests:
ee.jakarta.tck.faces.test.javaee8.validateWholeBean.Issue4313IT#testValidateWholeBean
ee.jakarta.tck.faces.test.javaee8.validateWholeBean.Issue4083IT#testValidateWholeBean

TCK Version:
Jakarta Faces 4.0.x

Tested Implementation:
Open Liberty -- containing MyFaces 4.0

Description:
The VDLDoc for validateWholeBean gives clear guidance on how it is to be used, stating "This tag must be used in concert with <f:validateBean/> and Bean Validation. Here is a brief example of the common case of ensuring two password fields are individually valid and also both the same. The feature requires the use of the validationGroups attribute on all of the <f:validateBean/> tags and the <f:validateWholeBean/> tag."

Here's the example given in that same doc:

<h:panelGrid columns="2">

    <h:outputText value="Password" />  
    <h:inputSecret id="password1" value='#{backingBean.password1}'>
        <f:validateBean validationGroups="PasswordValidationGroup" />
    </h:inputSecret>
    
    <h:outputText value="Password again" /> 
    <h:inputSecret id="password2" value='#{backingBean.password2}'>
        <f:validateBean validationGroups="PasswordValidationGroup" />
    </h:inputSecret>
    
</h:panelGrid>

<f:validateWholeBean value='#{backingBean}' 
   validationGroups="PasswordValidationGroup" />

Unfortunately, neither TCK application (Issue4313, Issue4083) has the required elements. Issue4313 merely includes a <f:validateWholeBean/> element without using either <f:validateBean/> or validationGroups, and Issue4083 is lacking <f:validateBean/>. Accordingly, MyFaces fails validation for both tests due to the lack of these required elements.

A speculative set of TCK improvements to fix these tests can be seen here: https://github.com/jakartaee/faces/compare/master...volosied:faces:faces23-validateWholeBean-fix?expand=1

@pnicolucci pnicolucci added the challenge TCK challenge label Nov 9, 2022
@pnicolucci
Copy link
Contributor

@BalusC @arjantijms what do you think? In my opinion, this is valid and should be accepted. The proposed changes to the test are straightforward and make sense to me.

@pnicolucci
Copy link
Contributor

@arjantijms @BalusC what do you think about this one?

@ivargrimstad
Copy link
Member

@edburns

@volosied
Copy link
Contributor

volosied commented Dec 5, 2022

Following up so this challenge isn't forgotten. Thanks!

@ivargrimstad
Copy link
Member

What are the next steps with this?

@volosied
Copy link
Contributor

@arjantijms @BalusC

The whole bean validation tests check for an exact message match. However, MyFaces prefixes the id (after trying to get a label): form:j_id_h: Password fields must match.

assertEquals("Password fields must match", page1.getElementById("err").getElementsByTagName("li").get(0).asNormalizedText());

Could the the test be updated to check for contains instead?

@arjantijms
Copy link
Contributor

PR merged, which should fix the challenge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Accepted certification request challenge TCK challenge
Projects
None yet
Development

No branches or pull requests

5 participants