diff --git a/pom.xml b/pom.xml index 7a1ee090d2..313ef00f6d 100644 --- a/pom.xml +++ b/pom.xml @@ -168,8 +168,8 @@ 22.0.1 - 1.8.0.Final - 7.10.1 + 1.7.0.Alpha10 + 6.14.3 3.8.0 4.13.2 @@ -178,7 +178,7 @@ 4.0.21 33.1.0-jre 6.1.6 - 4.0.0.Final + 3.0.2.Final 2.17.0 2.17.0 1.14.13 diff --git a/tck-runner/pom.xml b/tck-runner/pom.xml index a52826c02d..6835923feb 100644 --- a/tck-runner/pom.xml +++ b/tck-runner/pom.xml @@ -158,14 +158,27 @@ org.apache.maven.plugins maven-surefire-plugin - - - ${tck.suite.file} - - - ${validation.provider} - - + + + + + + + + + + + + + + local + + + ${validation.provider} + + + + org.apache.maven.plugins @@ -198,9 +211,9 @@ - LocalSecurityManagerTesting + Local - -DincludeJavaFXTests=true -Djava.security.manager -Djava.security.policy=${project.build.directory}/test-classes/test.policy -Duser.language=en -Duser.country=US + diff --git a/tck-runner/src/test/java/org/hibernate/validator/tckrunner/securitymanager/debug/BootstrapConfigurationTest.java b/tck-runner/src/test/java/org/hibernate/validator/tckrunner/securitymanager/debug/BootstrapConfigurationTest.java new file mode 100644 index 0000000000..a751b21acd --- /dev/null +++ b/tck-runner/src/test/java/org/hibernate/validator/tckrunner/securitymanager/debug/BootstrapConfigurationTest.java @@ -0,0 +1,105 @@ +/** + * Jakarta Bean Validation TCK + *

+ * License: Apache License, Version 2.0 + * See the license.txt file in the root directory or . + */ +package org.hibernate.validator.tckrunner.securitymanager.debug; + +import static org.hibernate.beanvalidation.tck.util.TestUtil.asSet; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; + +import java.io.File; +import java.net.URL; +import java.util.Arrays; +import java.util.EnumSet; + +import org.hibernate.beanvalidation.tck.tests.AbstractTCKTest; +import org.hibernate.beanvalidation.tck.util.TestUtil; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.shrinkwrap.api.spec.WebArchive; + +import com.beust.jcommander.JCommander; +import jakarta.validation.BootstrapConfiguration; +import jakarta.validation.executable.ExecutableType; +import org.assertj.core.api.Assert; +import org.testng.annotations.Test; + +/** + * @author Gunnar Morling + */ +public class BootstrapConfigurationTest extends AbstractTCKTest { + + @Deployment + public static WebArchive createTestArchive() { + URL[] libs = new URL[] { + Assert.class.getProtectionDomain() + .getCodeSource() + .getLocation(), + JCommander.class.getProtectionDomain() + .getCodeSource() + .getLocation() + }; + for ( URL lib : libs ) { + System.err.println( lib ); + File file = new File( lib.getFile() ); + System.err.println( "file.exists() = " + file.exists() ); + System.err.println( "file.isFile() = " + file.isFile() ); + System.err.println( "file.listFiles() = " + Arrays.toString( file.listFiles() ) ); + } + + return webArchiveBuilder() + .withTestClass( BootstrapConfigurationTest.class ) + .withValidationXml( "validation-BootstrapConfigurationTest.xml" ) + .build(); + } + + @Test + public void testGetBootstrapConfiguration() { + BootstrapConfiguration bootstrapConfiguration = TestUtil.getConfigurationUnderTest() + .getBootstrapConfiguration(); + + assertNotNull( bootstrapConfiguration ); + + assertNotNull( bootstrapConfiguration.getConstraintMappingResourcePaths() ); + assertEquals( + bootstrapConfiguration.getConstraintMappingResourcePaths(), + asSet( "mapping1", "mapping2" ) + ); + + assertEquals( + bootstrapConfiguration.getConstraintValidatorFactoryClassName(), + "com.acme.ConstraintValidatorFactory" + ); + assertEquals( + bootstrapConfiguration.getDefaultProviderClassName(), + "com.acme.ValidationProvider" + ); + assertEquals( + bootstrapConfiguration.getMessageInterpolatorClassName(), + "com.acme.MessageInterpolator" + ); + assertEquals( + bootstrapConfiguration.getParameterNameProviderClassName(), + "com.acme.ParameterNameProvider" + ); + + assertNotNull( bootstrapConfiguration.getProperties() ); + assertEquals( bootstrapConfiguration.getProperties().size(), 2 ); + assertEquals( bootstrapConfiguration.getProperties().get( "com.acme.Foo" ), "Bar" ); + assertEquals( bootstrapConfiguration.getProperties().get( "com.acme.Baz" ), "Qux" ); + + assertEquals( + bootstrapConfiguration.getTraversableResolverClassName(), + "com.acme.TraversableResolver" + ); + + assertNotNull( bootstrapConfiguration.getDefaultValidatedExecutableTypes() ); + assertEquals( + bootstrapConfiguration.getDefaultValidatedExecutableTypes(), + EnumSet.of( ExecutableType.CONSTRUCTORS, ExecutableType.NON_GETTER_METHODS ) + ); + } +} diff --git a/tck-runner/src/test/resources/org/hibernate/validator/tckrunner/securitymanager/debug/validation-BootstrapConfigurationTest.xml b/tck-runner/src/test/resources/org/hibernate/validator/tckrunner/securitymanager/debug/validation-BootstrapConfigurationTest.xml new file mode 100644 index 0000000000..65d93f5936 --- /dev/null +++ b/tck-runner/src/test/resources/org/hibernate/validator/tckrunner/securitymanager/debug/validation-BootstrapConfigurationTest.xml @@ -0,0 +1,25 @@ + + + + + com.acme.ValidationProvider + com.acme.MessageInterpolator + com.acme.TraversableResolver + com.acme.ConstraintValidatorFactory + com.acme.ParameterNameProvider + mapping1 + mapping2 + Bar + Qux +