bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1498347 [6/7] - in /bval/branches/bval-11: ./ bval-core/src/main/java/org/apache/bval/ bval-core/src/main/java/org/apache/bval/model/ bval-core/src/main/java/org/apache/bval/util/ bval-extras/ bval-guice/ bval-guice/src/main/java/org/apach...
Date Mon, 01 Jul 2013 10:06:21 GMT
Modified: bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationParser.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationParser.java?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationParser.java (original)
+++ bval/branches/bval-11/bval-jsr303/src/main/java/org/apache/bval/jsr303/xml/ValidationParser.java Mon Jul  1 10:06:18 2013
@@ -19,16 +19,21 @@
 package org.apache.bval.jsr303.xml;
 
 
+import org.apache.bval.cdi.BValExtension;
+import org.apache.bval.jsr303.BootstrapConfigurationImpl;
 import org.apache.bval.jsr303.ConfigurationImpl;
 import org.apache.bval.jsr303.util.IOUtils;
+import org.apache.bval.jsr303.util.IOs;
 import org.apache.bval.jsr303.util.SecureActions;
 import org.apache.bval.util.PrivilegedActions;
 import org.xml.sax.SAXException;
 
 import javax.validation.ConstraintValidatorFactory;
 import javax.validation.MessageInterpolator;
+import javax.validation.ParameterNameProvider;
 import javax.validation.TraversableResolver;
 import javax.validation.ValidationException;
+import javax.validation.executable.ExecutableType;
 import javax.validation.spi.ValidationProvider;
 import javax.xml.XMLConstants;
 import javax.xml.bind.JAXBContext;
@@ -38,12 +43,19 @@ import javax.xml.bind.Unmarshaller;
 import javax.xml.transform.stream.StreamSource;
 import javax.xml.validation.Schema;
 import javax.xml.validation.SchemaFactory;
+import java.io.Closeable;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.util.Collection;
 import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CopyOnWriteArraySet;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -51,24 +63,44 @@ import java.util.logging.Logger;
  * Description: uses jaxb to parse validation.xml<br/>
  */
 @SuppressWarnings("restriction")
-public class ValidationParser {
+public class ValidationParser implements Closeable {
     private static final String DEFAULT_VALIDATION_XML_FILE = "META-INF/validation.xml";
     private static final String VALIDATION_CONFIGURATION_XSD =
-            "META-INF/validation-configuration-1.0.xsd";
+            "META-INF/validation-configuration-1.1.xsd";
     private static final Logger log = Logger.getLogger(ValidationParser.class.getName());
-    protected final String validationXmlFile;
 
-    /**
-     * Create a new ValidationParser instance.
-     *
-     * @param file
-     */
-    public ValidationParser(String file) {
+    private ValidationConfigType xmlConfig;
+    private BootstrapConfigurationImpl bootstrap;
+    private Collection<ValidationException> exceptions = new CopyOnWriteArrayList<ValidationException>();
+    private Collection<BValExtension.Releasable> releasables = new CopyOnWriteArrayList<BValExtension.Releasable>();
+
+    private ValidationParser() {
+        // no-op
+    }
+
+    public void applyConfigWithInstantiation(ConfigurationImpl targetConfig) {
+        if (xmlConfig == null) {
+            return;
+        }
+
+        applyProviderClass(xmlConfig, targetConfig);
+        applyMessageInterpolator(xmlConfig, targetConfig);
+        applyTraversableResolver(xmlConfig, targetConfig);
+        applyConstraintFactory(xmlConfig, targetConfig);
+        applyParameterNameProvider(xmlConfig, targetConfig);
+        applyMappingStreams(xmlConfig, targetConfig);
+        applyProperties(xmlConfig, targetConfig);
+    }
+
+    public BootstrapConfigurationImpl getBootstrap() {
+        return bootstrap;
+    }
+
+    public static String getValidationXmlFile(String file) {
         if (file == null) {
-            validationXmlFile = DEFAULT_VALIDATION_XML_FILE;
-        } else {
-            validationXmlFile = file;
+            return DEFAULT_VALIDATION_XML_FILE;
         }
+        return file;
     }
 
     /**
@@ -76,17 +108,71 @@ public class ValidationParser {
      *
      * @param targetConfig
      */
-    public void processValidationConfig(ConfigurationImpl targetConfig) {
-        ValidationConfigType xmlConfig = parseXmlConfig();
-        if (xmlConfig != null) {
-            applyConfig(xmlConfig, targetConfig);
+    public static ValidationParser processValidationConfig(final String file, final ConfigurationImpl targetConfig, final boolean ignoreXml) {
+        final ValidationParser parser = new ValidationParser();
+
+        if (!ignoreXml) {
+            parser.xmlConfig = parseXmlConfig(file);
+        }
+
+        if (parser.xmlConfig != null) {
+            if (parser.xmlConfig.getExecutableValidation() == null) {
+                final ExecutableValidationType value = new ExecutableValidationType();
+                value.setEnabled(true);
+
+                final DefaultValidatedExecutableTypesType defaultValidatedExecutableTypes = new DefaultValidatedExecutableTypesType();
+                value.setDefaultValidatedExecutableTypes(defaultValidatedExecutableTypes);
+                defaultValidatedExecutableTypes.getExecutableType().add(ExecutableType.CONSTRUCTORS);
+                defaultValidatedExecutableTypes.getExecutableType().add(ExecutableType.NON_GETTER_METHODS);
+
+                parser.xmlConfig.setExecutableValidation(value);
+            }
+
+            applySimpleConfig(parser.xmlConfig, targetConfig);
+
+            parser.bootstrap = new BootstrapConfigurationImpl(
+                    parser.xmlConfig.getDefaultProvider(),
+                    parser.xmlConfig.getConstraintValidatorFactory(),
+                    parser.xmlConfig.getMessageInterpolator(),
+                    parser.xmlConfig.getTraversableResolver(),
+                    parser.xmlConfig.getParameterNameProvider(),
+                    new CopyOnWriteArraySet<String>(parser.xmlConfig.getConstraintMapping()),
+                    parser.xmlConfig.getExecutableValidation().getEnabled(),
+                    new CopyOnWriteArraySet<ExecutableType>(targetConfig.getExecutableValidation()),
+                    toMap(parser.xmlConfig.getProperty()));
+            return parser;
+        } else { // default config
+            final CopyOnWriteArraySet<ExecutableType> executableTypes = new CopyOnWriteArraySet<ExecutableType>();
+            executableTypes.add(ExecutableType.CONSTRUCTORS);
+            executableTypes.add(ExecutableType.NON_GETTER_METHODS);
+
+            parser.bootstrap = new BootstrapConfigurationImpl(
+                    null, null, null, null, null,
+                    new CopyOnWriteArraySet<String>(),
+                    true,
+                    executableTypes,
+                    new HashMap<String, String>());
+
+            targetConfig.setExecutableValidation(executableTypes);
+        }
+
+        return parser;
+    }
+
+    private static Map<String, String> toMap(final List<PropertyType> property) {
+        final Map<String, String> map = new HashMap<String, String>();
+        if (property != null) {
+            for (final PropertyType p : property) {
+                map.put(p.getName(), p.getValue());
+            }
         }
+        return map;
     }
 
-    private ValidationConfigType parseXmlConfig() {
+    private static ValidationConfigType parseXmlConfig(final String validationXmlFile) {
         InputStream inputStream = null;
         try {
-            inputStream = getInputStream(validationXmlFile);
+            inputStream = getInputStream(getValidationXmlFile(validationXmlFile));
             if (inputStream == null) {
             	log.log(Level.FINEST, String.format("No %s found. Using annotation based configuration only.", validationXmlFile));
                 return null;
@@ -111,8 +197,8 @@ public class ValidationParser {
         }
     }
 
-    protected InputStream getInputStream(String path) throws IOException {
-        ClassLoader loader = PrivilegedActions.getClassLoader(getClass());
+    protected static InputStream getInputStream(String path) throws IOException {
+        ClassLoader loader = PrivilegedActions.getClassLoader(ValidationParser.class);
         InputStream inputStream = loader.getResourceAsStream(path);
 
         if (inputStream != null) {
@@ -129,10 +215,10 @@ public class ValidationParser {
             }
         }
 
-        return inputStream;
+        return IOs.convertToMarkableInputStream(inputStream);
     }
 
-    private Schema getSchema() {
+    private static Schema getSchema() {
         return getSchema(VALIDATION_CONFIGURATION_XSD);
     }
 
@@ -154,30 +240,52 @@ public class ValidationParser {
         }
     }
 
-    private void applyConfig(ValidationConfigType xmlConfig, ConfigurationImpl targetConfig) {
-        applyProviderClass(xmlConfig, targetConfig);
-        applyMessageInterpolator(xmlConfig, targetConfig);
-        applyTraversableResolver(xmlConfig, targetConfig);
-        applyConstraintFactory(xmlConfig, targetConfig);
-        applyMappingStreams(xmlConfig, targetConfig);
-        applyProperties(xmlConfig, targetConfig);
+    public static void applySimpleConfig(ValidationConfigType xmlConfig, ConfigurationImpl targetConfig) {
+        applyExecutableValidation(xmlConfig, targetConfig);
     }
 
-    private void applyProperties(ValidationConfigType xmlConfig, ConfigurationImpl target) {
-        for (PropertyType property : xmlConfig.getProperty()) {
-            if (log.isLoggable(Level.FINEST)) {
-                log.log(Level.FINEST, String.format("Found property '%s' with value '%s' in %s", property.getName(), property.getValue(), validationXmlFile));
-            }
+    private static void applyProperties(ValidationConfigType xmlConfig, ConfigurationImpl target) {
+        for (final PropertyType property : xmlConfig.getProperty()) {
             target.addProperty(property.getName(), property.getValue());
         }
     }
 
+    private static void applyExecutableValidation(final ValidationConfigType xmlConfig, final ConfigurationImpl targetConfig) {
+        final CopyOnWriteArrayList<ExecutableType> executableTypes = new CopyOnWriteArrayList<ExecutableType>();
+        if (xmlConfig.getExecutableValidation() != null && xmlConfig.getExecutableValidation().getEnabled()
+                && xmlConfig.getExecutableValidation().getDefaultValidatedExecutableTypes() != null) {
+            executableTypes.addAll(xmlConfig.getExecutableValidation().getDefaultValidatedExecutableTypes().getExecutableType());
+        }
+
+        if (executableTypes.contains(ExecutableType.ALL)) {
+            executableTypes.clear();
+            executableTypes.add(ExecutableType.CONSTRUCTORS);
+            executableTypes.add(ExecutableType.NON_GETTER_METHODS);
+            executableTypes.add(ExecutableType.GETTER_METHODS);
+        } else if (executableTypes.contains(ExecutableType.NONE)) { // if both are present ALL gains
+            executableTypes.clear();
+        }
+
+        targetConfig.setExecutableValidation(executableTypes);
+    }
+
+    private void applyParameterNameProvider(final ValidationConfigType xmlConfig, final ConfigurationImpl targetConfig) {
+        final String parameterNameProvider = xmlConfig.getParameterNameProvider();
+        if (targetConfig.getParameterNameProvider() == targetConfig.getDefaultParameterNameProvider()) { // ref ==
+            if (parameterNameProvider != null) {
+                final Class<? extends ParameterNameProvider> clazz = Class.class.cast(loadClass(parameterNameProvider));
+                targetConfig.parameterNameProvider(newInstance(clazz));
+                log.log(Level.INFO, String.format("Using %s as validation provider.", parameterNameProvider));
+            }
+        }
+    }
+
     @SuppressWarnings("unchecked")
     private void applyProviderClass(ValidationConfigType xmlConfig, ConfigurationImpl target) {
         String providerClassName = xmlConfig.getDefaultProvider();
         if (providerClassName != null) {
             Class<? extends ValidationProvider<?>> clazz =
-                    (Class<? extends ValidationProvider<?>>) loadClass(providerClassName);
+                (Class<? extends ValidationProvider<?>>) loadClass(providerClassName);
             target.setProviderClass(clazz);
             log.log(Level.INFO, String.format("Using %s as validation provider.", providerClassName));
         }
@@ -187,7 +295,7 @@ public class ValidationParser {
     private void applyMessageInterpolator(ValidationConfigType xmlConfig,
                                           ConfigurationImpl target) {
         String messageInterpolatorClass = xmlConfig.getMessageInterpolator();
-        if (target.getMessageInterpolator() == null) {
+        if (target.getMessageInterpolator() == target.getDefaultMessageInterpolator()) { // ref ==
             if (messageInterpolatorClass != null) {
                 Class<MessageInterpolator> clazz = (Class<MessageInterpolator>)
                         loadClass(messageInterpolatorClass);
@@ -201,7 +309,7 @@ public class ValidationParser {
     private void applyTraversableResolver(ValidationConfigType xmlConfig,
                                           ConfigurationImpl target) {
         String traversableResolverClass = xmlConfig.getTraversableResolver();
-        if (target.getTraversableResolver() == null) {
+        if (target.getTraversableResolver() == target.getDefaultTraversableResolver()) { // ref ==
             if (traversableResolverClass != null) {
                 Class<TraversableResolver> clazz = (Class<TraversableResolver>)
                         loadClass(traversableResolverClass);
@@ -215,9 +323,18 @@ public class ValidationParser {
         return AccessController.doPrivileged(new PrivilegedAction<T>() {
             public T run() {
                 try {
-                    return cls.newInstance();
+                    try {
+                        final BValExtension.Releasable<T> releasable = BValExtension.inject(cls);
+                        releasables.add(releasable);
+                        return releasable.getInstance();
+                    } catch (final Exception e) {
+                        return cls.newInstance();
+                    } catch (final NoClassDefFoundError error) {
+                        return cls.newInstance();
+                    }
                 } catch (final Exception ex) {
-                    throw new ValidationException("Cannot instantiate : " + cls, ex);
+                    exceptions.add(new ValidationException("Cannot instantiate : " + cls, ex));
+                    return null; // ensure BootstrapConfiguration can be read even if class can't be instantiated
                 }
             }
         });
@@ -227,7 +344,7 @@ public class ValidationParser {
     private void applyConstraintFactory(ValidationConfigType xmlConfig,
                                         ConfigurationImpl target) {
         String constraintFactoryClass = xmlConfig.getConstraintValidatorFactory();
-        if (target.getConstraintValidatorFactory() == null) {
+        if (target.getConstraintValidatorFactory() == target.getDefaultConstraintValidatorFactory()) { // ref ==
             if (constraintFactoryClass != null) {
                 Class<ConstraintValidatorFactory> clazz = (Class<ConstraintValidatorFactory>)
                         loadClass(constraintFactoryClass);
@@ -237,16 +354,16 @@ public class ValidationParser {
         }
     }
 
-    private void applyMappingStreams(ValidationConfigType xmlConfig,
+    private static void applyMappingStreams(ValidationConfigType xmlConfig,
                                      ConfigurationImpl target) {
-        for (JAXBElement<String> mappingFileNameElement : xmlConfig.getConstraintMapping()) {
-            String mappingFileName = mappingFileNameElement.getValue();
+        for (String rawMappingFileName : xmlConfig.getConstraintMapping()) {
+            String mappingFileName = rawMappingFileName;
             if (mappingFileName.startsWith("/")) {
                 // Classloader needs a path without a starting /
                 mappingFileName = mappingFileName.substring(1);
             }
             log.log(Level.FINEST, String.format("Trying to open input stream for %s", mappingFileName));
-            InputStream in = null;
+            InputStream in;
             try {
                 in = getInputStream(mappingFileName);
                 if (in == null) {
@@ -274,13 +391,28 @@ public class ValidationParser {
     private Class<?> loadClass(final String className) {
         ClassLoader loader = doPrivileged(SecureActions.getContextClassLoader());
         if (loader == null)
-            loader = getClass().getClassLoader();
+            loader = ValidationParser.class.getClassLoader();
 
         try {
             return Class.forName(className, true, loader);
         } catch (ClassNotFoundException ex) {
-            throw new ValidationException("Unable to load class: " + className, ex);
+            // TCK check BootstrapConfig is present in all cases
+            // so throw next exception later
+            exceptions.add(new ValidationException("Unable to load class: " + className, ex));
+            return null;
         }
     }
 
+    public void ensureValidatorFactoryCanBeBuilt() {
+        if (!exceptions.isEmpty()) {
+            throw  exceptions.iterator().next();
+        }
+    }
+
+    public void close() throws IOException {
+        for (final BValExtension.Releasable<?> releasable : releasables) {
+            releasable.release();
+        }
+        releasables.clear();
+    }
 }

Added: bval/branches/bval-11/bval-jsr303/src/main/resources/META-INF/beans.xml
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/main/resources/META-INF/beans.xml?rev=1498347&view=auto
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/main/resources/META-INF/beans.xml (added)
+++ bval/branches/bval-11/bval-jsr303/src/main/resources/META-INF/beans.xml Mon Jul  1 10:06:18 2013
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<beans />

Added: bval/branches/bval-11/bval-jsr303/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension?rev=1498347&view=auto
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension (added)
+++ bval/branches/bval-11/bval-jsr303/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension Mon Jul  1 10:06:18 2013
@@ -0,0 +1 @@
+org.apache.bval.cdi.BValExtension
\ No newline at end of file

Modified: bval/branches/bval-11/bval-jsr303/src/main/resources/org/apache/bval/jsr303/DefaultConstraints.properties
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/main/resources/org/apache/bval/jsr303/DefaultConstraints.properties?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/main/resources/org/apache/bval/jsr303/DefaultConstraints.properties (original)
+++ bval/branches/bval-11/bval-jsr303/src/main/resources/org/apache/bval/jsr303/DefaultConstraints.properties Mon Jul  1 10:06:18 2013
@@ -38,7 +38,7 @@ javax.validation.constraints.NotNull=org
 javax.validation.constraints.Null=org.apache.bval.constraints.NullValidator
 javax.validation.constraints.Past=org.apache.bval.constraints.PastValidatorForDate,\
   org.apache.bval.constraints.PastValidatorForCalendar
-javax.validation.constraints.Size=org.apache.bval.constraints.SizeValidatorForString,\
+javax.validation.constraints.Size=org.apache.bval.constraints.SizeValidatorForCharSequence,\
   org.apache.bval.constraints.SizeValidatorForMap,\
   org.apache.bval.constraints.SizeValidatorForCollection,\
   org.apache.bval.constraints.SizeValidatorForArrayOfBoolean,\

Modified: bval/branches/bval-11/bval-jsr303/src/main/xjb/binding-customization.xjb
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/main/xjb/binding-customization.xjb?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/main/xjb/binding-customization.xjb (original)
+++ bval/branches/bval-11/bval-jsr303/src/main/xjb/binding-customization.xjb Mon Jul  1 10:06:18 2013
@@ -18,15 +18,21 @@
  under the License.
 -->
 <jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
-    xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
-    <jxb:bindings schemaLocation="../xsd/validation-mapping-1.0.xsd" node="/xs:schema">
-        <jxb:globalBindings>
-            <xjc:javaType name="java.lang.String" xmlType="xs:string" 
-                adapter="javax.xml.bind.annotation.adapters.CollapsedStringAdapter"/>
-        </jxb:globalBindings>
+              xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc">
+  <jxb:bindings schemaLocation="../xsd/validation-mapping-1.1.xsd" node="/xs:schema">
+    <jxb:globalBindings>
+      <xjc:javaType name="java.lang.String" xmlType="xs:string"
+                    adapter="javax.xml.bind.annotation.adapters.CollapsedStringAdapter"/>
+    </jxb:globalBindings>
 
-        <jxb:bindings node="//xs:complexType[9]/xs:sequence[1]/xs:element[1]">
-            <jxb:property name="classType"/>
-        </jxb:bindings>
+    <jxb:bindings node="//xs:complexType[@name='beanType']/xs:sequence[1]/xs:element[1]">
+      <jxb:property name="classType"/>
     </jxb:bindings>
+  </jxb:bindings>
+  <jxb:bindings schemaLocation="../xsd/validation-configuration-1.1.xsd" node="/xs:schema">
+    <jxb:bindings node="//xs:element[@name='executable-type']">
+      <jxb:javaType name="javax.validation.executable.ExecutableType"
+                    parseMethod="javax.validation.executable.ExecutableType.valueOf"/>
+    </jxb:bindings>
+  </jxb:bindings>
 </jxb:bindings>

Added: bval/branches/bval-11/bval-jsr303/src/main/xsd/validation-configuration-1.1.xsd
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/main/xsd/validation-configuration-1.1.xsd?rev=1498347&view=auto
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/main/xsd/validation-configuration-1.1.xsd (added)
+++ bval/branches/bval-11/bval-jsr303/src/main/xsd/validation-configuration-1.1.xsd Mon Jul  1 10:06:18 2013
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<xs:schema attributeFormDefault="unqualified"
+           elementFormDefault="qualified"
+           targetNamespace="http://jboss.org/xml/ns/javax/validation/configuration"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns:config="http://jboss.org/xml/ns/javax/validation/configuration"
+           version="1.1">
+  <xs:element name="validation-config" type="config:validation-configType"
+              xmlns:config="http://jboss.org/xml/ns/javax/validation/configuration"/>
+  <xs:complexType name="validation-configType">
+    <xs:sequence>
+      <xs:element type="xs:string" name="default-provider" minOccurs="0"/>
+      <xs:element type="xs:string" name="message-interpolator" minOccurs="0"/>
+      <xs:element type="xs:string" name="traversable-resolver" minOccurs="0"/>
+      <xs:element type="xs:string" name="constraint-validator-factory" minOccurs="0"/>
+      <xs:element type="xs:string" name="parameter-name-provider" minOccurs="0"/>
+      <xs:element type="config:executable-validationType" name="executable-validation" minOccurs="0"/>
+      <xs:element type="xs:string" name="constraint-mapping" maxOccurs="unbounded" minOccurs="0"/>
+      <xs:element type="config:propertyType" name="property" maxOccurs="unbounded" minOccurs="0"/>
+    </xs:sequence>
+    <xs:attribute name="version" type="config:versionType" fixed="1.1" /> <!-- use="required" -->
+  </xs:complexType>
+  <xs:complexType name="executable-validationType">
+    <xs:sequence>
+      <xs:element type="config:default-validated-executable-typesType" name="default-validated-executable-types" minOccurs="0"/>
+    </xs:sequence>
+    <xs:attribute name="enabled" use="optional" type="xs:boolean" default="true"/>
+  </xs:complexType>
+  <xs:complexType name="default-validated-executable-typesType">
+    <xs:sequence>
+      <xs:element name="executable-type" maxOccurs="unbounded" minOccurs="1">
+        <xs:simpleType>
+          <xs:restriction base="xs:string">
+            <xs:enumeration value="NONE"/>
+            <xs:enumeration value="CONSTRUCTORS"/>
+            <xs:enumeration value="NON_GETTER_METHODS"/>
+            <xs:enumeration value="GETTER_METHODS"/>
+            <xs:enumeration value="ALL"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="propertyType">
+    <xs:simpleContent>
+      <xs:extension base="xs:string">
+        <xs:attribute name="name" use="required" type="xs:string"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+  <xs:simpleType name="versionType">
+    <xs:restriction base="xs:token">
+      <xs:pattern value="[0-9]+(\.[0-9]+)*" />
+    </xs:restriction>
+  </xs:simpleType>
+</xs:schema>

Added: bval/branches/bval-11/bval-jsr303/src/main/xsd/validation-mapping-1.1.xsd
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/main/xsd/validation-mapping-1.1.xsd?rev=1498347&view=auto
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/main/xsd/validation-mapping-1.1.xsd (added)
+++ bval/branches/bval-11/bval-jsr303/src/main/xsd/validation-mapping-1.1.xsd Mon Jul  1 10:06:18 2013
@@ -0,0 +1,254 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<xs:schema attributeFormDefault="unqualified"
+           elementFormDefault="qualified"
+           targetNamespace="http://jboss.org/xml/ns/javax/validation/mapping"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns:map="http://jboss.org/xml/ns/javax/validation/mapping"
+           version="1.1">
+  <xs:element name="constraint-mappings" type="map:constraint-mappingsType"/>
+
+  <xs:complexType name="payloadType">
+    <xs:sequence>
+      <xs:element type="xs:string" name="value" maxOccurs="unbounded" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="groupsType">
+    <xs:sequence>
+      <xs:element type="xs:string" name="value" maxOccurs="unbounded" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="groupSequenceType">
+    <xs:sequence>
+      <xs:element type="xs:string" name="value" maxOccurs="unbounded" minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="groupConversionType">
+    <xs:attribute type="xs:string" name="from" use="required"/>
+    <xs:attribute type="xs:string" name="to" use="required"/>
+  </xs:complexType>
+  <xs:complexType name="constraint-mappingsType">
+    <xs:sequence>
+      <xs:element type="xs:string" name="default-package" minOccurs="0"/>
+      <xs:element type="map:beanType"
+                  name="bean"
+                  maxOccurs="unbounded"
+                  minOccurs="0"/>
+      <xs:element type="map:constraint-definitionType"
+                  name="constraint-definition"
+                  maxOccurs="unbounded"
+                  minOccurs="0"/>
+    </xs:sequence>
+    <xs:attribute name="version" type="map:versionType" fixed="1.1" /> <!-- use="required" -->
+  </xs:complexType>
+  <xs:simpleType name="versionType">
+    <xs:restriction base="xs:token">
+      <xs:pattern value="[0-9]+(\.[0-9]+)*"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:complexType name="validated-byType">
+    <xs:sequence>
+      <xs:element type="xs:string" name="value" maxOccurs="unbounded" minOccurs="0"/>
+    </xs:sequence>
+    <xs:attribute type="xs:boolean" name="include-existing-validators" use="optional"/>
+  </xs:complexType>
+  <xs:complexType name="constraintType">
+    <xs:sequence>
+      <xs:element type="xs:string" name="message" minOccurs="0"/>
+      <xs:element type="map:groupsType"
+                  name="groups"
+                  minOccurs="0"/>
+      <xs:element type="map:payloadType"
+                  name="payload"
+                  minOccurs="0"/>
+      <xs:element type="map:elementType"
+                  name="element"
+                  maxOccurs="unbounded"
+                  minOccurs="0"/>
+    </xs:sequence>
+    <xs:attribute type="xs:string" name="annotation" use="required"/>
+  </xs:complexType>
+  <xs:complexType name="elementType" mixed="true">
+    <xs:sequence>
+      <xs:element type="xs:string" name="value" maxOccurs="unbounded" minOccurs="0"/>
+      <xs:element type="map:annotationType"
+                  name="annotation"
+                  maxOccurs="unbounded"
+                  minOccurs="0"/>
+    </xs:sequence>
+    <xs:attribute type="xs:string" name="name" use="required"/>
+  </xs:complexType>
+  <xs:complexType name="classType">
+    <xs:sequence>
+      <xs:element type="map:groupSequenceType"
+                  name="group-sequence"
+                  minOccurs="0"/>
+      <xs:element type="map:constraintType"
+                  name="constraint"
+                  maxOccurs="unbounded"
+                  minOccurs="0"/>
+    </xs:sequence>
+    <xs:attribute type="xs:boolean" name="ignore-annotations" use="optional"/>
+  </xs:complexType>
+  <xs:complexType name="beanType">
+    <xs:sequence>
+      <xs:element type="map:classType"
+                  name="class"
+                  minOccurs="0">
+      </xs:element>
+      <xs:element type="map:fieldType"
+                  name="field"
+                  minOccurs="0"
+                  maxOccurs="unbounded"/>
+      <xs:element type="map:getterType"
+                  name="getter"
+                  minOccurs="0"
+                  maxOccurs="unbounded"/>
+      <xs:element type="map:constructorType"
+                  name="constructor"
+                  minOccurs="0"
+                  maxOccurs="unbounded"/>
+      <xs:element type="map:methodType"
+                  name="method"
+                  minOccurs="0"
+                  maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute type="xs:string" name="class" use="required"/>
+    <xs:attribute type="xs:boolean" name="ignore-annotations" use="optional"/>
+  </xs:complexType>
+  <xs:complexType name="annotationType">
+    <xs:sequence>
+      <xs:element type="map:elementType"
+                  name="element"
+                  maxOccurs="unbounded"
+                  minOccurs="0"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="getterType">
+    <xs:sequence>
+      <xs:element type="xs:string" name="valid" minOccurs="0" fixed=""/>
+      <xs:element type="map:groupConversionType"
+                  name="convert-group"
+                  minOccurs="0"
+                  maxOccurs="unbounded"/>
+      <xs:element type="map:constraintType"
+                  name="constraint"
+                  minOccurs="0"
+                  maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute type="xs:string" name="name" use="required"/>
+    <xs:attribute type="xs:boolean" name="ignore-annotations" use="optional"/>
+  </xs:complexType>
+  <xs:complexType name="methodType">
+    <xs:sequence>
+      <xs:element type="map:parameterType"
+                  name="parameter"
+                  minOccurs="0"
+                  maxOccurs="unbounded"/>
+      <xs:element type="map:crossParameterType"
+                  name="cross-parameter"
+                  minOccurs="0"
+                  maxOccurs="1"/>
+      <xs:element type="map:returnValueType"
+                  name="return-value"
+                  minOccurs="0"
+                  maxOccurs="1"/>
+    </xs:sequence>
+    <xs:attribute type="xs:string" name="name" use="required"/>
+    <xs:attribute type="xs:boolean" name="ignore-annotations" use="optional"/>
+  </xs:complexType>
+  <xs:complexType name="constructorType">
+    <xs:sequence>
+      <xs:element type="map:parameterType"
+                  name="parameter"
+                  minOccurs="0"
+                  maxOccurs="unbounded"/>
+      <xs:element type="map:crossParameterType"
+                  name="cross-parameter"
+                  minOccurs="0"
+                  maxOccurs="1"/>
+      <xs:element type="map:returnValueType"
+                  name="return-value"
+                  minOccurs="0"
+                  maxOccurs="1"/>
+    </xs:sequence>
+    <xs:attribute type="xs:boolean" name="ignore-annotations" use="optional"/>
+  </xs:complexType>
+  <xs:complexType name="parameterType">
+    <xs:sequence>
+      <xs:element type="xs:string" name="valid" minOccurs="0" fixed=""/>
+      <xs:element type="map:groupConversionType"
+                  name="convert-group"
+                  minOccurs="0"
+                  maxOccurs="unbounded"/>
+      <xs:element type="map:constraintType"
+                  name="constraint"
+                  minOccurs="0"
+                  maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute type="xs:string" name="type" use="required"/>
+    <xs:attribute type="xs:boolean" name="ignore-annotations" use="optional"/>
+  </xs:complexType>
+  <xs:complexType name="returnValueType">
+    <xs:sequence>
+      <xs:element type="xs:string" name="valid" minOccurs="0" fixed=""/>
+      <xs:element type="map:groupConversionType"
+                  name="convert-group"
+                  minOccurs="0"
+                  maxOccurs="unbounded"/>
+      <xs:element type="map:constraintType"
+                  name="constraint"
+                  minOccurs="0"
+                  maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute type="xs:boolean" name="ignore-annotations" use="optional"/>
+  </xs:complexType>
+  <xs:complexType name="crossParameterType">
+    <xs:sequence>
+      <xs:element type="map:constraintType"
+                  name="constraint"
+                  minOccurs="0"
+                  maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute type="xs:boolean" name="ignore-annotations" use="optional"/>
+  </xs:complexType>
+  <xs:complexType name="constraint-definitionType">
+    <xs:sequence>
+      <xs:element type="map:validated-byType"
+                  name="validated-by"/>
+    </xs:sequence>
+    <xs:attribute type="xs:string" name="annotation" use="required"/>
+  </xs:complexType>
+  <xs:complexType name="fieldType">
+    <xs:sequence>
+      <xs:element type="xs:string" name="valid" minOccurs="0" fixed=""/>
+      <xs:element type="map:groupConversionType"
+                  name="convert-group"
+                  minOccurs="0"
+                  maxOccurs="unbounded"/>
+      <xs:element type="map:constraintType"
+                  name="constraint"
+                  minOccurs="0"
+                  maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute type="xs:string" name="name" use="required"/>
+    <xs:attribute type="xs:boolean" name="ignore-annotations" use="optional"/>
+  </xs:complexType>
+</xs:schema>

Modified: bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/BootstrapTest.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/BootstrapTest.java?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/BootstrapTest.java (original)
+++ bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/BootstrapTest.java Mon Jul  1 10:06:18 2013
@@ -109,6 +109,10 @@ public class BootstrapTest extends TestC
                 }
                 return new DefaultConstraintValidatorFactory().getInstance(key);
             }
+
+            public void releaseInstance(ConstraintValidator<?, ?> instance) {
+                // no-op
+            }
         });
         factory = builder.buildValidatorFactory();
         validator = factory.getValidator();

Modified: bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/ConstraintValidatorContextTest.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/ConstraintValidatorContextTest.java?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/ConstraintValidatorContextTest.java (original)
+++ bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/ConstraintValidatorContextTest.java Mon Jul  1 10:06:18 2013
@@ -66,12 +66,10 @@ public class ConstraintValidatorContextT
     }
 
     public void testPerson1() {
-        cvb.addNode("person").addNode(null).inIterable().atIndex(1)
-                .addConstraintViolation();
-        Error error = cvc.getErrorMessages().iterator().next();
-        PathImpl errorPath = (PathImpl) error.getOwner();
-        Assert.assertEquals("Incorrect path created", "person[1]", errorPath
-                .toString());
+        cvb.addNode("person").addNode(null).inIterable().atIndex(1).addConstraintViolation();
+        final Error error = cvc.getErrorMessages().iterator().next();
+        final PathImpl errorPath = (PathImpl) error.getOwner();
+        Assert.assertEquals("Incorrect path created", "person[1]", errorPath.toString());
     }
 
     public void testPersonLawyerName() {

Modified: bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/ContextConstraintValidatorFactoryTest.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/ContextConstraintValidatorFactoryTest.java?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/ContextConstraintValidatorFactoryTest.java (original)
+++ bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/ContextConstraintValidatorFactoryTest.java Mon Jul  1 10:06:18 2013
@@ -102,7 +102,11 @@ public class ContextConstraintValidatorF
 				}
 				return null;
 			}
-		};
+
+            public void releaseInstance(ConstraintValidator<?, ?> instance) {
+                // no-op
+            }
+        };
 		final Set<ConstraintViolation<Example>> violations = factory.usingContext().constraintValidatorFactory(constraintValidatorFactory)
 				.getValidator().validate(new Example());
 		assertTrue(violations.isEmpty());

Modified: bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomConstraintValidatorFactoryTest.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomConstraintValidatorFactoryTest.java?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomConstraintValidatorFactoryTest.java (original)
+++ bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomConstraintValidatorFactoryTest.java Mon Jul  1 10:06:18 2013
@@ -61,6 +61,10 @@ public class CustomConstraintValidatorFa
             public <T extends ConstraintValidator<?, ?>> T getInstance(Class<T> key) {
                 return null; // always return null
             }
+
+            public void releaseInstance(ConstraintValidator<?, ?> instance) {
+                // no-op
+            }
         };
         
         // Create a validator with this factory

Modified: bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomValidatorFactoryTest.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomValidatorFactoryTest.java?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomValidatorFactoryTest.java (original)
+++ bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/CustomValidatorFactoryTest.java Mon Jul  1 10:06:18 2013
@@ -49,6 +49,10 @@ public class CustomValidatorFactoryTest 
             return null;
         }
 
+        public ParameterNameProvider getParameterNameProvider() {
+            return null;
+        }
+
         public MessageInterpolator getMessageInterpolator() {
             return null;
         }
@@ -65,6 +69,10 @@ public class CustomValidatorFactoryTest 
             return null;
         }
 
+        public void close() {
+
+        }
+
         public ValidatorContext usingContext() {
             return null;
         }

Modified: bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/DefaultMessageInterpolatorTest.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/DefaultMessageInterpolatorTest.java?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/DefaultMessageInterpolatorTest.java (original)
+++ bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/DefaultMessageInterpolatorTest.java Mon Jul  1 10:06:18 2013
@@ -68,6 +68,10 @@ public class DefaultMessageInterpolatorT
             public Object getValidatedValue() {
                 return "12345678";
             }
+
+            public <T> T unwrap(Class<T> type) {
+                return null;
+            }
         };
         String msg = interpolator.interpolate("{validator.creditcard}", ctx);
         Assert.assertEquals("credit card is not valid", msg);
@@ -81,6 +85,10 @@ public class DefaultMessageInterpolatorT
             public Object getValidatedValue() {
                 return "";
             }
+
+            public <T> T unwrap(Class<T> type) {
+                return null;
+            }
         };
 
         msg = interpolator.interpolate("{org.apache.bval.constraints.NotEmpty.message}", ctx);
@@ -107,6 +115,10 @@ public class DefaultMessageInterpolatorT
             public Object getValidatedValue() {
                 return "12345678";
             }
+
+            public <T> T unwrap(Class<T> type) {
+                return null;
+            }
         };
 
         String result = this.interpolator.interpolate("Id number should match {regexp}", ctx);
@@ -124,6 +136,10 @@ public class DefaultMessageInterpolatorT
             public Object getValidatedValue() {
                 return "12345678";
             }
+
+            public <T> T unwrap(Class<T> type) {
+                return null;
+            }
         };
 
         result = this.interpolator.interpolate("Other id should match {regexp}", ctx);

Modified: bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/Jsr303Test.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/Jsr303Test.java?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/Jsr303Test.java (original)
+++ bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/Jsr303Test.java Mon Jul  1 10:06:18 2013
@@ -18,27 +18,9 @@
  */
 package org.apache.bval.jsr303;
 
-import java.math.BigDecimal;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Locale;
-import java.util.Set;
-
-import javax.validation.ConstraintViolation;
-import javax.validation.UnexpectedTypeException;
-import javax.validation.Validation;
-import javax.validation.Validator;
-import javax.validation.ValidatorFactory;
-import javax.validation.metadata.BeanDescriptor;
-import javax.validation.metadata.ConstraintDescriptor;
-import javax.validation.metadata.ElementDescriptor;
-import javax.validation.metadata.PropertyDescriptor;
-
 import junit.framework.Assert;
 import junit.framework.TestCase;
-
-import org.apache.bval.constraints.SizeValidatorForString;
+import org.apache.bval.constraints.SizeValidatorForCharSequence;
 import org.apache.bval.jsr303.example.Address;
 import org.apache.bval.jsr303.example.Book;
 import org.apache.bval.jsr303.example.Engine;
@@ -49,6 +31,22 @@ import org.apache.bval.jsr303.example.Se
 import org.apache.bval.jsr303.example.SizeTestEntity;
 import org.apache.bval.jsr303.util.TestUtils;
 
+import javax.validation.ConstraintViolation;
+import javax.validation.UnexpectedTypeException;
+import javax.validation.Validation;
+import javax.validation.Validator;
+import javax.validation.ValidatorFactory;
+import javax.validation.metadata.BeanDescriptor;
+import javax.validation.metadata.ConstraintDescriptor;
+import javax.validation.metadata.ElementDescriptor;
+import javax.validation.metadata.PropertyDescriptor;
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Set;
+
 /**
  * Description: <br/>
  */
@@ -189,7 +187,7 @@ public class Jsr303Test extends TestCase
         Assert.assertNotNull(desc);
         boolean found = false;
         for (ConstraintDescriptor<?> each : desc.getConstraintDescriptors()) {
-            if (each.getConstraintValidatorClasses().get(0).equals(SizeValidatorForString.class)) {
+            if (each.getConstraintValidatorClasses().get(0).equals(SizeValidatorForCharSequence.class)) {
                 Assert.assertTrue(each.getAttributes().containsKey("max"));
                 assertEquals(30, each.getAttributes().get("max"));
                 found = true;

Modified: bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/ValidationTest.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/ValidationTest.java?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/ValidationTest.java (original)
+++ bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/ValidationTest.java Mon Jul  1 10:06:18 2013
@@ -692,8 +692,7 @@ public class ValidationTest extends Test
 
     public void testKeyedMetadata() {
         @SuppressWarnings("serial")
-        BeanDescriptor beanDescriptor = validator.getConstraintsForClass(new HashMap<String, Object>() {
-        }.getClass());
+        BeanDescriptor beanDescriptor = validator.getConstraintsForClass(new HashMap<String, Object>() {}.getClass());
         Assert.assertNotNull(beanDescriptor);
         Assert.assertFalse(beanDescriptor.isBeanConstrained());
         Assert.assertNull(beanDescriptor.getConstraintsForProperty("[foo]"));

Modified: bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/extensions/MethodValidatorImplTest.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/extensions/MethodValidatorImplTest.java?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/extensions/MethodValidatorImplTest.java (original)
+++ bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/extensions/MethodValidatorImplTest.java Mon Jul  1 10:06:18 2013
@@ -16,21 +16,19 @@
  */
 package org.apache.bval.jsr303.extensions;
 
-import junit.framework.Assert;
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
-
 import org.apache.bval.jsr303.ApacheValidationProvider;
-import org.apache.bval.jsr303.ApacheValidatorConfiguration;
 import org.apache.bval.jsr303.ClassValidator;
 import org.apache.bval.jsr303.extensions.ExampleMethodService.Person;
+import org.junit.Ignore;
 
 import javax.validation.Validation;
-import javax.validation.ValidationException;
 import javax.validation.Validator;
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Size;
+import javax.validation.executable.ExecutableValidator;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.util.Set;
@@ -57,54 +55,44 @@ public class MethodValidatorImplTest ext
         ClassValidator cv = v.unwrap(ClassValidator.class);
         assertTrue(v == cv);
         assertTrue(v == v.unwrap(Validator.class));
-        MethodValidatorImpl mvi = v.unwrap(MethodValidatorImpl.class);
-        assertNotNull(mvi);
-        MethodValidator mv = v.unwrap(MethodValidator.class);
+        ExecutableValidator mv = v.forExecutables();
         assertNotNull(mv);
-        assertTrue(mv == mv.unwrap(MethodValidatorImpl.class));
-        assertTrue(mv == mv.unwrap(ClassValidator.class));
     }
 
     public void testValidateMethodParameters() throws NoSuchMethodException {
         ExampleMethodService service = new ExampleMethodService();
-        MethodValidator mv = getValidator().unwrap(MethodValidator.class);
+        ExecutableValidator mv = getValidator().unwrap(ExecutableValidator.class);
         Method method =
               service.getClass().getMethod("concat", new Class[]{String.class, String.class});
         String[] params = new String[2];
         params[0] = "Hello ";
         params[1] = "world";
-        Set results = mv.validateParameters(service.getClass(), method, params);
+        Set results = mv.validateParameters(service, method, params);
         assertEquals(true, results.isEmpty());
 
         params[0] = "";
-        results = mv.validateParameters(service.getClass(), method, params);
+        results = mv.validateParameters(service, method, params);
         assertEquals(1, results.size());
 
         params[1] = null;
-        results = mv.validateParameters(service.getClass(), method, params);
+        results = mv.validateParameters(service, method, params);
         assertEquals(2, results.size());
-
-        results = mv.validateParameter(service.getClass(), method,  params[0], 0);
-        assertEquals(1, results.size());
-
-        results = mv.validateParameter(service.getClass(), method,  "ok", 0);
-        assertEquals(0, results.size());
     }
     
     public void testValidateMoreMethodParameters() throws NoSuchMethodException {
     	
     	ExampleMethodService service = new ExampleMethodService();
-    	MethodValidator mv = getValidator().unwrap(MethodValidator.class);
+        ExecutableValidator mv = getValidator().unwrap(ExecutableValidator.class);
     	Method saveMethod = service.getClass().getMethod("save", new Class[]{String.class});
     	
     	String[] saveParams = new String[1];
     	saveParams[0] = "abcd";
     	
-    	Set results = mv.validateParameters(service.getClass(), saveMethod, saveParams);
+    	Set results = mv.validateParameters(service, saveMethod, saveParams);
     	assertTrue(results.isEmpty());
     	
     	saveParams[0] = "zzzz";
-    	results = mv.validateParameters(service.getClass(), saveMethod, saveParams);
+    	results = mv.validateParameters(service, saveMethod, saveParams);
     	assertEquals(1, results.size());
     	
     	Method echoMethod = service.getClass().getMethod("echo", new Class[]{String.class});
@@ -112,115 +100,110 @@ public class MethodValidatorImplTest ext
     	String[] echoParams = new String[1];
     	echoParams[0] = "hello";
     	
-    	results = mv.validateParameters(service.getClass(), echoMethod, echoParams);
+    	results = mv.validateParameters(service, echoMethod, echoParams);
     	assertTrue(results.isEmpty());
     	
     	echoParams[0] = "h";
-    	results = mv.validateParameters(service.getClass(), echoMethod, echoParams);
+    	results = mv.validateParameters(service, echoMethod, echoParams);
     	assertEquals(1, results.size());
     	
     	echoParams[0] = null;
-    	results = mv.validateParameters(service.getClass(), echoMethod, echoParams);
+    	results = mv.validateParameters(service, echoMethod, echoParams);
     	assertEquals(1, results.size());
     	
     }
 
     public void testValidateConstructorParameters() throws NoSuchMethodException {
         ExampleMethodService service = new ExampleMethodService();
-        MethodValidator mv = getValidator().unwrap(MethodValidator.class);
+        ExecutableValidator mv = getValidator().unwrap(ExecutableValidator.class);
         Constructor constructor =
               service.getClass().getConstructor(String.class, String.class);
         String[] params = new String[2];
         params[0] = "Hello ";
         params[1] = "world";
-        Set results = mv.validateParameters(service.getClass(), constructor, params);
+        Set results = mv.validateConstructorParameters(constructor, params);
         assertEquals(true, results.isEmpty());
 
         params[0] = "";
-        results = mv.validateParameters(service.getClass(), constructor, params);
+        results = mv.validateConstructorParameters(constructor, params);
         assertEquals(1, results.size());
 
         params[1] = null;
-        results = mv.validateParameters(service.getClass(), constructor, params);
+        results = mv.validateConstructorParameters(constructor, params);
         assertEquals(2, results.size());
-
-        results = mv.validateParameter(service.getClass(), constructor,  params[0], 0);
-        assertEquals(1, results.size());
-
-        results = mv.validateParameter(service.getClass(), constructor,  "ok", 0);
-        assertEquals(0, results.size());
     }
 
     public void testValidateReturnValue() throws NoSuchMethodException {
         ExampleMethodService service = new ExampleMethodService();
-        MethodValidator mv = getValidator().unwrap(MethodValidator.class);
-        Method method =
-              service.getClass().getMethod("concat", new Class[]{String.class, String.class});
+        ExecutableValidator mv = getValidator().unwrap(ExecutableValidator.class);
+        Method method = service.getClass().getMethod("concat", new Class[]{String.class, String.class});
+
         Set results;
-        results = mv.validateReturnedValue(service.getClass(), method, "test");
+
+        results = mv.validateReturnValue(service, method, "test");
         assertEquals(true, results.isEmpty());
 
-        results = mv.validateReturnedValue(service.getClass(), method, "");
+        results = mv.validateReturnValue(service, method, "");
         assertEquals(1, results.size());
     }
     
     public void testValidateMoreReturnValue() throws NoSuchMethodException {
     	ExampleMethodService service = new ExampleMethodService();
-    	MethodValidator mv = getValidator().unwrap(MethodValidator.class);
+        ExecutableValidator mv = getValidator().unwrap(ExecutableValidator.class);
     	Method echoMethod = service.getClass().getMethod("echo", new Class[]{String.class});
     	
     	String returnedValue = "a too long string";
-    	Set results = mv.validateReturnedValue(service.getClass(), echoMethod, returnedValue);
+    	Set results = mv.validateReturnValue(service, echoMethod, returnedValue);
     	assertEquals(1, results.size());
-    	
+
     	returnedValue = null;
-    	results = mv.validateReturnedValue(service.getClass(), echoMethod, returnedValue);
-    	assertEquals(1, results.size());
+        results = mv.validateReturnValue(service, echoMethod, returnedValue);
+        assertEquals(1, results.size());
     	
     	returnedValue = "valid";
-    	results = mv.validateReturnedValue(service.getClass(), echoMethod, returnedValue);
+        results = mv.validateReturnValue(service, echoMethod, returnedValue);
     	assertTrue(results.isEmpty());
     }
     
     public void testValidateValidParam() throws NoSuchMethodException {
         ExampleMethodService service = new ExampleMethodService();
-        MethodValidator mv = getValidator().unwrap(MethodValidator.class);
+        ExecutableValidator mv = getValidator().unwrap(ExecutableValidator.class);
         
         Method personOp1 = service.getClass().getMethod("personOp1", new Class[]{Person.class});
         
         // Validate with invalid person
         Person p = new ExampleMethodService.Person();
-        Set<?> results = mv.validateParameters(service.getClass(), personOp1, new Object[]{p});
+        Set<?> results = mv.validateParameters(service, personOp1, new Object[]{p});
         assertEquals("Expected 1 violation", 1, results.size());
         
         // validate with valid person
         p.name = "valid name";
-        results = mv.validateParameters(service.getClass(), personOp1, new Object[]{p});
+        results = mv.validateParameters(service, personOp1, new Object[]{p});
         assertTrue("No violations expected", results.isEmpty());
         
         // validate with null person
-        results = mv.validateParameters(service.getClass(), personOp1, new Object[]{null});
+        results = mv.validateParameters(service, personOp1, new Object[]{null});
         assertTrue("No violations expected", results.isEmpty());
     }
     
     public void testValidateNotNullValidParam() throws NoSuchMethodException {
         ExampleMethodService service = new ExampleMethodService();
-        MethodValidator mv = getValidator().unwrap(MethodValidator.class);
+        ExecutableValidator mv = getValidator().unwrap(ExecutableValidator.class);
         
         Method personOp2 = service.getClass().getMethod("personOp2", new Class[]{Person.class});
         
         // Validate with null person
-        Set<?> results = mv.validateParameters(service.getClass(), personOp2, new Object[]{null});
+        Set<?> results = mv.validateParameters(service, personOp2, new Object[]{null});
         assertEquals("Expected 1 violation", 1, results.size());
         
         // Validate with invalid person
         Person p = new ExampleMethodService.Person();
-        results = mv.validateParameters(service.getClass(), personOp2, new Object[]{p});
+        results = mv.validateParameters(service, personOp2, new Object[]{p});
         assertEquals("Expected 1 violation", 1, results.size());
         
         // validate with valid person
         p.name = "valid name";
-        results = mv.validateParameters(service.getClass(), personOp2, new Object[]{p});
+        results = mv.validateParameters(service, personOp2, new Object[]{p});
         assertTrue("No violations expected", results.isEmpty());
     }
     
@@ -234,9 +217,10 @@ public class MethodValidatorImplTest ext
      *  <li>interface.class + impl.method</li>
      * </ul>
      */
-    public void testValidateImplementedMethod() throws NoSuchMethodException {
+    @Ignore("violates Liskov principle, forbidden by the spec - 4.5.5")
+    public void validateImplementedMethod() throws NoSuchMethodException {
         UserMethodsImpl um = new UserMethodsImpl();
-        MethodValidator mv = getValidator().unwrap(MethodValidator.class);
+        ExecutableValidator mv = getValidator().unwrap(ExecutableValidator.class);
         
         Method classMethod = um.getClass().getMethod("findUser", new Class[]{String.class, String.class, Integer.class});
         Method ifaceMethod = UserMethods.class.getMethod("findUser", new Class[]{String.class, String.class, Integer.class});
@@ -244,27 +228,8 @@ public class MethodValidatorImplTest ext
         Set<?> results;
         
         // Validate from class (should create violations)
-        results = mv.validateParameters(um.getClass(), classMethod, new Object[]{"", "valid", null });
+        results = mv.validateParameters(um, classMethod, new Object[]{"", "valid", null });
         assertEquals("Invalid number of violations", 2, results.size());
-        
-        // Validate from interface
-        results = mv.validateParameters(UserMethods.class, ifaceMethod, new Object[]{"", "valid", null });
-        assertEquals("Invalid number of violations", 0, results.size());
-        
-        // Invalid combinations
-        try {
-            results = mv.validateParameters(UserMethods.class, classMethod, new Object[]{"", "valid", null });
-            Assert.fail("Exception not thrown when validating interface.class + impl.method");
-        } catch (ValidationException e) {
-            // Expected
-        }
-        try {
-            results = mv.validateParameters(um.getClass(), ifaceMethod, new Object[]{"", "valid", null });
-            Assert.fail("Exception not thrown when validating impl.class + interface.method");
-        } catch (ValidationException e) {
-            // Expected
-        }
-        
     }
     
     public static interface UserMethods {
@@ -283,7 +248,9 @@ public class MethodValidatorImplTest ext
         return Validation
             .byProvider(ApacheValidationProvider.class)
             .configure()
+                /*
             .addProperty(ApacheValidatorConfiguration.Properties.METABEAN_FACTORY_CLASSNAMES,
-                MethodValidatorMetaBeanFactory.class.getName()).buildValidatorFactory().getValidator();
+                MethodValidatorMetaBeanFactory.class.getName())*/
+                .buildValidatorFactory().getValidator();
     }
 }

Modified: bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/PathImplTest.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/PathImplTest.java?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/PathImplTest.java (original)
+++ bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/util/PathImplTest.java Mon Jul  1 10:06:18 2013
@@ -126,10 +126,10 @@ public class PathImplTest extends TestCa
     }
 
     public void testNull() {
-        assertEquals(PathImpl.createPathFromString(null), PathImpl.create(null));
+        assertEquals(PathImpl.createPathFromString(null), PathImpl.create());
 
-        assertEquals("", PathImpl.create(null).toString());
-        Path path = PathImpl.create(null);
+        assertEquals("", PathImpl.create().toString());
+        Path path = PathImpl.create();
         Path.Node node = path.iterator().next();
         assertEquals(null, node.getName());
     }
@@ -172,11 +172,11 @@ public class PathImplTest extends TestCa
     }
 
     public void testToString() {
-        PathImpl path = PathImpl.create(null);
+        PathImpl path = PathImpl.create();
         path.addNode(new NodeImpl("firstName"));
         assertEquals("firstName", path.toString());
 
-        path = PathImpl.create(null);
+        path = PathImpl.create();
         path.getLeafNode().setIndex(2);
         assertEquals("[2]", path.toString());
         path.addNode(new NodeImpl("firstName"));

Modified: bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/xml/ValidationParserTest.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/xml/ValidationParserTest.java?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/xml/ValidationParserTest.java (original)
+++ bval/branches/bval-11/bval-jsr303/src/test/java/org/apache/bval/jsr303/xml/ValidationParserTest.java Mon Jul  1 10:06:18 2013
@@ -45,11 +45,10 @@ public class ValidationParserTest extend
     }
 
     public void testGetInputStream() throws IOException {
-        ValidationParser vp = new ValidationParser("sample-validation.xml");
-        assertNotNull(vp.getInputStream("sample-validation.xml"));
+        assertNotNull(ValidationParser.getInputStream("sample-validation.xml"));
 
         try {
-            vp.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
             fail("exception not thrown");
         } catch(ValidationException vex) {
             assertTrue(vex.getMessage().startsWith("More than "));
@@ -57,10 +56,8 @@ public class ValidationParserTest extend
     }
 
     public void testParse() {
-        ValidationParser vp = new ValidationParser("sample-validation.xml");
-        ConfigurationImpl config =
-              new ConfigurationImpl(null, new ApacheValidationProvider());
-        vp.processValidationConfig(config);
+        ConfigurationImpl config = new ConfigurationImpl(null, new ApacheValidationProvider());
+        ValidationParser.processValidationConfig("sample-validation.xml", config, false);
     }
 
     public void testConfigureFromXml() {

Modified: bval/branches/bval-11/bval-jsr303/src/test/resources/sample-constraints.xml
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr303/src/test/resources/sample-constraints.xml?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-jsr303/src/test/resources/sample-constraints.xml (original)
+++ bval/branches/bval-11/bval-jsr303/src/test/resources/sample-constraints.xml Mon Jul  1 10:06:18 2013
@@ -34,7 +34,7 @@
 
     </field>
     <field name="valueCode">
-      <valid/>
+      <!--<valid/>-->
       <!-- @HasValue({ 0, 20 }) -->
       <constraint annotation="org.apache.bval.constraints.HasValue">
         <element name="value">
@@ -45,7 +45,7 @@
 
     </field>
     <getter name="firstName">
-      <valid/>
+      <!--<valid/>-->
       <!-- @Size(message="Size is limited",
                  groups={First.class, Default.class},
                  max=10
@@ -66,7 +66,7 @@
 
   <constraint-definition annotation="javax.validation.constraints.Size">
       <validated-by include-existing-validators="false">
-          <value>org.apache.bval.constraints.SizeValidatorForString</value>
+          <value>org.apache.bval.constraints.SizeValidatorForCharSequence</value>
       </validated-by>
   </constraint-definition>
 

Modified: bval/branches/bval-11/bval-tck/pom.xml
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-tck/pom.xml?rev=1498347&r1=1498346&r2=1498347&view=diff
==============================================================================
--- bval/branches/bval-11/bval-tck/pom.xml (original)
+++ bval/branches/bval-11/bval-tck/pom.xml Mon Jul  1 10:06:18 2013
@@ -34,9 +34,44 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.bval</groupId>
-            <artifactId>org.apache.bval.bundle</artifactId>
+            <artifactId>bval-core</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.bval</groupId>
+            <artifactId>bval-jsr303</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-atinject_1.0_spec</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jcdi_1.0_spec</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-interceptor_1.1_spec</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-ejb_3.1_spec</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-el_2.2_spec</artifactId>
+            <version>1.0.4</version>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
     <properties>
@@ -123,9 +158,16 @@
                 </dependency>
                 -->
                 <dependency>
+                  <groupId>javax.validation</groupId>
+                  <artifactId>validation-api</artifactId>
+                  <scope>provided</scope>
+                </dependency>
+                <!-- TODO
+                <dependency>
                     <groupId>org.apache.geronimo.specs</groupId>
                     <artifactId>geronimo-validation_1.0_spec</artifactId>
                 </dependency>
+                -->
                 <dependency>
                     <groupId>org.testng</groupId>
                     <artifactId>testng</artifactId>
@@ -145,6 +187,10 @@
             </dependencies>
             <repositories>
                 <repository>
+                  <id>nuxeo</id>
+                  <url>https://maven.nuxeo.org/nexus/content/groups/public/</url>
+                </repository>
+                <repository>
                     <!-- override outdated URLs for jboss repo ids -->
                     <id>repository.jboss.org</id>
                     <name>JBoss Public Maven Repository Group</name>
@@ -214,20 +260,22 @@
                                             <classifier>suite</classifier>
                                             <overWrite>false</overWrite>
                                         </artifactItem>
-                                        <!-- use geronimo-validation spec
+                                        <!-- TODO: use geronimo-validation spec -->
                                         <artifactItem>
                                             <groupId>javax.validation</groupId>
                                             <artifactId>validation-api</artifactId>
                                             <overWrite>true</overWrite>
                                             <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
                                         </artifactItem>
-                                        -->
+
+                                        <!-- TODO
                                         <artifactItem>
                                             <groupId>org.apache.geronimo.specs</groupId>
                                             <artifactId>geronimo-validation_1.0_spec</artifactId>
                                             <overWrite>true</overWrite>
                                             <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
                                         </artifactItem>
+                                        -->
                                         <artifactItem>
                                             <groupId>org.apache.bval</groupId>
                                             <artifactId>org.apache.bval.bundle</artifactId>

Added: bval/branches/bval-11/bval-tck/work-tests-suite.xml
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-tck/work-tests-suite.xml?rev=1498347&view=auto
==============================================================================
--- bval/branches/bval-11/bval-tck/work-tests-suite.xml (added)
+++ bval/branches/bval-11/bval-tck/work-tests-suite.xml Mon Jul  1 10:06:18 2013
@@ -0,0 +1,27 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+<!--
+  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.
+-->
+<!--
+JUST HERE TO BE ABLE TO RUN TCK ONE BY ONE WHEN DEVELOPING
+think to add -Dvalidation.provider=org.apache.bval.jsr303.ApacheValidationProvider to your runner config
+-->
+<suite name="tmp" verbose="1">
+  <test name="tmp">
+    <classes>
+        <class name="org.hibernate.jsr303.tck.tests.constraints.application.ValidationRequirementTest" />
+    </classes>
+  </test>
+</suite>

Added: bval/branches/bval-11/bval-tck11/pom.xml
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-tck11/pom.xml?rev=1498347&view=auto
==============================================================================
--- bval/branches/bval-11/bval-tck11/pom.xml (added)
+++ bval/branches/bval-11/bval-tck11/pom.xml Mon Jul  1 10:06:18 2013
@@ -0,0 +1,236 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <artifactId>bval-parent</artifactId>
+        <groupId>org.apache.bval</groupId>
+        <version>0.6-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>bval-tck11</artifactId>
+    <name>Apache BVal :: bval-tck11 (TCK Runner)</name>
+    <description>Aggregates dependencies and runs the JSR-349 TCK</description>
+
+    <properties>
+        <tck.version>1.1.0.Final</tck.version>
+        <owb.version>1.2.1-SNAPSHOT</owb.version>
+        <arquillian.version>1.0.3.Final</arquillian.version>
+        <validation.provider>org.apache.bval.jsr303.ApacheValidationProvider</validation.provider>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>javax.validation</groupId>
+            <artifactId>validation-api</artifactId>
+            <version>1.1.0.Final</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-atinject_1.0_spec</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-jcdi_1.0_spec</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-interceptor_1.1_spec</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-ejb_3.1_spec</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-el_2.2_spec</artifactId>
+            <version>1.0.4</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.bval</groupId>
+            <artifactId>bval-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.bval</groupId>
+            <artifactId>bval-jsr303</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <!-- can be used to test in jse mode but globally it will need a lot of exclusions so not sure it is relevant
+        <dependency>
+          <groupId>org.hibernate.beanvalidation.tck</groupId>
+          <artifactId>beanvalidation-standalone-container-adapter</artifactId>
+          <version>${tck.version}</version>
+          <scope>test</scope>
+        </dependency>
+        -->
+        <dependency>
+            <groupId>org.jboss.arquillian.container</groupId>
+            <artifactId>arquillian-container-test-spi</artifactId>
+            <version>${arquillian.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.openwebbeans.arquillian</groupId>
+            <artifactId>owb-arquillian-standalone</artifactId>
+            <version>${owb.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.openwebbeans</groupId>
+            <artifactId>openwebbeans-impl</artifactId>
+            <version>${owb.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tomcat</groupId>
+            <artifactId>tomcat-jasper-el</artifactId>
+            <version>7.0.41</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.hibernate.beanvalidation.tck</groupId>
+            <artifactId>beanvalidation-tck-tests</artifactId>
+            <version>${tck.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.arquillian.testng</groupId>
+            <artifactId>arquillian-testng-container</artifactId>
+            <version>${arquillian.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.arquillian.protocol</groupId>
+            <artifactId>arquillian-protocol-servlet</artifactId>
+            <version>${arquillian.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <repositories>
+        <repository>
+            <id>nuxeo</id>
+            <url>https://maven.nuxeo.org/nexus/content/groups/public/</url>
+        </repository>
+    </repositories>
+
+    <profiles>
+        <profile>
+            <id>tck11</id>
+            <activation>
+                <property>
+                    <name>tck11</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-deploy-plugin</artifactId>
+                        <configuration>
+                            <skip>true</skip>
+                        </configuration>
+                    </plugin>
+
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-dependency-plugin</artifactId>
+                        <version>2.7</version>
+                        <executions>
+                            <execution>
+                                <id>copy-tck-test-suite-file</id>
+                                <phase>generate-test-sources</phase>
+                                <goals>
+                                    <goal>copy</goal>
+                                </goals>
+                                <configuration>
+                                    <stripVersion>true</stripVersion>
+                                    <artifactItems>
+                                        <artifactItem>
+                                            <groupId>org.hibernate.beanvalidation.tck</groupId>
+                                            <artifactId>beanvalidation-tck-tests</artifactId>
+                                            <type>xml</type>
+                                            <classifier>suite</classifier>
+                                            <overWrite>false</overWrite>
+                                        </artifactItem>
+                                    </artifactItems>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <suiteXmlFiles>
+                                <suiteXmlFile>${project.build.directory}/dependency/beanvalidation-tck-tests-suite.xml
+                                </suiteXmlFile>
+                            </suiteXmlFiles>
+                            <systemProperties>
+                                <property>
+                                    <name>validation.provider</name>
+                                    <value>${validation.provider}</value>
+                                </property>
+                            </systemProperties>
+                            <parallel>methods</parallel>
+                            <threadCount>4</threadCount>
+                        </configuration>
+                    </plugin>
+
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-report-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>generate-test-report</id>
+                                <phase>test</phase>
+                                <goals>
+                                    <goal>report-only</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/surefire-reports</outputDirectory>
+                            <outputName>test-report</outputName>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>

Added: bval/branches/bval-11/bval-tck11/src/main/java/org/apache/bval/arquillian/BValArquillianExtension.java
URL: http://svn.apache.org/viewvc/bval/branches/bval-11/bval-tck11/src/main/java/org/apache/bval/arquillian/BValArquillianExtension.java?rev=1498347&view=auto
==============================================================================
--- bval/branches/bval-11/bval-tck11/src/main/java/org/apache/bval/arquillian/BValArquillianExtension.java (added)
+++ bval/branches/bval-11/bval-tck11/src/main/java/org/apache/bval/arquillian/BValArquillianExtension.java Mon Jul  1 10:06:18 2013
@@ -0,0 +1,28 @@
+/*
+ * 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.core.spi.LoadableExtension;
+import org.jboss.arquillian.test.spi.TestEnricher;
+
+public class BValArquillianExtension implements LoadableExtension {
+    public void register(final ExtensionBuilder builder) {
+        builder.service(TestEnricher.class, EJBEnricher.class);
+    }
+}



Mime
View raw message