[bv-dev] TCK constraint composition problem WAS Size validator for int

Matt Benson mbenson at apache.org
Fri Mar 23 13:46:03 EDT 2018


Okay, after digging a bit deeper I have come up with the following list of
affected tests:

org.hibernate.beanvalidation.tck.tests.metadata.PropertyDescriptorTest:

#testGetGroupConversionsForField

#testGetGroupConversionsForProperty

#testGetGroupConversionsReturnsEmptySet

#testIsCascaded

#testPropertyName



org.hibernate.beanvalidation.tck.tests.metadata.ConstraintDescriptorTest:

#testAnnotationAndMapParametersReflectParameterOverriding

#testComposingConstraints

#testComposingConstraintsPayload

#testGetGroups

#testGetGroupsOnInterface

#testGetGroupsWithImplicitGroup

#testGetMessageTemplate

#testGetValidationAppliesTo

#testGetValidationAppliesToFromComposingConstraint

#testGetValidationAppliesToReturnsNull

#testPayload

#testReportAsSingleViolation



org.hibernate.beanvalidation.tck.tests.metadata.BeanDescriptorTest:

#testGetConstraintsForUnConstrainedProperty

#testGetElementClassReturnsBeanClass

#testIsBeanConstrainedDueToConstraintOnInterface

#testIsBeanConstrainedDueToValidAnnotation



These tests have in common the fact that they use bean classes derived from
the org.hibernate.beanvalidation.tck.tests.metadata.Person interface, whose
#getAge() method declares @CustomConstraint, which inherits @Size as a
composing constraint via @CustomComposingConstraint.



Section 3.3 of the spec says:

The type upon which composed constraint is placed must be compatible with
all constraints (composing and composed).



I therefore conclude that the constraint applied to Person#getAge() is
incorrectly composed.



Thanks,

Matt



*CONFIDENTIALITY NOTICE: This e-mail, including any attachments, may
contain confidential, privileged and/or proprietary information which is
solely for the use of the intended recipient(s). Any review, use,
disclosure or retention by others is strictly prohibited. If you are not an
intended recipient, please contact the sender and delete this e-mail, any
attachments and all copies.*

Permanent General Assurance Corporation | Permanent General Assurance
Corporation of Ohio | The General Automobile Insurance Company, Inc. | Old
American County Mutual Fire Insurance Company | Home Office: 2636 Elm Hill
Pike, Nashville, TN 37214


On Fri, Mar 23, 2018, 3:35 AM Guillaume Smet <guillaume.smet at gmail.com>
wrote:

> Hi Matt,
>
> On Thu, Mar 22, 2018 at 11:12 PM, Matt Benson <mbenson at apache.org> wrote:
>
>> Yeah, this is weird. Elsewhere there is a test that specifically looks
>> for there *not* being a Size validator for int. I will do some more
>> research on this and report back tomorrow.
>>
>
> FWIW, we don't have one in HV so the TCK cannot expect the impl to have
> one.
>
> --
> Guillaume
> _______________________________________________
> beanvalidation-dev mailing list
> beanvalidation-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/beanvalidation-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20180323/cfe5a56a/attachment.html 


More information about the beanvalidation-dev mailing list