<div dir="ltr">Hi all,<div><br></div><div style>While working on a bug in the RI [1], I came across a TCK test which made me curious: ValidationRequirementTest#testClassLevelConstraints() [2]. The test is based on the following types:</div>
<div style><br></div><div style> <span class="">@SecurityCheck</span>(groups = { Default.<span class="">class</span>, TightSecurity.<span class="">class</span> })</div><div style> public<span class=""> </span>interface<span class=""> Citizen { ... }</span></div>
<div style><span class=""><br></span></div><div style><span class=""> @SecurityCheck</span>(groups = Default.<span class="">class</span>)</div><div style> public<span class=""> </span>abstract<span class=""> </span>class<span class=""> Person </span>implements<span class=""> Citizen { ... }</span></div>
<div style><br></div><div style> public<span class=""> </span>class<span class=""> Woman </span>extends<span class=""> Person { ... }</span><br></div><div style><span class=""><br></span></div><div style><span class="">The test validates an instance of Woman which violates the @SecurityCheck constraint(s), but expects only one violation of the type @SecurityCheck.</span></div>
<div style><span class=""><br></span></div><div style><span class="">Since the constraint is given twice in the hierarchy (and with different member values), I'd have expected two violations here. I spoke to Emmanuel and we agree that the test seems wrong.</span></div>
<div style><span class=""><br></span></div><div style><span class="">The RI passes that test due to the bug mentioned above, but it'd be interesting to know </span>how this is handled in the Apache implementation and why it's passing there.</div>
<div style><br></div><div style>If no one objects, I'll adapt the TCK test to expect two @SecurityCheck violations.</div><div style><br></div><div style><span class="">--Gunnar</span></div>
<div style><br></div><div style>[1] <a href="https://hibernate.onjira.com/browse/HV-665">https://hibernate.onjira.com/browse/HV-665</a></div><div style>[2] <a href="https://github.com/beanvalidation/beanvalidation-tck/blob/master/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/application/ValidationRequirementTest.java#L60">https://github.com/beanvalidation/beanvalidation-tck/blob/master/tests/src/main/java/org/hibernate/beanvalidation/tck/tests/constraints/application/ValidationRequirementTest.java#L60</a></div>
</div>