tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From radcor...@apache.org
Subject svn commit: r1852142 [2/3] - in /tomee/deps/branches/bval-2: ./ bundle/ bundle/src/main/appended-resources/META-INF/ bval-extras/ bval-jsr/ bval-jsr/src/main/appended-resources/META-INF/ bval-jsr/src/main/java/org/apache/bval/constraints/ bval-jsr/src/...
Date Fri, 25 Jan 2019 15:27:44 GMT
Modified: tomee/deps/branches/bval-2/bval-jsr/src/main/java/org/apache/bval/jsr/xml/ValidationParser.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/main/java/org/apache/bval/jsr/xml/ValidationParser.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/main/java/org/apache/bval/jsr/xml/ValidationParser.java (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/main/java/org/apache/bval/jsr/xml/ValidationParser.java Fri Jan 25 15:27:43 2019
@@ -41,6 +41,7 @@ import org.apache.bval.jsr.BootstrapConf
 import org.apache.bval.jsr.ConfigurationImpl;
 import org.apache.bval.jsr.metadata.XmlBuilder;
 import org.apache.bval.util.Exceptions;
+import org.apache.bval.util.Validate;
 import org.apache.bval.util.reflection.Reflection;
 import org.apache.commons.weaver.privilizer.Privileged;
 import org.apache.commons.weaver.privilizer.Privilizing;
@@ -65,11 +66,22 @@ public class ValidationParser {
             "META-INF/validation-configuration-2.0.xsd")
         .build();
 
-    public static String getValidationXmlFile(String file) {
+    private static String getValidationXmlFile(String file) {
         return file == null ? DEFAULT_VALIDATION_XML_FILE : file;
     }
 
-    public static BootstrapConfiguration processValidationConfig(final String file,
+    private static Map<String, String> toMap(final List<PropertyType> property) {
+        return property == null || property.isEmpty() ? Collections.emptyMap()
+            : property.stream().collect(Collectors.toMap(PropertyType::getName, PropertyType::getValue));
+    }
+
+    private final ClassLoader loader;
+
+    public ValidationParser(ClassLoader loader) {
+        this.loader = Validate.notNull(loader, null);
+    }
+
+    public BootstrapConfiguration processValidationConfig(final String file,
         final ConfigurationImpl targetConfig) {
         final ValidationConfigType xmlConfig = parseXmlConfig(file);
         if (xmlConfig == null) {
@@ -99,28 +111,7 @@ public class ValidationParser {
             xmlConfig.getClockProvider(), new HashSet<>(xmlConfig.getValueExtractor()));
     }
 
-    private static Map<String, String> toMap(final List<PropertyType> property) {
-        return property == null || property.isEmpty() ? Collections.emptyMap()
-            : property.stream().collect(Collectors.toMap(PropertyType::getName, PropertyType::getValue));
-    }
-
-    @Privileged
-    private static ValidationConfigType parseXmlConfig(final String validationXmlFile) {
-        try (InputStream inputStream = getInputStream(getValidationXmlFile(validationXmlFile))) {
-            if (inputStream == null) {
-                log.log(Level.FINEST,
-                    String.format("No %s found. Using annotation based configuration only.", validationXmlFile));
-                return null;
-            }
-            log.log(Level.FINEST, String.format("%s found.", validationXmlFile));
-
-            return SCHEMA_MANAGER.unmarshal(new InputSource(inputStream), ValidationConfigType.class);
-        } catch (Exception e) {
-            throw Exceptions.create(ValidationException::new, e, "Unable to parse %s", validationXmlFile);
-        }
-    }
-
-    public static InputStream open(String mappingFileName) {
+    public InputStream open(String mappingFileName) {
         if (mappingFileName.charAt(0) == '/') {
             // Classloader needs a path without a starting /
             mappingFileName = mappingFileName.substring(1);
@@ -136,14 +127,26 @@ public class ValidationParser {
         }
     }
 
-    static InputStream getInputStream(final String path) throws IOException {
-        final ClassLoader loader = Reflection.getClassLoader(ValidationParser.class);
+    InputStream getInputStream(final String path) throws IOException {
         final List<URL> urls = Collections.list(loader.getResources(path));
         Exceptions.raiseIf(urls.stream().distinct().count() > 1, ValidationException::new,
             "More than one %s is found in the classpath", path);
         return urls.isEmpty() ? null : urls.get(0).openStream();
     }
 
-    private ValidationParser() {
+    @Privileged
+    private ValidationConfigType parseXmlConfig(final String validationXmlFile) {
+        try (InputStream inputStream = getInputStream(getValidationXmlFile(validationXmlFile))) {
+            if (inputStream == null) {
+                log.log(Level.FINEST,
+                    String.format("No %s found. Using annotation based configuration only.", validationXmlFile));
+                return null;
+            }
+            log.log(Level.FINEST, String.format("%s found.", validationXmlFile));
+
+            return SCHEMA_MANAGER.unmarshal(new InputSource(inputStream), ValidationConfigType.class);
+        } catch (Exception e) {
+            throw Exceptions.create(ValidationException::new, e, "Unable to parse %s", validationXmlFile);
+        }
     }
 }

Modified: tomee/deps/branches/bval-2/bval-jsr/src/main/java/org/apache/bval/util/Exceptions.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/main/java/org/apache/bval/util/Exceptions.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/main/java/org/apache/bval/util/Exceptions.java (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/main/java/org/apache/bval/util/Exceptions.java Fri Jan 25 15:27:43 2019
@@ -83,7 +83,7 @@ public class Exceptions {
     public static <E extends Exception> void raiseIf(boolean condition, Function<? super String, ? extends E> fn,
         String format, Consumer<FormatArgs> argsProvider) throws E {
         if (condition) {
-            raise(fn, message(format,argsProvider));
+            raise(fn, message(format, argsProvider));
         }
     }
 

Modified: tomee/deps/branches/bval-2/bval-jsr/src/main/java/org/apache/bval/util/reflection/Reflection.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/main/java/org/apache/bval/util/reflection/Reflection.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/main/java/org/apache/bval/util/reflection/Reflection.java (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/main/java/org/apache/bval/util/reflection/Reflection.java Fri Jan 25 15:27:43 2019
@@ -35,6 +35,7 @@ import java.util.Optional;
 import java.util.Set;
 import java.util.function.Function;
 
+import org.apache.bval.util.Validate;
 import org.apache.commons.weaver.privilizer.Privilizing;
 
 /**
@@ -219,18 +220,32 @@ public class Reflection {
     }
 
     /**
-     * Get a usable {@link ClassLoader}: that of {@code clazz} if {@link Thread#getContextClassLoader()} returns {@code null}.
+     * Get a {@link ClassLoader} preferring that of {@code clazz} over
+     * {@link Thread#getContextClassLoader()} of current {@link Thread}.
+     * 
      * @param clazz
      * @return {@link ClassLoader}
      */
-    public static ClassLoader getClassLoader(final Class<?> clazz) {
-        final ClassLoader cl = Thread.currentThread().getContextClassLoader();
-        return cl == null ? clazz.getClassLoader() : cl;
+    public static ClassLoader loaderFromClassOrThread(final Class<?> clazz) {
+        return Optional.of(clazz).map(Class::getClassLoader)
+            .orElseGet(() -> Thread.currentThread().getContextClassLoader());
+    }
+
+    /**
+     * Get a {@link ClassLoader} preferring
+     * {@link Thread#getContextClassLoader()} of current {@link Thread} over
+     * that of {@code fallbackClass}.
+     * 
+     * @param fallbackClass
+     * @return {@link ClassLoader}
+     */
+    public static ClassLoader loaderFromThreadOrClass(final Class<?> fallbackClass) {
+        return Optional.of(Thread.currentThread()).map(Thread::getContextClassLoader)
+            .orElseGet(() -> Validate.notNull(fallbackClass).getClassLoader());
     }
 
     public static Class<?> toClass(String className) throws ClassNotFoundException {
-        ClassLoader cl = getClassLoader(Reflection.class);
-        return toClass(className, cl);
+        return toClass(className, loaderFromThreadOrClass(Reflection.class));
     }
 
     /**
@@ -251,10 +266,9 @@ public class Reflection {
      *
      * @throws RuntimeException on load error
      */
-    public static Class<?> toClass(String className, boolean resolve, ClassLoader loader) throws ClassNotFoundException {
-        if (className == null) {
-            throw new NullPointerException("className == null");
-        }
+    public static Class<?> toClass(String className, boolean resolve, ClassLoader loader)
+        throws ClassNotFoundException {
+        Validate.notNull(className, "className was null");
 
         // array handling
         int dims = 0;
@@ -276,7 +290,6 @@ public class Reflection {
                 }
             }
         }
-
         if (dims > 0) {
             StringBuilder buf = new StringBuilder(className.length() + dims + 2);
             for (int i = 0; i < dims; i++) {
@@ -291,7 +304,6 @@ public class Reflection {
             }
             className = buf.toString();
         }
-
         if (loader == null) {
             loader = Thread.currentThread().getContextClassLoader();
         }
@@ -417,7 +429,7 @@ public class Reflection {
         try {
             return cls.getConstructor().newInstance();
         } catch (final Exception ex) {
-            throw new RuntimeException("Cannot instantiate : " + cls, ex);
+            throw new IllegalArgumentException("Cannot instantiate : " + cls, ex);
         }
     }
 

Modified: tomee/deps/branches/bval-2/bval-jsr/src/main/resources/org/apache/bval/jsr/ValidationMessages.properties
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/main/resources/org/apache/bval/jsr/ValidationMessages.properties?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/main/resources/org/apache/bval/jsr/ValidationMessages.properties (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/main/resources/org/apache/bval/jsr/ValidationMessages.properties Fri Jan 25 15:27:43 2019
@@ -18,19 +18,28 @@
 # The properties listed below are resolved by the default message resolver.
 
 # standard
-javax.validation.constraints.Null.message=must be null
-javax.validation.constraints.NotNull.message=may not be null
 javax.validation.constraints.AssertTrue.message=must be true
 javax.validation.constraints.AssertFalse.message=must be false
-javax.validation.constraints.Min.message=must be greater than or equal to {value}
+javax.validation.constraints.DecimalMax.message=must be less than ${inclusive == true ? 'or equal to ' : ''}{value}
+javax.validation.constraints.DecimalMin.message=must be greater than ${inclusive == true ? 'or equal to ' : ''}{value}
+javax.validation.constraints.Digits.message=numeric value out of bounds	 (<{integer} digits>.<{fraction} digits> expected)
+javax.validation.constraints.Email.message=must be a well-formed email address
+javax.validation.constraints.Future.message=must be a future date
+javax.validation.constraints.FutureOrPresent.message=must be a date in the present or in the future
 javax.validation.constraints.Max.message=must be less than or equal to {value}
-javax.validation.constraints.Size.message=size must be between {min} and {max}
-javax.validation.constraints.Digits.message=numeric value out of bounds (<{integer} digits>.<{fraction} digits> expected)
+javax.validation.constraints.Min.message=must be greater than or equal to {value}
+javax.validation.constraints.Negative.message=must be less than 0
+javax.validation.constraints.NegativeOrZero.message=must be less than or equal to 0
+javax.validation.constraints.NotBlank.message=must not be blank
+javax.validation.constraints.NotEmpty.message=must not be empty
+javax.validation.constraints.NotNull.message=may not be null
+javax.validation.constraints.Null.message=must be null
 javax.validation.constraints.Past.message=must be a past date
-javax.validation.constraints.Future.message=must be a future date
+javax.validation.constraints.PastOrPresent.message=must be a date in the past or in the present
+javax.validation.constraints.Positive.message=must be greater than 0
+javax.validation.constraints.PositiveOrZero.message=must be greater than or equal to 0
 javax.validation.constraints.Pattern.message=must match the following regular expression: {regexp}
-javax.validation.constraints.DecimalMax.message=must be less than or equal to {value}
-javax.validation.constraints.DecimalMin.message=must be greater than or equal to {value}
+javax.validation.constraints.Size.message=size must be between {min} and {max}
 
 # additional built-ins
 org.apache.bval.constraints.NotEmpty.message=may not be empty

Modified: tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/BeanDescriptorTest.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/BeanDescriptorTest.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/BeanDescriptorTest.java (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/BeanDescriptorTest.java Fri Jan 25 15:27:43 2019
@@ -23,6 +23,9 @@ import static java.lang.annotation.Eleme
 import static java.lang.annotation.ElementType.TYPE;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
 import java.lang.annotation.Documented;
@@ -165,6 +168,19 @@ public class BeanDescriptorTest extends
         assertEquals("Incorrect number of descriptors", 1, constraints.size());
     }
 
+    @Test
+    public void testDescriptorCaching() {
+        // constrained
+        final BeanDescriptor personDescriptor = validator.getConstraintsForClass(Person.class);
+        assertNotNull(personDescriptor);
+        assertSame(personDescriptor, validator.getConstraintsForClass(Person.class));
+
+        // unconstrained
+        final BeanDescriptor objectDescriptor = validator.getConstraintsForClass(Object.class);
+        assertNotNull(objectDescriptor);
+        assertNotSame(objectDescriptor, validator.getConstraintsForClass(Object.class));
+    }
+
     public static class Form {
         @NotNull
         public String name;

Modified: tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/DefaultMessageInterpolatorTest.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/DefaultMessageInterpolatorTest.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/DefaultMessageInterpolatorTest.java (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/DefaultMessageInterpolatorTest.java Fri Jan 25 15:27:43 2019
@@ -16,82 +16,132 @@
  */
 package org.apache.bval.jsr;
 
+import static org.hamcrest.CoreMatchers.anyOf;
+import static org.hamcrest.CoreMatchers.equalTo;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
-
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeThat;
+import static org.junit.Assume.assumeTrue;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.when;
+
+import java.lang.annotation.Annotation;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Arrays;
+import java.util.List;
 import java.util.Locale;
+import java.util.Objects;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
 
+import javax.el.ExpressionFactory;
 import javax.validation.MessageInterpolator;
 import javax.validation.Validator;
+import javax.validation.constraints.Digits;
 import javax.validation.constraints.Pattern;
 import javax.validation.metadata.ConstraintDescriptor;
 
+import org.apache.bval.constraints.NotEmpty;
+import org.apache.bval.jsr.ApacheValidatorConfiguration;
 import org.apache.bval.jsr.example.Author;
 import org.apache.bval.jsr.example.PreferredGuest;
+import org.junit.After;
+import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+import org.mockito.Mockito;
 
 /**
  * MessageResolverImpl Tester.
  */
+@RunWith(Parameterized.class)
 public class DefaultMessageInterpolatorTest {
+    @Parameters(name="{0}")
+    public static List<Object[]> generateParameters(){
+        return Arrays.asList(new Object[] { "default", null },
+            new Object[] { "ri", "com.sun.el.ExpressionFactoryImpl" },
+            new Object[] { "tomcat", "org.apache.el.ExpressionFactoryImpl" },
+            new Object[] { "juel", "de.odysseus.el.ExpressionFactoryImpl" },
+            new Object[] { "invalid", "java.lang.Object" });
+    }
+
+    @AfterClass
+    public static void cleanup() {
+        System.clearProperty(ExpressionFactory.class.getName());
+    }
 
+    private static Predicate<ConstraintDescriptor<?>> forConstraintType(Class<? extends Annotation> type) {
+        return d -> Objects.equals(type, d.getAnnotation().annotationType());
+    }
+
+    private String elImpl;
+    private String elFactory;
     private DefaultMessageInterpolator interpolator;
+    private Validator validator;
+    private boolean elAvailable;
+    private ClassLoader originalClassLoader;
+
+    public DefaultMessageInterpolatorTest(String elImpl, String elFactory) {
+        this.elImpl = elImpl;
+        this.elFactory = elFactory;
+    }
 
     @Before
     public void setUp() throws Exception {
+        // store and replace CCL to sidestep EL factory caching
+        originalClassLoader = Thread.currentThread().getContextClassLoader();
+        Thread.currentThread().setContextClassLoader(new URLClassLoader(new URL[] {}, originalClassLoader));
+        
+        try {
+            Class<?> elFactoryClass;
+            if (elFactory == null) {
+                elFactoryClass = ExpressionFactory.class;
+                System.clearProperty(ExpressionFactory.class.getName());
+            } else {
+                elFactoryClass = Class.forName(elFactory);
+                System.setProperty(ExpressionFactory.class.getName(), elFactory);
+            }
+            assertTrue(elFactoryClass.isInstance(ExpressionFactory.newInstance()));
+            elAvailable = true;
+        } catch (Exception e) {
+            elAvailable = false;
+        }
         interpolator = new DefaultMessageInterpolator();
         interpolator.setLocale(Locale.ENGLISH);
+        validator = ApacheValidatorFactory.getDefault().getValidator();
     }
 
-    @Test
-    public void testCreateResolver() {
-
-        final Validator gvalidator = getValidator();
-
-        assertFalse(gvalidator.getConstraintsForClass(PreferredGuest.class)
-            .getConstraintsForProperty("guestCreditCardNumber").getConstraintDescriptors().isEmpty());
-
-        MessageInterpolator.Context ctx = new MessageInterpolator.Context() {
-
-            @Override
-            public ConstraintDescriptor<?> getConstraintDescriptor() {
-                return gvalidator.getConstraintsForClass(PreferredGuest.class)
-                    .getConstraintsForProperty("guestCreditCardNumber").getConstraintDescriptors().iterator().next();
-            }
+    @After
+    public void tearDownEL() {
+        assumeTrue(originalClassLoader != null);
+        Thread.currentThread().setContextClassLoader(originalClassLoader);
+    }
 
-            @Override
-            public Object getValidatedValue() {
-                return "12345678";
-            }
+    @Test
+    public void testInterpolateFromValidationResources() {
+        String msg = interpolator.interpolate("{validator.creditcard}",
+            context("12345678",
+                () -> validator.getConstraintsForClass(PreferredGuest.class)
+                    .getConstraintsForProperty("guestCreditCardNumber").getConstraintDescriptors().stream()
+                    .filter(forConstraintType(Digits.class)).findFirst()
+                    .orElseThrow(() -> new AssertionError("expected constraint missing"))));
 
-            @Override
-            public <T> T unwrap(Class<T> type) {
-                return null;
-            }
-        };
-        String msg = interpolator.interpolate("{validator.creditcard}", ctx);
         assertEquals("credit card is not valid", msg);
+    }
 
-        ctx = new MessageInterpolator.Context() {
-            @Override
-            public ConstraintDescriptor<?> getConstraintDescriptor() {
-                return gvalidator.getConstraintsForClass(Author.class).getConstraintsForProperty("lastName")
-                    .getConstraintDescriptors().iterator().next();
-            }
-
-            @Override
-            public Object getValidatedValue() {
-                return "";
-            }
-
-            @Override
-            public <T> T unwrap(Class<T> type) {
-                return null;
-            }
-        };
+    @Test
+    public void testInterpolateFromDefaultResources() {
+        String msg = interpolator.interpolate("{org.apache.bval.constraints.NotEmpty.message}",
+            context("",
+                () -> validator.getConstraintsForClass(Author.class).getConstraintsForProperty("lastName")
+                    .getConstraintDescriptors().stream().filter(forConstraintType(NotEmpty.class)).findFirst()
+                    .orElseThrow(() -> new AssertionError("expected constraint missing"))));
 
-        msg = interpolator.interpolate("{org.apache.bval.constraints.NotEmpty.message}", ctx);
         assertEquals("may not be empty", msg);
     }
 
@@ -101,57 +151,178 @@ public class DefaultMessageInterpolatorT
      */
     @Test
     public void testReplacementWithSpecialChars() {
+        // Try to interpolate an annotation attribute containing $
+        String idNumberResult = this.interpolator.interpolate("Id number should match {regexp}",
+            context("12345678",
+                () -> validator.getConstraintsForClass(Person.class).getConstraintsForProperty("idNumber")
+                    .getConstraintDescriptors().stream().filter(forConstraintType(Pattern.class)).findFirst()
+                    .orElseThrow(() -> new AssertionError("expected constraint missing"))));
 
-        final Validator validator = getValidator();
-        MessageInterpolator.Context ctx;
+        assertEquals("Incorrect message interpolation when $ is in an attribute", "Id number should match ....$",
+            idNumberResult);
 
-        // Try to interpolate an annotation attribute containing $
-        ctx = new MessageInterpolator.Context() {
+        // Try to interpolate an annotation attribute containing \
+        String otherIdResult = this.interpolator.interpolate("Other id should match {regexp}",
+            context("12345678",
+                () -> validator.getConstraintsForClass(Person.class).getConstraintsForProperty("otherId")
+                    .getConstraintDescriptors().stream().filter(forConstraintType(Pattern.class)).findFirst()
+                    .orElseThrow(() -> new AssertionError("expected constraint missing"))));
 
-            @Override
-            public ConstraintDescriptor<?> getConstraintDescriptor() {
-                return validator.getConstraintsForClass(Person.class).getConstraintsForProperty("idNumber")
-                    .getConstraintDescriptors().iterator().next();
-            }
+        assertEquals("Incorrect message interpolation when \\ is in an attribute value", "Other id should match .\\n",
+            otherIdResult);
+    }
 
-            @Override
-            public Object getValidatedValue() {
-                return "12345678";
-            }
+    @Test
+    public void testRecursiveInterpolation() {
+        String msg = this.interpolator.interpolate("{recursive.interpolation.1}",
+            context("12345678",
+                () -> validator.getConstraintsForClass(Person.class).getConstraintsForProperty("idNumber")
+                    .getConstraintDescriptors().stream().filter(forConstraintType(Pattern.class)).findFirst()
+                    .orElseThrow(() -> new AssertionError("expected constraint missing"))));
 
-            @Override
-            public <T> T unwrap(Class<T> type) {
-                return null;
-            }
-        };
+        assertEquals("must match \"....$\"", msg);
+    }
 
-        String result = this.interpolator.interpolate("Id number should match {regexp}", ctx);
-        assertEquals("Incorrect message interpolation when $ is in an attribute", "Id number should match ....$",
-            result);
+    @Test
+    public void testNoELAvailable() {
+        assumeThat(elImpl, equalTo("invalid"));
+        assertFalse(elAvailable);
+        
+        ApacheMessageContext context = context("12345678",
+            () -> validator.getConstraintsForClass(Person.class).getConstraintsForProperty("idNumber")
+            .getConstraintDescriptors().stream().filter(forConstraintType(Pattern.class)).findFirst()
+            .orElseThrow(() -> new AssertionError("expected constraint missing")));
+
+        when(context
+            .getConfigurationProperty(ApacheValidatorConfiguration.Properties.CUSTOM_TEMPLATE_EXPRESSION_EVALUATION))
+                .thenAnswer(invocation -> Boolean.toString(true));
 
-        // Try to interpolate an annotation attribute containing \
-        ctx = new MessageInterpolator.Context() {
+        assertEquals("${regexp.charAt(4)}", interpolator.interpolate("${regexp.charAt(4)}",
+            context));
+    }
 
-            @Override
-            public ConstraintDescriptor<?> getConstraintDescriptor() {
-                return validator.getConstraintsForClass(Person.class).getConstraintsForProperty("otherId")
-                    .getConstraintDescriptors().iterator().next();
-            }
+    @Test
+    public void testDisallowCustomTemplateExpressionEvaluationByDefault() {
+        assumeTrue(elAvailable);
 
-            @Override
-            public Object getValidatedValue() {
-                return "12345678";
-            }
+        assertEquals("${regexp.charAt(4)}", interpolator.interpolate("${regexp.charAt(4)}",
+            context("12345678",
+                () -> validator.getConstraintsForClass(Person.class).getConstraintsForProperty("idNumber")
+                .getConstraintDescriptors().stream().filter(forConstraintType(Pattern.class)).findFirst()
+                .orElseThrow(() -> new AssertionError("expected constraint missing")))));
+    }
 
-            @Override
-            public <T> T unwrap(Class<T> type) {
-                return null;
-            }
-        };
+    @Test
+    public void testExpressionLanguageEvaluation() {
+        assumeTrue(elAvailable);
+        
+        final MessageInterpolator.Context context = context("12345678",
+            () -> validator.getConstraintsForClass(Person.class).getConstraintsForProperty("anotherValue")
+            .getConstraintDescriptors().stream().filter(forConstraintType(Pattern.class)).findFirst()
+            .orElseThrow(() -> new AssertionError("expected constraint missing")));
+        
+        assertEquals("Another value should match ....$",
+            interpolator.interpolate(context.getConstraintDescriptor().getMessageTemplate(), context));
+    }
 
-        result = this.interpolator.interpolate("Other id should match {regexp}", ctx);
-        assertEquals("Incorrect message interpolation when \\ is in an attribute value", "Other id should match .\\n",
-            result);
+    @Test
+    public void testMixedEvaluation() {
+        assumeTrue(elAvailable);
+
+        final MessageInterpolator.Context context = context("12345678",
+            () -> validator.getConstraintsForClass(Person.class).getConstraintsForProperty("mixedMessageValue")
+            .getConstraintDescriptors().stream().filter(forConstraintType(Pattern.class)).findFirst()
+            .orElseThrow(() -> new AssertionError("expected constraint missing")));
+        
+        assertEquals("Mixed message value of length 8 should match ....$",
+            interpolator.interpolate(context.getConstraintDescriptor().getMessageTemplate(), context));
+    }
+
+    @Test
+    public void testELEscapingTomcatJuel() {
+        assumeTrue(elAvailable);
+        assumeThat(elImpl, anyOf(equalTo("tomcat"), equalTo("juel")));
+
+        // not so much a test as an illustration that the specified EL implementations are seemingly confused by leading
+        // backslashes and treats the whole expression as literal. We could skip any literal text before the first
+        // non-escaped $, but that would only expose us to inconsistency for composite expressions containing more
+        // than one component EL expression
+
+        ApacheMessageContext context = context("12345678",
+            () -> validator.getConstraintsForClass(Person.class).getConstraintsForProperty("idNumber")
+            .getConstraintDescriptors().stream().filter(forConstraintType(Pattern.class)).findFirst()
+            .orElseThrow(() -> new AssertionError("expected constraint missing")));
+
+        when(context
+            .getConfigurationProperty(ApacheValidatorConfiguration.Properties.CUSTOM_TEMPLATE_EXPRESSION_EVALUATION))
+                .thenAnswer(invocation -> Boolean.toString(true));
+
+        assertEquals("${regexp.charAt(4)}", interpolator.interpolate("\\${regexp.charAt(4)}",
+            context));
+
+        assertEquals("${regexp.charAt(4)}", interpolator.interpolate("\\\\${regexp.charAt(4)}",
+            context));
+    }
+
+    @Test
+    public void testELEscapingRI() {
+        assumeTrue(elAvailable);
+        assumeThat(elImpl, equalTo("ri"));
+
+        ApacheMessageContext context = context("12345678",
+            () -> validator.getConstraintsForClass(Person.class).getConstraintsForProperty("idNumber")
+                .getConstraintDescriptors().stream().filter(forConstraintType(Pattern.class)).findFirst()
+                .orElseThrow(() -> new AssertionError("expected constraint missing")));
+
+        when(context
+            .getConfigurationProperty(ApacheValidatorConfiguration.Properties.CUSTOM_TEMPLATE_EXPRESSION_EVALUATION))
+        .thenAnswer(invocation -> Boolean.toString(true));
+
+        assertEquals("returns literal", "${regexp.charAt(4)}",
+            interpolator.interpolate("\\${regexp.charAt(4)}",
+                context));
+
+        assertEquals("returns literal \\ followed by $, later interpreted as an escape sequence", "$",
+            interpolator.interpolate("\\\\${regexp.charAt(4)}",
+                context));
+
+        assertEquals("returns literal \\ followed by .", "\\.",
+            interpolator.interpolate("\\\\${regexp.charAt(3)}",
+                context));
+    }
+
+    @Test
+    public void testEscapedELPattern() {
+        assertEquals("$must match \"....$\"",
+            interpolator.interpolate("\\${javax.validation.constraints.Pattern.message}",
+                context("12345678",
+                    () -> validator.getConstraintsForClass(Person.class).getConstraintsForProperty("idNumber")
+                        .getConstraintDescriptors().stream().filter(forConstraintType(Pattern.class)).findFirst()
+                        .orElseThrow(() -> new AssertionError("expected constraint missing")))));
+
+        assertEquals("$must match \"....$\"",
+            interpolator.interpolate("\\${javax.validation.constraints.Pattern.message}",
+                context("12345678",
+                    () -> validator.getConstraintsForClass(Person.class).getConstraintsForProperty("idNumber")
+                    .getConstraintDescriptors().stream().filter(forConstraintType(Pattern.class)).findFirst()
+                    .orElseThrow(() -> new AssertionError("expected constraint missing")))));
+
+        assertEquals("\\$must match \"....$\"",
+            interpolator.interpolate("\\\\\\${javax.validation.constraints.Pattern.message}",
+                context("12345678",
+                    () -> validator.getConstraintsForClass(Person.class).getConstraintsForProperty("idNumber")
+                    .getConstraintDescriptors().stream().filter(forConstraintType(Pattern.class)).findFirst()
+                    .orElseThrow(() -> new AssertionError("expected constraint missing")))));
+    }
+
+    @SuppressWarnings("unchecked")
+    private ApacheMessageContext context(Object validatedValue, Supplier<ConstraintDescriptor<?>> descriptor) {
+        final ApacheMessageContext result = Mockito.mock(ApacheMessageContext.class);
+        when(result.unwrap(any(Class.class)))
+            .thenAnswer(invocation -> invocation.getArgumentAt(0, Class.class).cast(result));
+        when(result.getValidatedValue()).thenReturn(validatedValue);
+        when(result.getConstraintDescriptor()).thenAnswer(invocation -> descriptor.get());
+        return result;
     }
 
     public static class Person {
@@ -162,9 +333,10 @@ public class DefaultMessageInterpolatorT
         @Pattern(message = "Other id should match {regexp}", regexp = ".\\n")
         public String otherId;
 
-    }
-
-    private Validator getValidator() {
-        return ApacheValidatorFactory.getDefault().getValidator();
+        @Pattern(message = "Another value should match ${regexp.intern()}", regexp = "....$")
+        public String anotherValue;
+        
+        @Pattern(message = "Mixed message value of length ${validatedValue.length()} should match {regexp}", regexp = "....$")
+        public String mixedMessageValue;
     }
 }

Added: tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/LiskovTest.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/LiskovTest.java?rev=1852142&view=auto
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/LiskovTest.java (added)
+++ tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/LiskovTest.java Fri Jan 25 15:27:43 2019
@@ -0,0 +1,59 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.bval.jsr;
+
+import java.lang.reflect.Method;
+
+import javax.validation.Validation;
+import javax.validation.ValidatorFactory;
+import javax.validation.constraints.NotNull;
+import javax.validation.executable.ExecutableValidator;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+@Ignore("requires some revisiting of Liskov impl - discuss in progress")
+public class LiskovTest {
+    @Test // this test was throwing a Liskov exception, here to ensure it is not the case
+    public void validateParams() throws NoSuchMethodException {
+        final Api service = new Impl();
+        try (final ValidatorFactory factory = Validation.buildDefaultValidatorFactory()) {
+            final ExecutableValidator validator = factory.getValidator().forExecutables();
+            final Method method = Api.class.getMethod("read", String.class);
+            validator.validateParameters(service, method, new Object[]{""});
+        }
+    }
+
+    public interface Api {
+        String read(@NotNull String key);
+    }
+
+    public static abstract class Base {
+        public String read(final String key) {
+            return null;
+        }
+    }
+
+    public static class Impl extends Base implements Api {
+        @Override
+        public String read(final String key) {
+            return super.read(key);
+        }
+    }
+}

Modified: tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/ValidationTest.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/ValidationTest.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/ValidationTest.java (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/ValidationTest.java Fri Jan 25 15:27:43 2019
@@ -38,6 +38,7 @@ import java.util.Set;
 
 import javax.validation.ConstraintViolation;
 import javax.validation.constraints.AssertTrue;
+import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Size;
 import javax.validation.groups.Default;
@@ -45,7 +46,7 @@ import javax.validation.metadata.BeanDes
 import javax.validation.metadata.ConstraintDescriptor;
 import javax.validation.metadata.PropertyDescriptor;
 
-import org.apache.bval.constraints.NotNullValidator;
+import org.apache.bval.constraints.NotEmptyValidatorForCharSequence;
 import org.apache.bval.jsr.example.AccessTestBusinessObject;
 import org.apache.bval.jsr.example.AccessTestBusinessObjectSub;
 import org.apache.bval.jsr.example.Address;
@@ -252,6 +253,8 @@ public class ValidationTest extends Vali
     @Test
     public void testGroups() {
         final Author author = new Author();
+        author.setFirstName("Wile");
+        author.setLastName("Coyote");
         author.setCompany("ACME");
         final Book book = new Book();
         book.setTitle("");
@@ -262,7 +265,7 @@ public class ValidationTest extends Vali
         // assuming an english locale, the interpolated message is returned
         for (ConstraintViolation<Book> constraintViolation : constraintViolations) {
             if (Book.class.equals(constraintViolation.getRootBean().getClass())) {
-                assertEquals("may not be empty", constraintViolation.getMessage());
+                assertEquals("must not be empty", constraintViolation.getMessage());
                 assertSame(book, constraintViolation.getRootBean());
 
                 // the offending property
@@ -649,21 +652,20 @@ public class ValidationTest extends Vali
         // property with no constraint
         assertNull(bookBeanDescriptor.getConstraintsForProperty("description"));
         PropertyDescriptor propertyDescriptor = bookBeanDescriptor.getConstraintsForProperty("title");
-        assertEquals(2, propertyDescriptor.getConstraintDescriptors().size());
+        assertEquals(1, propertyDescriptor.getConstraintDescriptors().size());
         assertEquals("title", propertyDescriptor.getPropertyName());
         // assuming the implementation returns the NotEmpty constraint first
         Iterator<ConstraintDescriptor<?>> iter = propertyDescriptor.getConstraintDescriptors().iterator();
         ConstraintDescriptor<?> constraintDescriptor = null;
         while (iter.hasNext()) {
             constraintDescriptor = iter.next();
-            if (constraintDescriptor.getAnnotation().annotationType().equals(NotNull.class)) {
+            if (constraintDescriptor.getAnnotation().annotationType().equals(NotEmpty.class)) {
                 break;
             }
-
         }
         assertNotNull(constraintDescriptor);
         assertEquals(1, constraintDescriptor.getGroups().size()); // "first"
-        assertEquals(NotNullValidator.class, constraintDescriptor.getConstraintValidatorClasses().get(0));
+        assertTrue(constraintDescriptor.getConstraintValidatorClasses().contains(NotEmptyValidatorForCharSequence.class));
         // assuming the implementation returns the Size constraint first
         propertyDescriptor = bookBeanDescriptor.getConstraintsForProperty("subtitle");
         Iterator<ConstraintDescriptor<?>> iterator = propertyDescriptor.getConstraintDescriptors().iterator();

Modified: tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/example/Book.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/example/Book.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/example/Book.java (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/example/Book.java Fri Jan 25 15:27:43 2019
@@ -18,16 +18,14 @@
  */
 package org.apache.bval.jsr.example;
 
-import org.apache.bval.constraints.NotEmpty;
-
 import javax.validation.GroupSequence;
 import javax.validation.Valid;
+import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Size;
 
 @GroupSequence({ First.class, Second.class, Book.class, Last.class })
 public class Book {
-    @NotNull(groups = First.class)
     @NotEmpty(groups = First.class)
     private String title;
 
@@ -87,4 +85,4 @@ public class Book {
         return 42;
     }
 
-}
\ No newline at end of file
+}

Modified: tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/extensions/MethodValidatorImplTest.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/extensions/MethodValidatorImplTest.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/extensions/MethodValidatorImplTest.java (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/extensions/MethodValidatorImplTest.java Fri Jan 25 15:27:43 2019
@@ -16,9 +16,16 @@
  */
 package org.apache.bval.jsr.extensions;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
+import java.util.List;
 
+import javax.validation.Valid;
 import javax.validation.Validation;
 import javax.validation.Validator;
 import javax.validation.constraints.NotNull;
@@ -29,10 +36,7 @@ import org.apache.bval.jsr.ApacheValidat
 import org.apache.bval.jsr.ValidatorImpl;
 import org.apache.bval.jsr.extensions.ExampleMethodService.Person;
 import org.junit.Ignore;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import org.junit.Test;
 
 /**
  * MethodValidatorImpl Tester.
@@ -42,15 +46,9 @@ import junit.framework.TestSuite;
  * @since <pre>11/11/2009</pre>
  */
 @SuppressWarnings({ "unchecked", "rawtypes" })
-public class MethodValidatorImplTest extends TestCase {
-    public MethodValidatorImplTest(String name) {
-        super(name);
-    }
-
-    public static Test suite() {
-        return new TestSuite(MethodValidatorImplTest.class);
-    }
+public class MethodValidatorImplTest {
 
+    @Test
     public void testUnwrap() {
         Validator v = getValidator();
         ValidatorImpl cv = v.unwrap(ValidatorImpl.class);
@@ -59,6 +57,7 @@ public class MethodValidatorImplTest ext
         assertNotNull(v.forExecutables());
     }
 
+    @Test
     public void testValidateMethodParameters() throws NoSuchMethodException {
         ExampleMethodService service = new ExampleMethodService();
         ExecutableValidator mv = getValidator().unwrap(ExecutableValidator.class);
@@ -73,6 +72,7 @@ public class MethodValidatorImplTest ext
         assertEquals(2, mv.validateParameters(service, method, params).size());
     }
 
+    @Test
     public void testValidateMoreMethodParameters() throws NoSuchMethodException {
 
         ExampleMethodService service = new ExampleMethodService();
@@ -99,6 +99,7 @@ public class MethodValidatorImplTest ext
         assertEquals(1, mv.validateParameters(service, echoMethod, echoParams).size());
     }
 
+    @Test
     public void testValidateConstructorParameters() throws NoSuchMethodException {
         ExampleMethodService service = new ExampleMethodService();
         ExecutableValidator mv = getValidator().unwrap(ExecutableValidator.class);
@@ -114,6 +115,7 @@ public class MethodValidatorImplTest ext
         assertEquals(2, mv.validateConstructorParameters(constructor, params).size());
     }
 
+    @Test
     public void testValidateReturnValue() throws NoSuchMethodException {
         ExampleMethodService service = new ExampleMethodService();
         ExecutableValidator mv = getValidator().unwrap(ExecutableValidator.class);
@@ -124,6 +126,7 @@ public class MethodValidatorImplTest ext
         assertEquals(1, mv.validateReturnValue(service, method, "").size());
     }
 
+    @Test
     public void testValidateMoreReturnValue() throws NoSuchMethodException {
         ExampleMethodService service = new ExampleMethodService();
         ExecutableValidator mv = getValidator().unwrap(ExecutableValidator.class);
@@ -139,6 +142,7 @@ public class MethodValidatorImplTest ext
         assertTrue(mv.validateReturnValue(service, echoMethod, returnedValue).isEmpty());
     }
 
+    @Test
     public void testValidateValidParam() throws NoSuchMethodException {
         ExampleMethodService service = new ExampleMethodService();
         ExecutableValidator mv = getValidator().unwrap(ExecutableValidator.class);
@@ -158,6 +162,7 @@ public class MethodValidatorImplTest ext
             mv.validateParameters(service, personOp1, new Object[] { null }).isEmpty());
     }
 
+    @Test
     public void testValidateNotNullValidParam() throws NoSuchMethodException {
         ExampleMethodService service = new ExampleMethodService();
         ExecutableValidator mv = getValidator().unwrap(ExecutableValidator.class);
@@ -187,6 +192,7 @@ public class MethodValidatorImplTest ext
      * <li>interface.class + impl.method</li>
      * </ul>
      */
+    @Test
     @Ignore("violates Liskov principle, forbidden by the spec - 4.5.5")
     public void validateImplementedMethod() throws NoSuchMethodException {
         UserMethodsImpl um = new UserMethodsImpl();
@@ -199,6 +205,13 @@ public class MethodValidatorImplTest ext
             mv.validateParameters(um, classMethod, new Object[] { "", "valid", null }).size());
     }
 
+    @Test
+    public void testBVal158() throws NoSuchMethodException {
+        TypeWithPseudoAccessor target = new TypeWithPseudoAccessor();
+        Method m = TypeWithPseudoAccessor.class.getMethod("getAll");
+        assertTrue(getValidator().forExecutables().validateParameters(target, m, new Object[] {}).isEmpty());
+    }
+
     public static interface UserMethods {
         void findUser(String param1, String param2, Integer param3);
     }
@@ -210,6 +223,14 @@ public class MethodValidatorImplTest ext
         }
     }
 
+    public static class TypeWithPseudoAccessor {
+        @Valid
+        @NotNull
+        public List<Object> getAll() {
+            throw new IllegalStateException();
+        }
+    }
+
     private Validator getValidator() {
         return Validation.byProvider(ApacheValidationProvider.class).configure().buildValidatorFactory().getValidator();
     }

Modified: tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/CollectionValidationTest.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/CollectionValidationTest.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/CollectionValidationTest.java (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/CollectionValidationTest.java Fri Jan 25 15:27:43 2019
@@ -18,7 +18,19 @@
  */
 package org.apache.bval.jsr.groups;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Locale;
+import java.util.Set;
+
+import javax.validation.ConstraintViolation;
+import javax.validation.Validation;
+import javax.validation.Validator;
+import javax.validation.ValidatorFactory;
+
 import org.apache.bval.jsr.DefaultMessageInterpolator;
 import org.apache.bval.jsr.example.Address;
 import org.apache.bval.jsr.example.Author;
@@ -29,19 +41,13 @@ import org.apache.bval.jsr.example.Emplo
 import org.apache.bval.jsr.example.Library;
 import org.apache.bval.jsr.example.Person;
 import org.apache.bval.jsr.util.TestUtils;
-
-import javax.validation.ConstraintViolation;
-import javax.validation.Validation;
-import javax.validation.Validator;
-import javax.validation.ValidatorFactory;
-import java.util.ArrayList;
-import java.util.Locale;
-import java.util.Set;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * Description: <br/>
  */
-public class CollectionValidationTest extends TestCase {
+public class CollectionValidationTest {
     static ValidatorFactory factory;
 
     static {
@@ -57,9 +63,8 @@ public class CollectionValidationTest ex
     /**
      * {@inheritDoc}
      */
-    @Override
+    @Before
     public void setUp() throws Exception {
-        super.setUp();
         validator = createValidator();
     }
 
@@ -72,6 +77,7 @@ public class CollectionValidationTest ex
         return factory.getValidator();
     }
 
+    @Test
     public void testValidateList() {
         Author author = new Author();
         author.setFirstName("Peter");
@@ -116,6 +122,7 @@ public class CollectionValidationTest ex
         assertNotNull(TestUtils.getViolation(violations, "addresses[2].addressline1"));
     }
 
+    @Test
     public void testValidateMapAndRedefinedDefaultGroupOnNonRootBean() {
         Library lib = new Library();
         lib.setLibraryName("Leibnitz Bibliothek");
@@ -127,7 +134,7 @@ public class CollectionValidationTest ex
         book1.setSubtitle("How it really works");
         Author hawking = new Author();
         hawking.setFirstName("Stephen");
-        hawking.setFirstName("Hawking");
+        hawking.setLastName("Hawking");
         hawking.setAddresses(new ArrayList<Address>(1));
         Address adr = new Address();
         adr.setAddressline1("Street 1");
@@ -174,6 +181,7 @@ public class CollectionValidationTest ex
         assertNotNull(TestUtils.getViolation(violations, "taggedBooks[science].author.addresses[0].city"));
     }
 
+    @Test
     public void testValidateArray() {
         Library lib = new Library();
         lib.setLibraryName("Unibibliothek");

Modified: tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/DefaultGroupSequenceTest.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/DefaultGroupSequenceTest.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/DefaultGroupSequenceTest.java (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/DefaultGroupSequenceTest.java Fri Jan 25 15:27:43 2019
@@ -18,18 +18,22 @@
  */
 package org.apache.bval.jsr.groups;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.fail;
 
-import javax.validation.GroupDefinitionException;
-import javax.validation.groups.Default;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.validation.GroupDefinitionException;
+import javax.validation.groups.Default;
+
+import org.junit.Test;
+
 /**
  * @author Hardy Ferentschik
  * @author Roman Stumm
  */
-public class DefaultGroupSequenceTest extends TestCase {
+public class DefaultGroupSequenceTest {
+    @Test
     public void testAssertDefaultGroupSequenceIsExpandableWithDefaultAtEndOfSequence() {
         // create a dummy sequence
         Group a = new Group(GroupA.class);
@@ -82,6 +86,7 @@ public class DefaultGroupSequenceTest ex
         chain.assertDefaultGroupSequenceIsExpandable(defaultSequence);
     }
 
+    @Test
     public void testAssertDefaulGroupSequenceIsExpandableWithDefaultAtBeginningOfSequence() {
         // create a dummy sequence
         Group a = new Group(GroupA.class);

Modified: tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/GroupSequenceTest.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/GroupSequenceTest.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/GroupSequenceTest.java (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/GroupSequenceTest.java Fri Jan 25 15:27:43 2019
@@ -115,7 +115,7 @@ public class GroupSequenceTest extends V
         constraintViolations = validator.validate(book, First.class, Second.class, Last.class);
         ConstraintViolation<?> constraintViolation = constraintViolations.iterator().next();
         assertEquals(1, constraintViolations.size());
-        assertEquals("may not be empty", constraintViolation.getMessage());
+        assertEquals("must not be empty", constraintViolation.getMessage());
         assertEquals(book, constraintViolation.getRootBean());
         assertEquals(book.getTitle(), constraintViolation.getInvalidValue());
         assertEquals("title", constraintViolation.getPropertyPath().toString());
@@ -165,7 +165,7 @@ public class GroupSequenceTest extends V
         constraintViolations = validator.validate(book, Book.All.class);
         ConstraintViolation<?> constraintViolation = constraintViolations.iterator().next();
         assertEquals(1, constraintViolations.size());
-        assertEquals("may not be null", constraintViolation.getMessage());
+        assertEquals("must not be empty", constraintViolation.getMessage());
         assertEquals(book, constraintViolation.getRootBean());
         assertEquals(book.getTitle(), constraintViolation.getInvalidValue());
         assertEquals("title", constraintViolation.getPropertyPath().toString());

Modified: tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/implicit/ImplicitGroupingTest.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/implicit/ImplicitGroupingTest.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/implicit/ImplicitGroupingTest.java (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/implicit/ImplicitGroupingTest.java Fri Jan 25 15:27:43 2019
@@ -18,25 +18,31 @@
  */
 package org.apache.bval.jsr.groups.implicit;
 
-import junit.framework.TestCase;
-import org.apache.bval.jsr.ApacheValidatorFactory;
-import org.apache.bval.jsr.util.TestUtils;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.Set;
 
 import javax.validation.ConstraintViolation;
 import javax.validation.Validator;
-import java.util.Set;
+
+import org.apache.bval.jsr.ApacheValidatorFactory;
+import org.apache.bval.jsr.util.TestUtils;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * Description: test spec chapter 3.4.4. Implicit grouping<br/>
  */
-public class ImplicitGroupingTest extends TestCase {
+public class ImplicitGroupingTest {
     private Validator validator;
 
-    @Override
-    protected void setUp() {
+    @Before
+    public void setUp() {
         validator = ApacheValidatorFactory.getDefault().getValidator();
     }
 
+    @Test
     public void testValidateImplicitGrouping() {
         Order order = new Order();
         // When an Order object is validated on the Default group, ...

Modified: tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/inheritance/GroupInheritanceTest.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/inheritance/GroupInheritanceTest.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/inheritance/GroupInheritanceTest.java (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/groups/inheritance/GroupInheritanceTest.java Fri Jan 25 15:27:43 2019
@@ -18,22 +18,27 @@
  */
 package org.apache.bval.jsr.groups.inheritance;
 
-import junit.framework.TestCase;
-import org.apache.bval.jsr.ApacheValidatorFactory;
-import org.apache.bval.jsr.util.TestUtils;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.Set;
 
 import javax.validation.ConstraintViolation;
 import javax.validation.Validator;
-import java.util.Set;
+
+import org.apache.bval.jsr.ApacheValidatorFactory;
+import org.apache.bval.jsr.util.TestUtils;
+import org.junit.Before;
+import org.junit.Test;
 
 /**
  * Description: <br/>
  */
-public class GroupInheritanceTest extends TestCase {
+public class GroupInheritanceTest {
     private Validator validator;
 
-    @Override
-    protected void setUp() {
+    @Before
+    public void setUp() {
         validator = ApacheValidatorFactory.getDefault().getValidator();
     }
 
@@ -44,6 +49,7 @@ public class GroupInheritanceTest extend
      *  * @NotNull on defaultCreditCard</pre>
      * because Default and Billable are superinterfaces of BuyInOneClick.
      */
+    @Test
     public void testValidGroupBuyInOneClick() {
         BillableUser user = new BillableUser();
 

Added: tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/util/LookBehindRegexHolderTest.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/util/LookBehindRegexHolderTest.java?rev=1852142&view=auto
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/util/LookBehindRegexHolderTest.java (added)
+++ tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/util/LookBehindRegexHolderTest.java Fri Jan 25 15:27:43 2019
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.bval.jsr.util;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class LookBehindRegexHolderTest {
+    private static final String MESSAGE_PARAMETER_PATTERN =
+        "(?<!(?:^|[^\\\\])(?:\\\\\\\\){0,%1$d}\\\\)\\{((?:[\\w\\.]|\\\\[\\{\\$\\}\\\\])+)\\}";
+
+    private LookBehindRegexHolder messageParameter;
+
+    @Before
+    public void setup() {
+        messageParameter = new LookBehindRegexHolder(MESSAGE_PARAMETER_PATTERN, 5, 5, this::computeInjectedRepetition);
+    }
+
+    @Test
+    public void testLookBehind() {
+        assertFound("{foo}");
+        assertFound("${foo}");
+        assertNotFound("\\{foo}");
+        assertNotFound("{foo\\}");
+        assertFound("\\\\{foo}");
+        assertFound("{foo\\\\}");
+        assertNotFound("\\\\\\{foo}");
+        assertNotFound("{foo\\\\\\}");
+        assertFound("\\${foo}");
+        assertFound("\\\\${foo}");
+        assertFound("\\\\\\${foo}");
+        assertFound("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\${foo}");
+        assertFound("{foo\\\\\\\\\\\\\\\\}");
+    }
+
+    private void assertFound(String msg) {
+        assertTrue(messageParameter.matcher(msg).find());
+    }
+
+    private void assertNotFound(String msg) {
+        assertFalse(messageParameter.matcher(msg).find());
+    }
+
+    @Test
+    public void testGrowth() {
+        assertEquals(5, messageParameter.getMaximumLength());
+        assertMessageSizeYieldsMaximumSize(5, 5);
+        assertMessageSizeYieldsMaximumSize(10, 6);
+        assertMessageSizeYieldsMaximumSize(10, 5);
+        assertMessageSizeYieldsMaximumSize(10, 9);
+        assertMessageSizeYieldsMaximumSize(35, 31);
+    }
+
+    private void assertMessageSizeYieldsMaximumSize(int max, int msg) {
+        messageParameter.matcher(new String(new byte[msg]));
+        assertEquals(max, messageParameter.getMaximumLength());
+        assertEquals(String.format(MESSAGE_PARAMETER_PATTERN, computeInjectedRepetition(max)),
+            messageParameter.getPattern());
+    }
+
+    private int computeInjectedRepetition(int maximumLength) {
+        return (maximumLength - 5) / 2;
+    }
+}

Modified: tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/util/TestUtils.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/util/TestUtils.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/util/TestUtils.java (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/util/TestUtils.java Fri Jan 25 15:27:43 2019
@@ -26,7 +26,6 @@ import java.lang.annotation.Annotation;
 import java.util.Collection;
 import java.util.Set;
 
-import javax.enterprise.inject.Vetoed;
 import javax.validation.ConstraintViolation;
 import javax.validation.metadata.ConstraintDescriptor;
 import javax.validation.metadata.ElementDescriptor.ConstraintFinder;

Modified: tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/xml/ValidationParserTest.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/xml/ValidationParserTest.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/xml/ValidationParserTest.java (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/test/java/org/apache/bval/jsr/xml/ValidationParserTest.java Fri Jan 25 15:27:43 2019
@@ -43,29 +43,33 @@ import org.apache.bval.jsr.Configuration
 import org.apache.bval.jsr.example.XmlEntitySampleBean;
 import org.apache.bval.jsr.resolver.SimpleTraversableResolver;
 import org.apache.bval.util.reflection.Reflection;
+import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 
 /**
  * ValidationParser Tester.
- *
- * @author <Authors name>
- * @version 1.0
- * @since <pre>11/25/2009</pre>
  */
 public class ValidationParserTest implements ApacheValidatorConfiguration.Properties {
 
     @Rule
     public ExpectedException thrown = ExpectedException.none();
 
+    private ValidationParser validationParser;
+
+    @Before
+    public void setup() {
+        validationParser = new ValidationParser(Reflection.loaderFromThreadOrClass(ValidationParserTest.class));
+    }
+
     @Test
     public void testGetInputStream() throws IOException {
-        assertNotNull(ValidationParser.getInputStream("sample-validation.xml"));
+        assertNotNull(validationParser.getInputStream("sample-validation.xml"));
 
         // make sure there are duplicate resources on the classpath before the next checks:
         final Enumeration<URL> resources =
-            Reflection.getClassLoader(ValidationParser.class).getResources("META-INF/MANIFEST.MF");
+            Reflection.loaderFromClassOrThread(ValidationParser.class).getResources("META-INF/MANIFEST.MF");
 
         assumeTrue(resources.hasMoreElements());
         resources.nextElement();
@@ -76,25 +80,25 @@ public class ValidationParserTest implem
     public void testGetNonUniqueInputStream() throws IOException {
         thrown.expect(ValidationException.class);
         thrown.expectMessage("More than ");
-        ValidationParser.getInputStream("META-INF/MANIFEST.MF"); // this is available in multiple jars hopefully
+        validationParser.getInputStream("META-INF/MANIFEST.MF"); // this is available in multiple jars hopefully
     }
 
     @Test
     public void testParse() {
         ConfigurationImpl config = new ConfigurationImpl(null, new ApacheValidationProvider());
-        ValidationParser.processValidationConfig("sample-validation.xml", config);
+        validationParser.processValidationConfig("sample-validation.xml", config);
     }
 
     @Test
     public void testParseV11() {
         ConfigurationImpl config = new ConfigurationImpl(null, new ApacheValidationProvider());
-        ValidationParser.processValidationConfig("sample-validation11.xml", config);
+        validationParser.processValidationConfig("sample-validation11.xml", config);
     }
 
     @Test
     public void testParseV20() {
         ConfigurationImpl config = new ConfigurationImpl(null, new ApacheValidationProvider());
-        ValidationParser.processValidationConfig("sample-validation2.xml", config);
+        validationParser.processValidationConfig("sample-validation2.xml", config);
     }
 
     @Test

Modified: tomee/deps/branches/bval-2/bval-jsr/src/test/resources/ValidationMessages.properties
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-jsr/src/test/resources/ValidationMessages.properties?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-jsr/src/test/resources/ValidationMessages.properties (original)
+++ tomee/deps/branches/bval-2/bval-jsr/src/test/resources/ValidationMessages.properties Fri Jan 25 15:27:43 2019
@@ -24,3 +24,5 @@ test.validator.creditcard=credit card is
 # custom messages (examples) for validation-api-1.0.CR1
 validator.creditcard=credit card is not valid
 
+recursive.interpolation.1={recursive.interpolation.2}
+recursive.interpolation.2={javax.validation.constraints.Pattern.message}

Modified: tomee/deps/branches/bval-2/bval-tck/pom.xml
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-tck/pom.xml?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-tck/pom.xml (original)
+++ tomee/deps/branches/bval-2/bval-tck/pom.xml Fri Jan 25 15:27:43 2019
@@ -23,15 +23,15 @@ under the License.
     <parent>
         <artifactId>bval-parent</artifactId>
         <groupId>org.apache.tomee.patch</groupId>
-        <version>2.0.0-nonfinal-57301f3-S1-SNAPSHOT</version>
+        <version>2.0.1-83f28d8-SNAPSHOT</version>
     </parent>
 
     <artifactId>bval-tck-runner</artifactId>
     <name>Apache BVal :: bval-tck (TCK Runner)</name>
-    <description>Aggregates dependencies and runs the JSR-349 TCK</description>
+    <description>Aggregates dependencies and runs the JSR-380 TCK</description>
 
     <properties>
-        <tck.version>2.0.3.Final</tck.version>
+        <tck.version>2.0.4.Final</tck.version>
         <owb.version>2.0.4</owb.version>
         <arquillian.version>1.1.11.Final</arquillian.version>
         <validation.provider>org.apache.bval.jsr.ApacheValidationProvider</validation.provider>
@@ -178,6 +178,14 @@ under the License.
                                     <name>validation.provider</name>
                                     <value>${validation.provider}</value>
                                 </property>
+                                <property>
+                                    <name>includeJavaFXTests</name>
+                                    <value>true</value>
+                                </property>
+                                <property>
+                                    <name>java.util.logging.config.file</name>
+                                    <value>${project.basedir}/src/test/resources/logging.properties</value>
+                                </property>
                             </systemProperties>
                             <parallel>methods</parallel>
                             <threadCount>4</threadCount>
@@ -203,6 +211,60 @@ under the License.
                     </plugin>
                 </plugins>
             </build>
+        </profile>
+        <profile>
+            <id>sigtest</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-dependency-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>extract-sigsfile</id>
+                                <phase>generate-test-sources</phase>
+                                <goals>
+                                    <goal>unpack</goal>
+                                </goals>
+                                <configuration>
+                                    <artifactItems>
+                                        <artifactItem>
+                                            <groupId>org.hibernate.beanvalidation.tck</groupId>
+                                            <artifactId>beanvalidation-tck-tests</artifactId>
+                                            <version>${tck.version}</version>
+                                        </artifactItem>
+                                    </artifactItems>
+                                    <includes>**/*.sig</includes>
+                                    <outputDirectory>${project.build.directory}/api-signature</outputDirectory>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.netbeans.tools</groupId>
+                        <artifactId>sigtest-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>sigtest</id>
+                                <phase>test</phase>
+                                <goals>
+                                   <goal>check</goal>
+                                </goals>
+                                <configuration>
+                                    <packages>javax.validation,javax.validation.bootstrap,javax.validation.constraints,
+                                        javax.validation.constraintvalidation,javax.validation.executable,javax.validation.groups,
+                                        javax.validation.metadata,javax.validation.spi,javax.validation.valueextraction
+                                    </packages>
+                                    <sigfile>${project.build.directory}/api-signature/validation-api-java8.sig</sigfile>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
         </profile>
     </profiles>
 </project>

Modified: tomee/deps/branches/bval-2/bval-tck/src/main/java/org/apache/bval/arquillian/BValArquillianExtension.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-tck/src/main/java/org/apache/bval/arquillian/BValArquillianExtension.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-tck/src/main/java/org/apache/bval/arquillian/BValArquillianExtension.java (original)
+++ tomee/deps/branches/bval-2/bval-tck/src/main/java/org/apache/bval/arquillian/BValArquillianExtension.java Fri Jan 25 15:27:43 2019
@@ -18,11 +18,35 @@
  */
 package org.apache.bval.arquillian;
 
+import java.util.logging.Logger;
+
+import org.jboss.arquillian.core.api.annotation.Observes;
 import org.jboss.arquillian.core.spi.LoadableExtension;
+import org.jboss.arquillian.test.spi.TestClass;
 import org.jboss.arquillian.test.spi.TestEnricher;
+import org.jboss.arquillian.test.spi.event.suite.AfterClass;
+import org.jboss.arquillian.test.spi.event.suite.BeforeClass;
 
 public class BValArquillianExtension implements LoadableExtension {
     public void register(final ExtensionBuilder builder) {
-        builder.service(TestEnricher.class, EJBEnricher.class);
+        builder.service(TestEnricher.class, EJBEnricher.class).observer(TestLogger.class);
+    }
+
+    public static class TestLogger {
+        private static final Logger LOGGER = Logger.getLogger(TestLogger.class.getName());
+
+        public void before(@Observes final BeforeClass beforeClass) {
+            LOGGER.info(() -> "Launching " + toName(beforeClass.getTestClass()));
+        }
+
+        public void after(@Observes final AfterClass beforeClass) {
+            LOGGER.info(() -> "Executed " + toName(beforeClass.getTestClass()));
+        }
+
+        private String toName(final TestClass testClass) {
+            return testClass.getJavaClass()
+                            .getName()
+                            .replace("org.hibernate.beanvalidation.tck.tests.", "o.h.b.t.t.");
+        }
     }
 }

Modified: tomee/deps/branches/bval-2/bval-tck/src/main/java/org/apache/bval/arquillian/EJBEnricher.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-tck/src/main/java/org/apache/bval/arquillian/EJBEnricher.java?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/bval-tck/src/main/java/org/apache/bval/arquillian/EJBEnricher.java (original)
+++ tomee/deps/branches/bval-2/bval-tck/src/main/java/org/apache/bval/arquillian/EJBEnricher.java Fri Jan 25 15:27:43 2019
@@ -1,19 +1,21 @@
 /*
-* JBoss, Home of Professional Open Source
-* Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.bval.arquillian;
 
 import org.jboss.arquillian.test.spi.TestEnricher;

Added: tomee/deps/branches/bval-2/bval-tck/src/main/java/org/apache/bval/arquillian/LogTckFormatter.java
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-tck/src/main/java/org/apache/bval/arquillian/LogTckFormatter.java?rev=1852142&view=auto
==============================================================================
--- tomee/deps/branches/bval-2/bval-tck/src/main/java/org/apache/bval/arquillian/LogTckFormatter.java (added)
+++ tomee/deps/branches/bval-2/bval-tck/src/main/java/org/apache/bval/arquillian/LogTckFormatter.java Fri Jan 25 15:27:43 2019
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.bval.arquillian;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.logging.LogRecord;
+import java.util.logging.SimpleFormatter;
+
+public class LogTckFormatter extends SimpleFormatter {
+    @Override
+    public String format(final LogRecord record) {
+        final String message = formatMessage(record);
+        String throwable = "";
+        if (record.getThrown() != null) {
+            final StringWriter sw = new StringWriter();
+            final PrintWriter pw = new PrintWriter(sw);
+            pw.println();
+            record.getThrown().printStackTrace(pw);
+            pw.close();
+            throwable = sw.toString();
+        }
+        return String.format("[%s] %s%n%s", record.getLevel(), message, throwable);
+    }
+}

Added: tomee/deps/branches/bval-2/bval-tck/src/test/resources/logging.properties
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/bval-tck/src/test/resources/logging.properties?rev=1852142&view=auto
==============================================================================
--- tomee/deps/branches/bval-2/bval-tck/src/test/resources/logging.properties (added)
+++ tomee/deps/branches/bval-2/bval-tck/src/test/resources/logging.properties Fri Jan 25 15:27:43 2019
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+.level= INFO
+handlers = java.util.logging.ConsoleHandler
+java.util.logging.ConsoleHandler.level = INFO
+java.util.logging.ConsoleHandler.formatter =org.apache.bval.arquillian.LogTckFormatter
+org.apache.webbeans.arquillian.standalone.OwbArquillianScannerService.level = WARNING

Modified: tomee/deps/branches/bval-2/pom.xml
URL: http://svn.apache.org/viewvc/tomee/deps/branches/bval-2/pom.xml?rev=1852142&r1=1852141&r2=1852142&view=diff
==============================================================================
--- tomee/deps/branches/bval-2/pom.xml (original)
+++ tomee/deps/branches/bval-2/pom.xml Fri Jan 25 15:27:43 2019
@@ -35,14 +35,17 @@
     <artifactId>bval-parent</artifactId>
     <name>Apache BVal :: bval-parent (Parent POM)</name>
     <packaging>pom</packaging>
-    <version>2.0.0-nonfinal-57301f3-S1-SNAPSHOT</version>
+    <version>2.0.1-83f28d8-SNAPSHOT</version>
 
     <description>Apache BVal parent pom</description>
 
     <properties>
-        <site.deploy.url>sftp://people.apache.org/home/${user.name}/public_html/bval/${project.version}/staging-site</site.deploy.url>
         <commons.weaver.version>2.0</commons.weaver.version>
         <privilizer.policy>DYNAMIC</privilizer.policy>
+        <site.checkout>${user.home}/apache-bval-site</site.checkout>
+        <site.url>scm:svn:https://svn.apache.org/repos/infra/websites/production/bval/content/mvnsite</site.url>
+        <site.server>bval.site</site.server>
+        <built.by>${user.name}</built.by>
     </properties>
 
     <inceptionYear>2010</inceptionYear>
@@ -96,7 +99,7 @@
         </developer>
         <developer>
             <id>carlosvara</id>
-            <name>Carlos Vara</name>
+            <name>Carlos Vara Callau</name>
             <email>carlosvara@apache.org</email>
             <roles>
                 <role>PMC Member</role>
@@ -144,7 +147,7 @@
             <email>kevan@apache.org</email>
             <organization>IBM</organization>
             <roles>
-                <role>PMC Member</role>
+                <role>PMC Member (Emeritus)</role>
             </roles>
         </developer>
         <developer>
@@ -234,17 +237,15 @@
         <name>Jörg Waßmer</name>
       </contributor>
       <contributor>
-        <name>Romain Manni-Bucau</name>
-      </contributor>
-      <contributor>
         <name>Sebastian Bazley</name>
       </contributor>
     </contributors>
 
     <distributionManagement>
         <site>
-            <id>people.apache.org</id>
-            <url>${site.deploy.url}</url>
+            <id>bval.site</id>
+            <name>Apache BVal Site SVN</name>
+            <url>scm:svn:${site.url}</url>
         </site>
     </distributionManagement>
 
@@ -261,7 +262,6 @@
                     <source>1.8</source>
                     <links>
                         <link>http://docs.oracle.com/javase/8/docs/api</link>
-<!--                         <link>http://docs.oracle.com/javaee/7/api</link> -->
                     </links>
                 </configuration>
                 <reportSets>
@@ -274,6 +274,28 @@
                 </reportSets>
             </plugin>
             <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <version>3.0.1</version>
+                <inherited>false</inherited>
+                <configuration>
+                    <doclint>none</doclint>
+                    <show>package</show>
+                    <quiet>true</quiet>
+                    <source>1.8</source>
+                    <links>
+                        <link>http://docs.oracle.com/javase/8/docs/api</link>
+                    </links>
+                </configuration>
+                <reportSets>
+                    <reportSet>
+                        <reports>
+                            <report>aggregate</report>
+                        </reports>
+                    </reportSet>
+                </reportSets>
+            </plugin>
+            <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>jdepend-maven-plugin</artifactId>
                 <version>2.0-beta-2</version>
@@ -401,9 +423,9 @@
                                 <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                             </manifest>
                             <manifestEntries>
+                                <Built-By>${built.by}</Built-By>
                                 <Implementation-Build>${buildNumber}</Implementation-Build>
-                                <Specification-Title>JSR-380 Bean Validation</Specification-Title>
-                                <Specification-Vendor>Sun Microsystems, Inc.</Specification-Vendor>
+                                <Specification-Title>Bean Validation</Specification-Title>
                                 <Specification-Version>2.0</Specification-Version>
                             </manifestEntries>
                         </archive>
@@ -412,17 +434,16 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-javadoc-plugin</artifactId>
+                    <version>3.0.1</version>
                     <configuration>
                         <encoding>${project.build.sourceEncoding}</encoding>
                         <additionalparam>${javadoc.additionalparam}</additionalparam>
                         <aggregate>true</aggregate>
                         <doclint>none</doclint>
-                        <subpackages>org.apache</subpackages>
                         <verbose>false</verbose>
                         <maxmemory>512m</maxmemory>
                         <links>
                             <link>http://docs.oracle.com/javase/8/docs/api</link>
-<!--                             <link>http://docs.oracle.com/javaee/7/api</link> -->
                         </links>
                     </configuration>
                 </plugin>
@@ -604,6 +625,16 @@
                         </dependency>
                     </dependencies>
                 </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-dependency-plugin</artifactId>
+                    <version>3.1.1</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.netbeans.tools</groupId>
+                    <artifactId>sigtest-maven-plugin</artifactId>
+                    <version>1.0</version>
+                </plugin>
             </plugins>
         </pluginManagement>
 
@@ -671,6 +702,42 @@
                 </execution>
               </executions>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-site-plugin</artifactId>
+                <configuration>
+                    <skipDeploy>true</skipDeploy>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>site-stage</id>
+                        <phase>post-site</phase>
+                        <goals>
+                            <goal>stage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-scm-publish-plugin</artifactId>
+                <inherited>false</inherited>
+                <configuration>
+                    <pubScmUrl>${site.url}</pubScmUrl>
+                    <checkoutDirectory>${site.checkout}</checkoutDirectory>
+                    <serverId>${site.server}</serverId>
+                    <tryUpdate>true</tryUpdate>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>scm-publish</id>
+                        <phase>site-deploy</phase><!-- deploy site with maven-scm-publish-plugin -->
+                        <goals>
+                            <goal>publish-scm</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
             <!-- Don't include in all builds for now
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>



Mime
View raw message