Skip to content

Commit 454b836

Browse files
committed
HV-1925 Update WildFly testing to 27
And remove the remaining javax references in WildFly ITs. Also use a properly formed beans.xml as new versions of CDI need that to have the bean discovery mode set to all.
1 parent 77705d2 commit 454b836

35 files changed

+106
-119
lines changed

annotation-processor/src/main/resources/org/hibernate/validator/ap/ValidationProcessorMessages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ CROSS_PARAMETER_CONSTRAINT_VALIDATOR_HAS_INVALID_TYPE=Validator for cross-parame
3232
CROSS_PARAMETER_CONSTRAINT_MULTIPLE_VALIDATORS=The constraint @{0} defines multiple cross-parameter validators. Only one is allowed.
3333
CROSS_PARAMETER_VALIDATION_APPLIES_TO_REQUIRED=Constraints with generic as well as cross-parameter validators must define an attribute validationAppliesTo(), but constraint @{0} does not.
3434
CROSS_PARAMETER_VALIDATION_APPLIES_TO_MUST_HAVE_IMPLICIT_DEFAULT_VALUE=Default value of the attribute validationAppliesTo() of the constraint @{0} must be ConstraintTarget\u0023IMPLICIT.
35-
CROSS_PARAMETER_VALIDATION_APPLIES_TO_MUST_HAVE_CONSTRAINT_TARGET_RETURN_TYPE=Return type of the attribute validationAppliesTo() of the constraint @{0} must be javax.validation.ConstraintTarget.
35+
CROSS_PARAMETER_VALIDATION_APPLIES_TO_MUST_HAVE_CONSTRAINT_TARGET_RETURN_TYPE=Return type of the attribute validationAppliesTo() of the constraint @{0} must be jakarta.validation.ConstraintTarget.
3636
CROSS_PARAMETER_VALIDATION_ON_PARAMETERLESS_METHOD=Cross-parameter constraint @{0} is illegally placed on a parameterless method or constructor.
3737
INVALID_SIZE_LENGTH_ANNOTATION_PARAMETERS=Invalid annotation parameters. Both min and max should be greater than or equal to 0 and max should be greater than or equal to min ( min >= 0, max >= 0 and min <= max ).
3838
INVALID_PATTERN_ANNOTATION_PARAMETERS=Invalid annotation parameters. Regular expression given as parameter is invalid.

cdi/src/main/java/org/hibernate/validator/cdi/internal/ValidatorBean.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@ public String getId() {
115115

116116
@Override
117117
public String toString() {
118-
return "ValidatorBean [id=" + getId() + "]";
118+
return "ValidatorBean [id=" + getId() + ", qualifiers=" + getQualifiers() + "]";
119119
}
120120
}

distribution/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
<dependency>
9595
<groupId>${project.groupId}</groupId>
9696
<artifactId>hibernate-validator-modules</artifactId>
97-
<classifier>wildfly-preview-${version.wildfly}-patch</classifier>
97+
<classifier>wildfly-${version.wildfly}-patch</classifier>
9898
<type>zip</type>
9999
</dependency>
100100
<!--

engine/src/main/java/org/hibernate/validator/internal/engine/messageinterpolation/el/BeanPropertiesElContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class BeanPropertiesElContext extends StandardELContext {
3333
public BeanPropertiesElContext(ExpressionFactory expressionFactory) {
3434
super( expressionFactory );
3535

36-
// In javax.el.ELContext, the ExpressionFactory is extracted from the context map. If it is not found, it
36+
// In jakarta.el.ELContext, the ExpressionFactory is extracted from the context map. If it is not found, it
3737
// defaults to ELUtil.getExpressionFactory() which, if we provided the ExpressionFactory to the
3838
// ResourceBundleMessageInterpolator, might not be the same. Thus, we inject the ExpressionFactory in the
3939
// context.

engine/src/main/java/org/hibernate/validator/internal/engine/messageinterpolation/el/VariablesELContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class VariablesELContext extends StandardELContext {
3737
public VariablesELContext(ExpressionFactory expressionFactory) {
3838
super( expressionFactory );
3939

40-
// In javax.el.ELContext, the ExpressionFactory is extracted from the context map. If it is not found, it
40+
// In jakarta.el.ELContext, the ExpressionFactory is extracted from the context map. If it is not found, it
4141
// defaults to ELUtil.getExpressionFactory() which, if we provided the ExpressionFactory to the
4242
// ResourceBundleMessageInterpolator, might not be the same. Thus, we inject the ExpressionFactory in the
4343
// context.

integration/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<description>Hibernate Validator WildFly integration tests.</description>
2222

2323
<properties>
24-
<wildfly.target-dir>${project.build.directory}/wildfly-preview-${version.wildfly}</wildfly.target-dir>
24+
<wildfly.target-dir>${project.build.directory}/wildfly-${version.wildfly}</wildfly.target-dir>
2525
<wildfly.modules-dir>${wildfly.target-dir}/modules/system/layers/base</wildfly.modules-dir>
2626
<!--
2727
<wildfly-secondary.target-dir>${project.build.directory}/wildfly-${version.wildfly.secondary}</wildfly-secondary.target-dir>
@@ -157,7 +157,7 @@
157157
<dependency>
158158
<groupId>${project.groupId}</groupId>
159159
<artifactId>hibernate-validator-modules</artifactId>
160-
<classifier>wildfly-preview-${version.wildfly}-patch</classifier>
160+
<classifier>wildfly-${version.wildfly}-patch</classifier>
161161
<type>zip</type>
162162
<scope>test</scope>
163163
</dependency>
@@ -225,7 +225,7 @@
225225
<!-- WildFly current -->
226226
<artifactItem>
227227
<groupId>org.wildfly</groupId>
228-
<artifactId>wildfly-preview-dist</artifactId>
228+
<artifactId>wildfly-dist</artifactId>
229229
<version>${version.wildfly}</version>
230230
<type>tar.gz</type>
231231
<overWrite>false</overWrite>
@@ -247,7 +247,7 @@
247247
<groupId>${project.groupId}</groupId>
248248
<artifactId>hibernate-validator-modules</artifactId>
249249
<version>${project.version}</version>
250-
<classifier>wildfly-preview-${version.wildfly}-patch</classifier>
250+
<classifier>wildfly-${version.wildfly}-patch</classifier>
251251
<type>zip</type>
252252
<outputDirectory>${project.build.directory}</outputDirectory>
253253
</artifactItem>
@@ -315,10 +315,10 @@
315315
</goals>
316316
<configuration>
317317
<offline>true</offline>
318-
<jbossHome>${project.build.directory}/wildfly-preview-${version.wildfly}/</jbossHome>
318+
<jbossHome>${project.build.directory}/wildfly-${version.wildfly}/</jbossHome>
319319
<fail-on-error>false</fail-on-error>
320320
<commands>
321-
<command>patch apply ${project.build.directory}/hibernate-validator-modules-${project.version}-wildfly-preview-${version.wildfly}-patch.zip</command>
321+
<command>patch apply ${project.build.directory}/hibernate-validator-modules-${project.version}-wildfly-${version.wildfly}-patch.zip</command>
322322
</commands>
323323
</configuration>
324324
</execution>

integration/src/test/java/org/hibernate/validator/integration/AbstractArquillianIT.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import org.jboss.arquillian.testng.Arquillian;
1010
import org.jboss.shrinkwrap.api.ShrinkWrap;
11+
import org.jboss.shrinkwrap.api.asset.StringAsset;
1112
import org.jboss.shrinkwrap.api.spec.WebArchive;
1213
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
1314
import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage;
@@ -19,6 +20,11 @@
1920
*/
2021
public abstract class AbstractArquillianIT extends Arquillian {
2122

23+
protected static StringAsset BEANS_XML = new StringAsset( "<beans xmlns=\"https://jakarta.ee/xml/ns/jakartaee\" " +
24+
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
25+
"xsi:schemaLocation=\"https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_3_0.xsd\"\n" +
26+
"bean-discovery-mode=\"all\"></beans>" );
27+
2228
public static WebArchive buildTestArchive(String warFileName) {
2329
PomEquippedResolveStage pom = Maven.resolver().loadPomFromFile( "pom.xml" );
2430
return ShrinkWrap

integration/src/test/java/org/hibernate/validator/integration/cdi/ConstraintValidatorInjectionUnitIT.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,20 @@
88

99
import static org.assertj.core.api.Assertions.assertThat;
1010

11-
import javax.inject.Inject;
12-
import jakarta.validation.ConstraintValidatorFactory;
13-
import jakarta.validation.ValidatorFactory;
14-
1511
import org.hibernate.validator.cdi.HibernateValidator;
1612
import org.hibernate.validator.integration.AbstractArquillianIT;
1713
import org.hibernate.validator.integration.cdi.constraint.Pingable;
1814
import org.hibernate.validator.integration.cdi.constraint.PingableValidator;
1915
import org.hibernate.validator.integration.cdi.service.PingService;
2016
import org.hibernate.validator.integration.cdi.service.PingServiceImpl;
2117
import org.jboss.arquillian.container.test.api.Deployment;
22-
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
2318
import org.jboss.shrinkwrap.api.spec.WebArchive;
2419
import org.testng.annotations.Test;
2520

21+
import jakarta.inject.Inject;
22+
import jakarta.validation.ConstraintValidatorFactory;
23+
import jakarta.validation.ValidatorFactory;
24+
2625
/**
2726
* @author Hardy Ferentschik
2827
*/
@@ -42,7 +41,7 @@ public static WebArchive createTestArchive() throws Exception {
4241
PingServiceImpl.class,
4342
PingableValidator.class
4443
)
45-
.addAsWebInfResource( EmptyAsset.INSTANCE, "beans.xml" );
44+
.addAsWebInfResource( BEANS_XML, "beans.xml" );
4645
}
4746

4847
@Test

integration/src/test/java/org/hibernate/validator/integration/cdi/DefaultInjectionUnitIT.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@
88

99
import static org.assertj.core.api.Assertions.assertThat;
1010

11-
import jakarta.enterprise.inject.spi.BeanManager;
12-
import javax.inject.Inject;
13-
import jakarta.validation.ValidatorFactory;
14-
1511
import org.hibernate.validator.integration.AbstractArquillianIT;
1612
import org.jboss.arquillian.container.test.api.Deployment;
17-
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
1813
import org.jboss.shrinkwrap.api.spec.WebArchive;
1914
import org.testng.annotations.Test;
2015

16+
import jakarta.enterprise.inject.spi.BeanManager;
17+
import jakarta.inject.Inject;
18+
import jakarta.validation.ValidatorFactory;
19+
2120
/**
2221
* @author Hardy Ferentschik
2322
*/
@@ -33,7 +32,7 @@ public class DefaultInjectionUnitIT extends AbstractArquillianIT {
3332
@Deployment
3433
public static WebArchive createTestArchive() throws Exception {
3534
return buildTestArchive( WAR_FILE_NAME )
36-
.addAsWebInfResource( EmptyAsset.INSTANCE, "beans.xml" );
35+
.addAsWebInfResource( BEANS_XML, "beans.xml" );
3736
}
3837

3938
@Test

integration/src/test/java/org/hibernate/validator/integration/cdi/QualifiedInjectionUnitIT.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,18 @@
1010

1111
import java.io.Serializable;
1212

13-
import jakarta.enterprise.context.SessionScoped;
14-
import javax.inject.Inject;
15-
import jakarta.validation.Validator;
16-
import jakarta.validation.ValidatorFactory;
17-
1813
import org.hibernate.validator.cdi.HibernateValidator;
1914
import org.hibernate.validator.integration.AbstractArquillianIT;
2015
import org.hibernate.validator.testutil.TestForIssue;
2116
import org.jboss.arquillian.container.test.api.Deployment;
22-
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
2317
import org.jboss.shrinkwrap.api.spec.WebArchive;
2418
import org.testng.annotations.Test;
2519

20+
import jakarta.enterprise.context.SessionScoped;
21+
import jakarta.inject.Inject;
22+
import jakarta.validation.Validator;
23+
import jakarta.validation.ValidatorFactory;
24+
2625
/**
2726
* @author Hardy Ferentschik
2827
*/
@@ -43,7 +42,7 @@ public class QualifiedInjectionUnitIT extends AbstractArquillianIT {
4342
@Deployment
4443
public static WebArchive createTestArchive() throws Exception {
4544
return buildTestArchive( WAR_FILE_NAME )
46-
.addAsWebInfResource( EmptyAsset.INSTANCE, "beans.xml" );
45+
.addAsWebInfResource( BEANS_XML, "beans.xml" );
4746
}
4847

4948
@Test

0 commit comments

Comments
 (0)