Skip to content

Commit

Permalink
BVTCK-154 Update tck-audit.xml after BVAL-616, BVAL-624 and BVAL-646
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet authored and gunnarmorling committed Jun 13, 2017
1 parent dd68094 commit 51f4c13
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 41 deletions.
Expand Up @@ -44,7 +44,7 @@ public static WebArchive createTestArchive() {

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "n")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "p")
public void testDigitsConstraint() {
Validator validator = TestUtil.getValidatorUnderTest();
DigitsDummyEntity dummy = new DigitsDummyEntity();
Expand Down
Expand Up @@ -46,8 +46,8 @@ public static WebArchive createTestArchive() {

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "t")
public void testNotBlankConstraint() {
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "v")
public void testEmailConstraint() {
Validator validator = TestUtil.getValidatorUnderTest();
EmailDummyEntity foo = new EmailDummyEntity();

Expand All @@ -65,8 +65,8 @@ public void testNotBlankConstraint() {

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "t")
public void testNotBlankConstraintOnStringBuilder() {
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "v")
public void testEmailConstraintOnStringBuilder() {
// @Email has to support CharSequence so let's also try a StringBuilder
Validator validator = TestUtil.getValidatorUnderTest();
EmailStringBuilderDummyEntity foo = new EmailStringBuilderDummyEntity();
Expand Down
Expand Up @@ -67,7 +67,7 @@ public static WebArchive createTestArchive() {

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "o")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "q")
public void testPastConstraint() {
Validator validator = TestUtil.getValidatorUnderTest();
PastDummyEntity dummy = new PastDummyEntity();
Expand Down Expand Up @@ -120,7 +120,7 @@ public void testPastConstraint() {

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "o")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "q")
public void testPastConstraintForRelativePartial() {
// For partials not referencing a precise point in time, we need to use the FixedClockProvider
// to make sure the tests are working at any date
Expand Down Expand Up @@ -160,7 +160,7 @@ public void testPastConstraintForRelativePartial() {

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "p")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "r")
public void testFutureConstraint() {
Validator validator = TestUtil.getValidatorUnderTest();
FutureDummyEntity dummy = new FutureDummyEntity();
Expand Down Expand Up @@ -213,7 +213,7 @@ public void testFutureConstraint() {

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "p")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "r")
public void testFutureConstraintForRelativePartial() {
// For partials not referencing a precise point in time, we need to use the FixedClockProvider
// to make sure the tests are working at any date
Expand Down Expand Up @@ -252,7 +252,7 @@ public void testFutureConstraintForRelativePartial() {
}

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "o")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "q")
public void testPastOrPresentConstraint() {
ZonedDateTime reference = ZonedDateTime.of( 2016, 6, 6, 14, 26, 0, 0, TZ_BERLIN );

Expand Down Expand Up @@ -342,7 +342,7 @@ public void testPastOrPresentConstraint() {
}

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "o")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "q")
public void testPastOrPresentConstraintForRelativePartial() {
ZonedDateTime reference = ZonedDateTime.of( 2016, 6, 6, 14, 26, 0, 0, TZ_BERLIN );

Expand Down Expand Up @@ -392,7 +392,7 @@ public void testPastOrPresentConstraintForRelativePartial() {
}

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "p")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "r")
public void testFutureOrPresentConstraint() {
ZonedDateTime reference = ZonedDateTime.of( 2016, 6, 6, 14, 26, 0, 0, TZ_BERLIN );

Expand Down Expand Up @@ -482,7 +482,7 @@ public void testFutureOrPresentConstraint() {
}

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "p")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "r")
public void testFutureOrPresentConstraintForRelativePartial() {
ZonedDateTime reference = ZonedDateTime.of( 2016, 6, 6, 14, 26, 0, 0, TZ_BERLIN );

Expand Down
Expand Up @@ -312,7 +312,7 @@ public void testNegativeConstraintInfinityAndNaN() {

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "l")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "m")
public void testPositiveConstraint() {
Validator validator = TestUtil.getValidatorUnderTest();
PositiveEntity dummy = new PositiveEntity();
Expand Down Expand Up @@ -406,7 +406,7 @@ public void testPositiveConstraint() {

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "l")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "m")
public void testStrictPositiveConstraint() {
Validator validator = TestUtil.getValidatorUnderTest();
StrictPositiveEntity dummy = new StrictPositiveEntity();
Expand Down Expand Up @@ -543,7 +543,7 @@ public void testStrictPositiveConstraint() {

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "l")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "m")
public void testPositiveConstraintInfinityAndNaN() {
Validator validator = TestUtil.getValidatorUnderTest();
PositiveEntity dummy = new PositiveEntity();
Expand Down
Expand Up @@ -42,7 +42,7 @@ public static WebArchive createTestArchive() {

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "s")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "u")
public void testNotBlankConstraint() {
Validator validator = getValidator();
NotBlankDummyEntity foo = new NotBlankDummyEntity();
Expand Down Expand Up @@ -93,7 +93,7 @@ public void testNotBlankConstraint() {

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "s")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "u")
public void testNotBlankConstraintOnStringBuilder() {
// @NotBlank has to support CharSequence so let's also try a StringBuilder
Validator validator = getValidator();
Expand Down
Expand Up @@ -47,7 +47,7 @@ public static WebArchive createTestArchive() {

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "r")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "t")
public void testNotEmptyConstraint() {
Validator validator = TestUtil.getValidatorUnderTest();
NotEmptyDummyEntity dummy = new NotEmptyDummyEntity();
Expand Down
Expand Up @@ -42,7 +42,7 @@ public static WebArchive createTestArchive() {

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "q")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "s")
public void testPatternConstraint() {
Validator validator = TestUtil.getValidatorUnderTest();
PatternDummyEntity dummy = new PatternDummyEntity();
Expand Down
Expand Up @@ -47,7 +47,7 @@ public static WebArchive createTestArchive() {

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "a")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "m")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "o")
public void testSizeConstraint() {
Validator validator = TestUtil.getValidatorUnderTest();
SizeDummyEntity dummy = new SizeDummyEntity();
Expand Down
Expand Up @@ -44,7 +44,7 @@ public static WebArchive createTestArchive() {
@Test
@SpecAssertion(section = Sections.INTEGRATION_GENERAL_OBJECTSLIFECYCLE, id = "c")
@SpecAssertion(section = Sections.INTEGRATION_CDI, id = "a")
@SpecAssertion(section = Sections.INTEGRATION_CDI_CUSTOMCONFIGURATION, id = "b")
@SpecAssertion(section = Sections.INTEGRATION_CDI_CUSTOMCONFIGURATION, id = "c")
public void testDependencyInjectionIntoConstraintValidator() {
Set<ConstraintViolation<Foo>> violations = defaultValidatorFactory.getValidator().validate( new Foo() );

Expand Down
Expand Up @@ -45,7 +45,7 @@ public static WebArchive createTestArchive() {
}

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "p")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "r")
public void clockProviderIsUsed() {
FutureDummyEntity dummy = new FutureDummyEntity( ZonedDateTime.of( 2099, 1, 12, 5, 0, 0, 0, TZ_BERLIN ) );

Expand Down Expand Up @@ -97,7 +97,7 @@ public void clockProviderIsUsed() {
}

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "p")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "r")
public void clockProviderIsUsedForRelativePartials() {
FutureRelativePartialDummyEntity dummy = new FutureRelativePartialDummyEntity( ZonedDateTime.of( 2016, 6, 6, 14, 45, 0, 0, TZ_BERLIN ) );

Expand Down
Expand Up @@ -49,7 +49,7 @@ public static WebArchive createTestArchive() {
}

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "o")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "q")
public void clockProviderIsUsed() {
PastDummyEntity dummy = new PastDummyEntity( ZonedDateTime.of( 1985, 6, 12, 3, 0, 0, 0, TZ_BERLIN ) );

Expand Down Expand Up @@ -96,7 +96,7 @@ public void clockProviderIsUsed() {
}

@Test
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "o")
@SpecAssertion(section = Sections.BUILTINCONSTRAINTS, id = "q")
public void clockProviderIsUsedForRelativePartials() {
Calendar cal = GregorianCalendar.getInstance( TimeZone.getTimeZone( TZ_BERLIN ) );
cal.set( 2016, 6, 6 );
Expand Down
57 changes: 42 additions & 15 deletions tests/src/main/resources/tck-audit.xml
Expand Up @@ -7,7 +7,7 @@
See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
-->
<!-- Generated by tck-audit.xsl at 2017-06-09 13:11 (revision 2.0.0.Beta2-11-g30f18c1) -->
<!-- Generated by tck-audit.xsl at 2017-06-13 13:38 (revision 2.0.0.Beta2-15-gc37b207) -->
<specification xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xalan="http://xml.apache.org/xslt" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jboss.com/products/weld/tck/audit" xsi:schemaLocation="http://jboss.com/products/weld/tck/audit" name="JSR-380: Bean Validation 2.0" version="2.0.0" id="beanvalidation" generateSectionIds="true">
<section id="introduction" title="Introduction" level="1">
<!-- 1 - INTRODUCTION -->
Expand Down Expand Up @@ -704,7 +704,10 @@
<assertion id="f">
<text>Container element constraints can be applied to nested container types</text>
</assertion>
<assertion id="g" testable="false">
<assertion id="g">
<text>In the example above, the extractor for Map values will be invoked to obtain all map values (lists of Address) for each extracted list of addresses, the @NotEmpty constraint will be validated and the extractor for List elements will be invoked, providing the Address objects from each list in the map the @ValidAddress constraint will be applied to all elements of all lists stored in the map</text>
</assertion>
<assertion id="h">
<text>Container element constraints are not supported on wildcard type arguments (with or without bounds), i.e. the following usage is unsupported</text>
</assertion>
</section>
Expand Down Expand Up @@ -1863,30 +1866,36 @@
<text>@Negative constraint</text>
</assertion>
<assertion id="l">
<text>@Positive constraint</text>
<text>@NegativeOrZero constraint</text>
</assertion>
<assertion id="m">
<text>@Size constraint</text>
<text>@Positive constraint</text>
</assertion>
<assertion id="n">
<text>@Digits constraint</text>
<text>@PositiveOrZero constraint</text>
</assertion>
<assertion id="o">
<text>@Past constraint</text>
<text>@Size constraint</text>
</assertion>
<assertion id="p">
<text>@Future constraint</text>
<text>@Digits constraint</text>
</assertion>
<assertion id="q">
<text>@Pattern constraint</text>
<text>@Past constraint</text>
</assertion>
<assertion id="r">
<text>@NotEmpty constraint</text>
<text>@Future constraint</text>
</assertion>
<assertion id="s">
<text>@NotBlank constraint</text>
<text>@Pattern constraint</text>
</assertion>
<assertion id="t">
<text>@NotEmpty constraint</text>
</assertion>
<assertion id="u">
<text>@NotBlank constraint</text>
</assertion>
<assertion id="v">
<text>@Email constraint</text>
</assertion>
</section>
Expand Down Expand Up @@ -2112,20 +2121,35 @@
<text>The type-argument-index is used to specify the index of the configured type argument.</text>
</assertion>
<assertion id="d">
<text>The ignore-annotations settings effectively applying for the encapsulating element (field, getter etc.) are applied for container-element-type, too.</text>
<text>The type-argument-index can be omitted, if the container element type has exactly one type argument.</text>
</assertion>
<assertion id="e">
<text>The container-element-type element can be nested for configuring nested generic containers such as List&lt;List&lt;String&gt;&gt;.</text>
<text>The ignore-annotations settings effectively applying for the encapsulating element (field, getter etc.) are applied for container-element-type, too.</text>
</assertion>
<assertion id="f">
<text>Constraints are applied by adding constraint elements to container-element-type.</text>
<text>The container-element-type element can be nested for configuring nested generic containers such as List&lt;List&lt;String&gt;&gt;.</text>
</assertion>
<assertion id="g">
<text>Whether or not to perform cascaded validation is controlled using the valid element.</text>
<text>Constraints are applied by adding constraint elements to container-element-type.</text>
</assertion>
<assertion id="h">
<text>Whether or not to perform cascaded validation is controlled using the valid element.</text>
</assertion>
<assertion id="i">
<text>Group conversion rules for cascaded validation are specified using the convert-group element.</text>
</assertion>
<assertion id="j">
<text>The type of the surrounding element (field, getter etc.) has no type arguments.</text>
</assertion>
<assertion id="k">
<text>The type of the surrounding element has no type argument with the index given via type-argument-index.</text>
</assertion>
<assertion id="l">
<text>The type of the surrounding element has multiple type arguments and no index is given via type-argument-index.</text>
</assertion>
<assertion id="m">
<text>The same type argument of the surrounding element is configured multiple times.</text>
</assertion>
</section>
<section id="xml-mapping-constraintdeclarationinxml-constraintdeclaration" title="Constraint declaration" level="4">
<!-- 9.1.1.7 - XML_MAPPING_CONSTRAINTDECLARATIONINXML_CONSTRAINTDECLARATION -->
Expand Down Expand Up @@ -2409,9 +2433,12 @@
<text>If custom ConstraintValidatorFactory, MessageInterpolator, ParameterNameProvider, ClockProvider, TraversableResolver or ValueExtractor classes are defined in the XML deployment descriptor (see 6.5.6), the ValidatorFactory must be configured with CDI managed beans representing the requested classes. Services like dependency injection, interception and decoration must thus be made available to these instances by the container.</text>
</assertion>
<assertion id="b">
<text>The same applies to value extractors discovered through the service loader mechanism (see 5.7.5.1).</text>
</assertion>
<assertion id="c">
<text>If no custom ConstraintValidatorFactory is requested by the user, the ValidatorFactory must be configured with a custom ConstraintValidatorFactory instance that returns CDI managed beans representing the requested ConstraintValidator types. The factory creates non-contextual ConstraintValidator instances for each ConstraintValidatorFactory.getInstance() call. To inject dependencies into the ConstraintValidator instance, the CDI InjectionTarget API should be used. Before returning the instance the following calls should be made: InjectionTarget.produce(), InjectionTarget.inject() and InjectionTarget.postConstruct(). calls InjectionTarget.preDestroy() and InjectionTarget.dispose() upon ConstraintValidatorFactory.releaseInstance (see also 3.5 for more information about the lifecycle of a ConstraintValidator).</text>
</assertion>
<assertion id="c" testable="false">
<assertion id="d" testable="false">
<text>Using directly or indirectly a JPA EntityManager that might call back Bean Validation for validation is not allowed in the Bean Validation extension points and in ConstraintValidator instances. This would lead to infinite flush or unexpected behavior.</text>
</assertion>
</section>
Expand Down

0 comments on commit 51f4c13

Please sign in to comment.