Hi Matt,
On Tue, Apr 3, 2018 at 11:22 PM, Matt Benson <mbenson@apache.org> wrote:Hello, I am encountering failures on three tests from
MethodValidationTest in the TCK:
* #constructorParameterValidationWithRedefinedDefaultGroupSequ ence()
* #methodParameterValidationWithRedefinedDefaultGroupSequence( )
* #methodReturnValueValidationWithRedefinedDefaultGroupSequenc e()
In each case I am failing to pick up a @Size constraint from the
Default group of an Item parameter or Order return value. However, due
to the group sequence redefinition of Basic, Default on the bean class
in question I am confused as to why I am expected to pick up the
failures from the Default group after having encountered a @NotNull
constraint violation in the Basic group. Thanks for any help here.I would tend to agree with you. (The fact that Item also has a different Basic group does not help to understand the issue though).AFAIU the spec (http://beanvalidation.org/2.0/spec/# ), we should do:constraintdeclarationvalidatio nprocess-validationroutine- methodconstructorvalidation - For each group- For each parameter, apply constraints- For each cascading parameter, cascadeThis in no particular order if there is no group sequence. If a group sequence is defined, we should exit as soon as we have a violation for a given groupCurrently, the RI does:- For each group- For each parameter, apply constraints- exit as soon as I have a constraint if group sequence- For each group- For each cascading parameter, cascade
- exit as soon as I have a constraint if group sequenceIn the aforementioned case:1/ we apply the Basic constraints for the parameter constraints2/ we exit as soon as we have a violation, we don't validate the Default group3/ we apply cascading- no violation for the Basic group- we validate the default group- we exit as soon as we have a violationAs per spec, I think we should exit just after 2/Gunnar, any insights?
--Guillaume
_______________________________________________
beanvalidation-dev mailing list
beanvalidation-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/ beanvalidation-dev