Skip to content

Commit ffa0e4d

Browse files
committed
HV-999 Upgrading to TCK 1.1.4.Final; Adding tests removed from the TCK to HV's own tests
1 parent 6ae1990 commit ffa0e4d

File tree

5 files changed

+100
-1
lines changed

5 files changed

+100
-1
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Hibernate Validator, declare and validate application constraints
3+
*
4+
* License: Apache License, Version 2.0
5+
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
6+
*/
7+
package org.hibernate.validator.test.internal.xml;
8+
9+
import javax.validation.ValidationException;
10+
11+
import org.hibernate.validator.testutil.ValidationXmlTestHelper;
12+
import org.hibernate.validator.testutil.ValidatorUtil;
13+
import org.testng.annotations.BeforeClass;
14+
import org.testng.annotations.Test;
15+
16+
/**
17+
* @author Hardy Ferentschik
18+
* @author Gunnar Morling
19+
*/
20+
public class InvalidXmlConfigurationTest {
21+
22+
private static ValidationXmlTestHelper validationXmlTestHelper;
23+
24+
@BeforeClass
25+
public static void setupValidationXmlTestHelper() {
26+
validationXmlTestHelper = new ValidationXmlTestHelper( InvalidXmlConfigurationTest.class );
27+
}
28+
29+
/**
30+
* Tests requirement 8.a from the BV 1.1 spec.
31+
*/
32+
@Test(expectedExceptions=ValidationException.class, expectedExceptionsMessageRegExp="HV000100.*")
33+
public void testInvalidValidationXml() {
34+
validationXmlTestHelper.runWithCustomValidationXml(
35+
"validation-InvalidXmlConfigurationTest.xml", new Runnable() {
36+
37+
@Override
38+
public void run() {
39+
ValidatorUtil.getValidator();
40+
}
41+
}
42+
);
43+
}
44+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Hibernate Validator, declare and validate application constraints
3+
*
4+
* License: Apache License, Version 2.0
5+
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
6+
*/
7+
package org.hibernate.validator.test.internal.xml;
8+
9+
import javax.validation.ValidationException;
10+
11+
import org.hibernate.validator.testutil.ValidationXmlTestHelper;
12+
import org.hibernate.validator.testutil.ValidatorUtil;
13+
import org.testng.annotations.BeforeClass;
14+
import org.testng.annotations.Test;
15+
16+
/**
17+
* @author Gunnar Morling
18+
*/
19+
public class UnknownVersionInValidationXmlTest {
20+
21+
private static ValidationXmlTestHelper validationXmlTestHelper;
22+
23+
@BeforeClass
24+
public static void setupValidationXmlTestHelper() {
25+
validationXmlTestHelper = new ValidationXmlTestHelper( InvalidXmlConfigurationTest.class );
26+
}
27+
28+
/**
29+
* Tests requirement 8.1.4.c from the BV 1.1 spec.
30+
*/
31+
@Test(expectedExceptions=ValidationException.class, expectedExceptionsMessageRegExp="HV000122.*")
32+
public void testInvalidValidationXml() {
33+
validationXmlTestHelper.runWithCustomValidationXml(
34+
"validation-UnknownVersionInValidationXmlTest.xml", new Runnable() {
35+
36+
@Override
37+
public void run() {
38+
ValidatorUtil.getValidator();
39+
}
40+
}
41+
);
42+
}
43+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<validation-config xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
3+
xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.0.xsd"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5+
</validation-confi>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<validation-config
3+
xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.1.xsd"
6+
version="1.2">
7+
</validation-config>

tck-runner/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<name>Hibernate Validator TCK Runner</name>
2121
<description>Aggregates dependencies and runs the JSR-349 TCK</description>
2222
<properties>
23-
<tck.version>1.1.2.Final</tck.version>
23+
<tck.version>1.1.4.Final</tck.version>
2424
<tck.suite.file>${project.build.directory}/dependency/beanvalidation-tck-tests-suite.xml</tck.suite.file>
2525
<wildflyTargetDir>${project.build.directory}/wildfly-${wildfly.version}</wildflyTargetDir>
2626
<validation.provider>org.hibernate.validator.HibernateValidator</validation.provider>

0 commit comments

Comments
 (0)