You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by rd...@apache.org on 2010/07/22 14:24:19 UTC

svn commit: r966614 [1/5] - in /myfaces/extensions/validator/trunk: core/src/main/java/org/apache/myfaces/extensions/validator/core/startup/ core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/ test-modules/ test...

Author: rdebusscher
Date: Thu Jul 22 12:24:16 2010
New Revision: 966614

URL: http://svn.apache.org/viewvc?rev=966614&view=rev
Log:
EXTVAL-106

Added:
    myfaces/extensions/validator/trunk/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/util/ClassLoaderTestSuite.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/custom/
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/custom/RenderKitWrapperFactory.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationActivateRequiredInitializationTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationConstraintSourceAnnotationTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomBasePackageTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomComponentInitializerClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomComponentMetaDataExtractorClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomComponentMetaDataExtractorFactoryClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomFacesMessageFactoryClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomInformationProviderBeanClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomMessageBundleBaseNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomMessageResolverFactoryClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomMetaDataExtractionInterceptorClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomMetaDataStorageFilterClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomMetaDataToValidationStrategyNameMapperClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomMetaDataTransformerFactoryClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomPropertyValidationInterceptorClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomStaticValidationStrategyMappingSourceTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomStorageManagerFactoryClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomValidationExceptionInterceptorClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomValidationParameterExtractorClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomValidationParameterExtractorFactoryClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomValidationParameterFactoryClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomValidationStrategyFactoryClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomValidationStrategyToMessageResolverNameMapperClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomValidationStrategyToMetaDataTransformerNameMapperClassNameTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationDeactivateComponentInitializationTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationDeactivateDefaultConventionTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationDeactivateDefaultNameMappersTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationDeactivateElResolverTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationDeactivateRenderKitFactoryTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationDeactivateRequiredAttributeSupportTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationDeactivateValidationParametersTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationDisableClientSideValidationValidationParameterTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationIgnoreConstraintSourceAnnotationTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationInterpretEmptyStringSubmittedValuesAsNullTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationProjectStageResolverTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationProxyHelperTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationRendererProxyTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationTargetPropertyAnnotationTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationTargetPropertyIdAnnotationTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationValidateEmptyFieldsTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationViolationSeverityTestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/support/
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/support/ConstraintSourceAware2MetaDataBean.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/support/ConstraintSourceAwareBean.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/support/ConstraintSourceAwareMetaDataBean.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/support/CustomConstraintSource.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/support/CustomIgnoreConstraintSource.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/support/CustomTargetProperty.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/support/CustomTargetPropertyId.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/resources/org/
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/resources/org/apache/
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/resources/org/apache/myfaces/
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/resources/org/apache/myfaces/extensions/
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/resources/org/apache/myfaces/extensions/validator/
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/resources/org/apache/myfaces/extensions/validator/core/
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/resources/org/apache/myfaces/extensions/validator/core/config/
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/resources/org/apache/myfaces/extensions/validator/core/config/ExtValCoreConfigurationCustomStaticValidationStrategyMappingSourceTestCaseCustomConfig.properties
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/resources/org/apache/myfaces/extensions/validator/core/config/ExtValCoreConfigurationCustomStaticValidationStrategyMappingSourceTestCaseWebXml.properties
    myfaces/extensions/validator/trunk/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/config/
    myfaces/extensions/validator/trunk/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/config/ExtValBaseValidationConfigurationCustomTestCase.java
    myfaces/extensions/validator/trunk/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/config/ExtValBaseValidationConfigurationDeactivateJpaBasedValidationTestCase.java
    myfaces/extensions/validator/trunk/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/config/ExtValBaseValidationConfigurationJpaValidationErrorMessagesTestCase.java
    myfaces/extensions/validator/trunk/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/config/ExtValBaseValidationConfigurationTestCase.java
    myfaces/extensions/validator/trunk/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/config/ExtValCrossValidationConfigurationCustomTestCase.java
    myfaces/extensions/validator/trunk/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/config/ExtValCrossValidationConfigurationDeactivateCrossvalidationTestCase.java
    myfaces/extensions/validator/trunk/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/config/ExtValCrossValidationConfigurationTestCase.java
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/pom.xml
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/java/
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/java/org/
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/java/org/apache/
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/java/org/apache/myfaces/
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/java/org/apache/myfaces/extensions/
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/java/org/apache/myfaces/extensions/validator/
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/java/org/apache/myfaces/extensions/validator/test/
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/java/org/apache/myfaces/extensions/validator/test/trinidad/
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/java/org/apache/myfaces/extensions/validator/test/trinidad/AbstractTrinidadSupportTestCase.java
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/java/org/apache/myfaces/extensions/validator/test/trinidad/config/
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/java/org/apache/myfaces/extensions/validator/test/trinidad/config/ExtValTrinidadSupportModuleConfigurationCustomTestCase.java
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/java/org/apache/myfaces/extensions/validator/test/trinidad/config/ExtValTrinidadSupportModuleConfigurationDeactivateClientSideValidationTestCase.java
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/java/org/apache/myfaces/extensions/validator/test/trinidad/config/ExtValTrinidadSupportModuleConfigurationDeactivateCoreOutputLabelInitializationTestCase.java
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/java/org/apache/myfaces/extensions/validator/test/trinidad/config/ExtValTrinidadSupportModuleConfigurationDeactivateValidationExceptionInterceptorTestCase.java
    myfaces/extensions/validator/trunk/test-modules/trinidad-component-support-tests/src/test/java/org/apache/myfaces/extensions/validator/test/trinidad/config/ExtValTrinidadSupportModuleConfigurationTestCase.java
Modified:
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/startup/ExtValStartupListener.java
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultValidationErrorMessageResolver.java
    myfaces/extensions/validator/trunk/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/AbstractExValTestCase.java
    myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ConstraintSourceAwareValidation6TestCase.java
    myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/stage/IndependentProjectStageTestCase.java
    myfaces/extensions/validator/trunk/test-modules/pom.xml
    myfaces/extensions/validator/trunk/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation6TestCase.java
    myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/message/resolver/JpaValidationErrorMessageResolver.java
    myfaces/extensions/validator/trunk/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/ExtValCrossValidationModuleConfiguration.java

Modified: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/startup/ExtValStartupListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/startup/ExtValStartupListener.java?rev=966614&r1=966613&r2=966614&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/startup/ExtValStartupListener.java (original)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/startup/ExtValStartupListener.java Thu Jul 22 12:24:16 2010
@@ -102,7 +102,6 @@ public class ExtValStartupListener exten
         initPhaseListeners();
         initViolationSeverityKey();
         initDisableClientSideValidationKey();
-        initRequiredInitialization();
 
         executeCustomStartupListener();
     }
@@ -219,31 +218,4 @@ public class ExtValStartupListener exten
                 ExtValCoreConfiguration.get().disableClientSideValidationValidationParameter(), false);
     }
 
-    private void initRequiredInitialization()
-    {
-        boolean requiredInitialization = ExtValCoreConfiguration.get().activateRequiredInitialization();
-
-        //noinspection deprecation
-        addRequiredInitializationAsGlobalProperty(requiredInitialization);
-
-        initRequiredAttributeSupport();
-    }
-
-    @Deprecated
-    private void addRequiredInitializationAsGlobalProperty(boolean requiredInitialization)
-    {
-        ExtValContext.getContext().addGlobalProperty("mode:init:required", requiredInitialization, false);
-    }
-
-    /**
-     * if it's configured that required init should happen,
-     * it's required to deactivate the support for the required attribute
-     */
-    @Deprecated
-    private void initRequiredAttributeSupport()
-    {
-        ExtValContext.getContext().addGlobalProperty("mode:reset:required",
-                ExtValCoreConfiguration.get().deactivateRequiredAttributeSupport(),
-                false);
-    }
 }

Modified: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultValidationErrorMessageResolver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultValidationErrorMessageResolver.java?rev=966614&r1=966613&r2=966614&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultValidationErrorMessageResolver.java (original)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultValidationErrorMessageResolver.java Thu Jul 22 12:24:16 2010
@@ -18,10 +18,11 @@
  */
 package org.apache.myfaces.extensions.validator.core.validation.message.resolver;
 
-import org.apache.myfaces.extensions.validator.core.InternalConventionProvider;
 import org.apache.myfaces.extensions.validator.core.ExtValCoreConfiguration;
-import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+import org.apache.myfaces.extensions.validator.core.InternalConventionProvider;
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
+import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+import org.apache.myfaces.extensions.validator.util.ClassUtils;
 
 /**
  * Default MessageResolver which uses the default convention for the message bundle.
@@ -39,7 +40,7 @@ public class DefaultValidationErrorMessa
 
     public DefaultValidationErrorMessageResolver()
     {
-        this.baseName = InternalConventionProvider.getModuleMessageBundleName(getClass().getPackage().getName());
+        this.baseName = InternalConventionProvider.getModuleMessageBundleName(ClassUtils.getPackageName(getClass()));
     }
 
     //not used at the moment - just for a convention

Modified: myfaces/extensions/validator/trunk/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/AbstractExValTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/AbstractExValTestCase.java?rev=966614&r1=966613&r2=966614&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/AbstractExValTestCase.java (original)
+++ myfaces/extensions/validator/trunk/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/AbstractExValTestCase.java Thu Jul 22 12:24:16 2010
@@ -32,6 +32,7 @@ import org.apache.myfaces.extensions.val
 import org.apache.myfaces.extensions.validator.core.ExtValContext;
 import org.apache.myfaces.extensions.validator.core.ExtValCoreConfiguration;
 import org.apache.myfaces.extensions.validator.core.DefaultExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.ExtValModuleConfiguration;
 import org.apache.myfaces.extensions.validator.core.el.AbstractELHelperFactory;
 import org.apache.myfaces.extensions.validator.core.el.ELHelper;
 import org.apache.myfaces.shared_impl.config.MyfacesConfig;
@@ -49,6 +50,7 @@ import java.net.URLClassLoader;
 import java.net.URL;
 import java.io.StringWriter;
 import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
 import java.util.HashMap;
 import java.util.Iterator;
 
@@ -162,6 +164,10 @@ public abstract class AbstractExValTestC
 
         expressionFactory = (MockExpressionFactory)application.getExpressionFactory();
 
+        applyCustomConfigurations();
+
+        // This triggers already the config object.  So it is possible that you
+        // need to set your custom config also in the getCustomConfigObjects method.
         final ELHelper defaultElHelper = ExtValUtils.getELHelper();
         ExtValContext.getContext().getFactoryFinder()
                 .getFactory(FactoryNames.EL_HELPER_FACTORY, AbstractELHelperFactory.class)
@@ -219,6 +225,39 @@ public abstract class AbstractExValTestC
     	servletContext.addInitParameter(key, value);
     }
 
+    private void applyCustomConfigurations()
+    {
+        ExtValModuleConfiguration[] customConfigs = getCustomConfigObjects();
+        if (customConfigs != null)
+        {
+            for (ExtValModuleConfiguration moduleConfiguration : customConfigs)
+            {
+                ExtValContext.getContext().addModuleConfiguration(getAbstractModuleConfiguration(moduleConfiguration),
+                        moduleConfiguration, false);
+            }
+        }
+    }
+        
+    protected ExtValModuleConfiguration[] getCustomConfigObjects()
+    {
+        return null;
+    }
+
+    @SuppressWarnings("unchecked")
+    private static Class<? extends ExtValModuleConfiguration> getAbstractModuleConfiguration(
+            Object moduleConfiguration)
+    {
+        Class<? extends ExtValModuleConfiguration> result = (Class<? extends ExtValModuleConfiguration>) moduleConfiguration
+                .getClass();
+        while (!Modifier.isAbstract(result.getModifiers())
+                && !Object.class.getName().equals(result.getName()))
+        {
+            result = (Class<? extends ExtValModuleConfiguration>) result
+                    .getSuperclass();
+        }
+        return result;
+    }        
+        
 	protected abstract void invokeStartupListeners();
 
     /**

Added: myfaces/extensions/validator/trunk/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/util/ClassLoaderTestSuite.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/util/ClassLoaderTestSuite.java?rev=966614&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/util/ClassLoaderTestSuite.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/util/ClassLoaderTestSuite.java Thu Jul 22 12:24:16 2010
@@ -0,0 +1,351 @@
+/*
+ * 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.myfaces.extensions.validator.test.base.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.net.MalformedURLException;
+import java.util.StringTokenizer;
+import java.util.Vector;
+import java.util.jar.Attributes;
+import java.util.jar.Manifest;
+import java.util.logging.Logger;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import junit.runner.TestCaseClassLoader;
+
+/**
+ * Allows the execution of each test of a TestCase into a different classloader.
+ * Specify the class of the test case in the constructor and return the instance
+ * of the ClassLoaderTestSuite as the result of the suite method.
+ * 
+ * Most of the code is borrowed from junit.framework.TestSuite.
+ * 
+ * @author Rudy De Busscher
+ * 
+ */
+@SuppressWarnings("unchecked")
+public class ClassLoaderTestSuite extends TestSuite
+{
+    private static final Logger LOGGER = Logger.getLogger(ClassLoaderTestSuite.class.getName());
+    
+    // The classpath is needed because the custom class loader looks their to find the classes.
+    private static String classPath;
+    private static boolean classPathDetermined = false;
+
+    public ClassLoaderTestSuite(Class theClass)
+    {
+        identifyTestMethods(theClass);
+
+    }
+
+    /**
+     * Identify test methods.
+     * 
+     * @param theClass
+     *            the class
+     */
+    private void identifyTestMethods(Class theClass)
+    {
+        Class superClass = theClass;
+        Vector names = new Vector();
+        while (Test.class.isAssignableFrom(superClass))
+        {
+            Method[] methods = superClass.getDeclaredMethods();
+            for (int i = 0; i < methods.length; i++)
+            {
+                addTestMethod(methods[i], names, theClass);
+            }
+            superClass = superClass.getSuperclass();
+        }
+    }
+
+    /**
+     * Adds the method as a test method when it fulfill all requirements.
+     * 
+     * @param method
+     *            the method that is maybe a test method
+     * @param names
+     *            the names with all the discovered test methods
+     * @param theClass
+     *            the class
+     */
+    private void addTestMethod(Method method, Vector names, Class theClass)
+    {
+        String name = method.getName();
+        if (names.contains(name))
+        {
+            return;
+        }
+        if (!isPublicTestMethod(method))
+        {
+            if (isTestMethod(method))
+            {
+                addTest(warning("Test method isn't public: " + method.getName()));
+            }
+            return;
+        }
+        names.addElement(name);
+        addTest(createTestWithCustomClassLoader(theClass, name));
+    }
+
+    /**
+     * The method creates a Test using a custom classloader for each test.
+     * 
+     * @param theOriginalClass
+     *            The class
+     * @param name
+     *            The test method name
+     * @return The test where class is now loaded from a custom class loader.
+     */
+    static public Test createTestWithCustomClassLoader(Class theOriginalClass, String name)
+    {
+        
+        ClassLoader classLoader;
+
+        String surefireTestPath = getClassPath();
+        if (surefireTestPath != null)
+        {
+            classLoader = new TestCaseClassLoader(surefireTestPath);
+        }
+
+        else
+        {
+            classLoader = new TestCaseClassLoader();
+
+        }
+
+        Class theClass = null;
+        try
+        {
+            // Use the custom classloader to load the test. The complete
+            // execution of the test will then be done using this new
+            // classloader.
+            theClass = classLoader.loadClass(theOriginalClass.getName());
+        } catch (ClassNotFoundException e)
+        {
+            return warning("Cannot custom load test case: " + name + " (" + exceptionToString(e) + ")");
+        }
+
+        Constructor constructor;
+        try
+        {
+            constructor = getTestConstructor(theClass);
+        } catch (NoSuchMethodException e)
+        {
+            return warning("Class " + theClass.getName()
+                    + " has no public constructor TestCase(String name) or TestCase()");
+        }
+        Object test;
+        try
+        {
+            if (constructor.getParameterTypes().length == 0)
+            {
+                test = constructor.newInstance(new Object[0]);
+                if (test instanceof TestCase)
+                    ((TestCase) test).setName(name);
+            } else
+            {
+                test = constructor.newInstance(new Object[] { name });
+            }
+        } catch (InstantiationException e)
+        {
+            return (warning("Cannot instantiate test case: " + name + " (" + exceptionToString(e) + ")"));
+        } catch (InvocationTargetException e)
+        {
+            return (warning("Exception in constructor: " + name + " (" + exceptionToString(e.getTargetException())
+                    + ")"));
+        } catch (IllegalAccessException e)
+        {
+            return (warning("Cannot access test case: " + name + " (" + exceptionToString(e) + ")"));
+        }
+        return (Test) test;
+    }
+
+    /**
+     * Gets the class path.This value is cached in a static variable for performance reasons.
+     * 
+     * @return the class path
+     */
+    private static String getClassPath()
+    {
+        if (classPathDetermined) {
+            return classPath;
+        }
+        
+        classPathDetermined = true;
+        // running from maven, we have the classpath in this property.
+        classPath = System.getProperty("surefire.test.class.path");
+        if (classPath != null) {
+            return classPath;
+        }
+        
+        // For a multi module project, running it from the top we have to find it using another way.
+        // We also need to set useSystemClassLoader=true in the POM so that we gets a jar with the classpath in it.
+        String booterClassPath = System.getProperty("java.class.path");
+        Vector pathItems = null;
+        if (booterClassPath != null)
+        {
+            pathItems = scanPath(booterClassPath);
+        }
+        // Do we have just 1 entry as classpath which is a jar?
+        if (pathItems != null && pathItems.size() == 1 && isJar((String) pathItems.get(0)))
+        {
+            classPath = loadJarManifestClassPath((String) pathItems.get(0), "META-INF/MANIFEST.MF");
+        }
+        return classPath;
+
+    }
+
+    /**
+     * Load jar manifest class path.
+     * 
+     * @param path the path
+     * @param fileName the file name
+     * 
+     * @return the string
+     */
+    private static String loadJarManifestClassPath(String path, String fileName)
+    {
+        File archive = new File(path);
+        if (!archive.exists()) {
+            return null;
+        }
+        ZipFile zipFile= null;
+
+        try {
+            zipFile= new ZipFile(archive);
+        } catch(IOException io) {
+            return null;
+        }
+
+        ZipEntry entry= zipFile.getEntry(fileName);
+        if (entry == null)  {
+            return null;     
+        }
+        try
+        {
+            Manifest mf = new Manifest();
+            mf.read(zipFile.getInputStream(entry));
+
+            return mf.getMainAttributes().getValue(
+                    Attributes.Name.CLASS_PATH).replaceAll(" ", System.getProperty("path.separator")).replaceAll("file:/", "");
+        } catch (MalformedURLException e)
+        {
+            LOGGER.throwing("ClassLoaderTestSuite", "loadJarManifestClassPath", e);
+        } catch (IOException e)
+        {
+            LOGGER.throwing("ClassLoaderTestSuite", "loadJarManifestClassPath", e);
+        }
+        return null;
+    }
+
+    private static boolean isJar(String pathEntry)
+    {
+        return pathEntry.endsWith(".jar") || pathEntry.endsWith(".zip");
+    }
+
+    private static Vector scanPath(String classPath)
+    {
+        String separator = System.getProperty("path.separator");
+        Vector pathItems = new Vector(10);
+        StringTokenizer st = new StringTokenizer(classPath, separator);
+        while (st.hasMoreTokens())
+        {
+            pathItems.addElement(st.nextToken());
+        }
+        return pathItems;
+    }
+
+    /**
+     * Checks if is public test method.
+     * 
+     * @param method
+     *            the method
+     * 
+     * @return true, if is public test method
+     */
+    private boolean isPublicTestMethod(Method method)
+    {
+        return isTestMethod(method) && Modifier.isPublic(method.getModifiers());
+    }
+
+    /**
+     * Checks if is test method.
+     * 
+     * @param method
+     *            the method
+     * 
+     * @return true, if is test method
+     */
+    private boolean isTestMethod(Method method)
+    {
+        String name = method.getName();
+        Class[] parameters = method.getParameterTypes();
+        Class returnType = method.getReturnType();
+        return parameters.length == 0 && name.startsWith("test") && returnType.equals(Void.TYPE);
+    }
+
+    /**
+     * Creates a Test that generates a failure with the supplied message.
+     * 
+     * @param message
+     *            the message
+     * 
+     * @return the test
+     */
+    private static Test warning(final String message)
+    {
+        return new TestCase("warning")
+        {
+            protected void runTest()
+            {
+                fail(message);
+            }
+        };
+    }
+
+    /**
+     * Exception to string.
+     * 
+     * @param t
+     *            the t
+     * 
+     * @return the string
+     */
+    private static String exceptionToString(Throwable t)
+    {
+        StringWriter stringWriter = new StringWriter();
+        PrintWriter writer = new PrintWriter(stringWriter);
+        t.printStackTrace(writer);
+        return stringWriter.toString();
+
+    }
+
+}

Modified: myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ConstraintSourceAwareValidation6TestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ConstraintSourceAwareValidation6TestCase.java?rev=966614&r1=966613&r2=966614&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ConstraintSourceAwareValidation6TestCase.java (original)
+++ myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ConstraintSourceAwareValidation6TestCase.java Thu Jul 22 12:24:16 2010
@@ -18,25 +18,29 @@
  */
 package org.apache.myfaces.extensions.validator.test.beanval;
 
+import java.lang.annotation.Annotation;
+
+import javax.faces.application.FacesMessage;
+
 import junit.framework.Test;
-import junit.framework.TestSuite;
+
 import org.apache.myfaces.extensions.validator.core.DefaultExtValCoreConfiguration;
 import org.apache.myfaces.extensions.validator.core.ExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.ExtValModuleConfiguration;
+import org.apache.myfaces.extensions.validator.test.base.util.ClassLoaderTestSuite;
 import org.apache.myfaces.extensions.validator.test.beanval.custom.CustomConstraintSource;
 import org.apache.myfaces.extensions.validator.test.beanval.custom.CustomIgnoreConstraintSource;
 import org.apache.myfaces.extensions.validator.test.beanval.custom.CustomTargetProperty;
 import org.apache.myfaces.extensions.validator.test.beanval.custom.CustomTargetPropertyId;
 import org.apache.myfaces.extensions.validator.test.beanval.model.ConstraintSourceAware6Bean;
 
-import javax.faces.application.FacesMessage;
-import java.lang.annotation.Annotation;
-
 /**
  * EXTVAL-83
  *
  * @author Gerhard Petracek
  */
-public class ConstraintSourceAwareValidation6TestCase extends BaseBeanValPropertyValidationTestCase<ConstraintSourceAware6Bean>
+public class ConstraintSourceAwareValidation6TestCase extends
+        BaseBeanValPropertyValidationTestCase<ConstraintSourceAware6Bean>
 {
     public ConstraintSourceAwareValidation6TestCase(String name)
     {
@@ -45,7 +49,7 @@ public class ConstraintSourceAwareValida
 
     public static Test suite()
     {
-        return new TestSuite(ConstraintSourceAwareValidation6TestCase.class);
+        return new ClassLoaderTestSuite(ConstraintSourceAwareValidation6TestCase.class);
     }
 
     protected ConstraintSourceAware6Bean getBeanToTest()
@@ -54,11 +58,10 @@ public class ConstraintSourceAwareValida
     }
 
     @Override
-    protected void setUp() throws Exception
+    protected ExtValCoreConfiguration getCustomExtValCoreConfiguration()
     {
-        super.setUp();
-
-        ExtValCoreConfiguration.use(new DefaultExtValCoreConfiguration() {
+        return new DefaultExtValCoreConfiguration()
+        {
             @Override
             public Class<? extends Annotation> constraintSourceAnnotation()
             {
@@ -82,7 +85,8 @@ public class ConstraintSourceAwareValida
             {
                 return CustomTargetPropertyId.class;
             }
-        }, true);
+
+        };
     }
 
     public void testCustomAnnotations1()

Added: myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/custom/RenderKitWrapperFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/custom/RenderKitWrapperFactory.java?rev=966614&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/custom/RenderKitWrapperFactory.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/custom/RenderKitWrapperFactory.java Thu Jul 22 12:24:16 2010
@@ -0,0 +1,17 @@
+package org.apache.myfaces.extensions.validator.custom;
+
+import org.apache.myfaces.extensions.validator.core.renderkit.DefaultRenderKitWrapperFactory;
+
+public class RenderKitWrapperFactory extends DefaultRenderKitWrapperFactory
+{
+
+	@Override
+	protected boolean isApplicationInitialized()
+	{
+		// Required for testcase
+		// ExtValCoreConfigurationDeactivateRenderKitFactoryTestCase
+		// Otherwise VM parameter is checked for deactivation and not config parameter
+		return true;
+	}
+
+}

Added: myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationActivateRequiredInitializationTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationActivateRequiredInitializationTestCase.java?rev=966614&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationActivateRequiredInitializationTestCase.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationActivateRequiredInitializationTestCase.java Thu Jul 22 12:24:16 2010
@@ -0,0 +1,96 @@
+/*
+ * 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.myfaces.extensions.validator.test.core.config;
+
+import junit.framework.Test;
+
+import org.apache.myfaces.extensions.validator.ExtValInformation;
+import org.apache.myfaces.extensions.validator.core.DefaultExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.ExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.test.base.util.ClassLoaderTestSuite;
+import org.apache.myfaces.extensions.validator.util.ExtValUtils;
+
+/**
+ * 
+ * @author Rudy De Busscher
+ * since v4
+ *
+ */
+public class ExtValCoreConfigurationActivateRequiredInitializationTestCase extends ExtValCoreConfigurationTestCase
+{
+
+    public ExtValCoreConfigurationActivateRequiredInitializationTestCase(String name)
+    {
+        super(name);
+    }
+
+    @Override
+    protected void addInitializationParameters()
+    {
+        super.addInitializationParameters();
+        if (needXmlParameters())
+        {
+            addInitParameter(ExtValInformation.WEBXML_PARAM_PREFIX + ".ACTIVATE_REQUIRED_INITIALIZATION", "true");
+        }
+    }
+
+    @Override
+    protected ExtValCoreConfiguration getCustomExtValCoreConfiguration()
+    {
+        if (needCustomConfig())
+        {
+            return new DefaultExtValCoreConfiguration()
+            {
+
+                @Override
+                public boolean activateRequiredInitialization()
+                {
+
+                    return true;
+                }
+
+            };
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+    public void testActivateRequiredInitializationDefault()
+    {
+        assertFalse(ExtValUtils.isRequiredInitializationActive());
+    }
+
+    public void testActivateRequiredInitializationWebXml()
+    {
+        assertTrue(ExtValUtils.isRequiredInitializationActive());
+    }
+
+    public void testActivateRequiredInitializationCustomConfig()
+    {
+        assertTrue(ExtValUtils.isRequiredInitializationActive());
+    }
+
+    public static Test suite()
+    {
+
+        return new ClassLoaderTestSuite(ExtValCoreConfigurationActivateRequiredInitializationTestCase.class);
+    }
+}

Added: myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationConstraintSourceAnnotationTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationConstraintSourceAnnotationTestCase.java?rev=966614&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationConstraintSourceAnnotationTestCase.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationConstraintSourceAnnotationTestCase.java Thu Jul 22 12:24:16 2010
@@ -0,0 +1,111 @@
+/*
+ * 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.myfaces.extensions.validator.test.core.config;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+
+import junit.framework.Test;
+
+import org.apache.myfaces.extensions.validator.core.DefaultExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.ExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.storage.PropertyStorage;
+import org.apache.myfaces.extensions.validator.test.base.util.ClassLoaderTestSuite;
+import org.apache.myfaces.extensions.validator.test.core.config.support.ConstraintSourceAware2MetaDataBean;
+import org.apache.myfaces.extensions.validator.test.core.config.support.ConstraintSourceAwareBean;
+import org.apache.myfaces.extensions.validator.test.core.config.support.ConstraintSourceAwareMetaDataBean;
+import org.apache.myfaces.extensions.validator.test.core.config.support.CustomConstraintSource;
+import org.apache.myfaces.extensions.validator.util.ConstraintSourceUtils;
+import org.apache.myfaces.extensions.validator.util.ReflectionUtils;
+
+/**
+ * 
+ * @author Rudy De Busscher
+ * since v4
+ *
+ */
+public class ExtValCoreConfigurationConstraintSourceAnnotationTestCase extends ExtValCoreConfigurationTestCase
+{
+    public ExtValCoreConfigurationConstraintSourceAnnotationTestCase(String name)
+    {
+        super(name);
+    }
+
+    @Override
+    protected ExtValCoreConfiguration getCustomExtValCoreConfiguration()
+    {
+        if (needCustomConfig())
+        {
+            return new DefaultExtValCoreConfiguration()
+            {
+                @Override
+                public Class<? extends Annotation> constraintSourceAnnotation()
+                {
+                    return CustomConstraintSource.class;
+                }
+
+            };
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+    public void testConstraintSourceAnnotationDefault()
+    {
+        // Using the ConstraintSourceUtils.resolveMappedConstraintSourceFor
+        // needs to much setup.
+
+        Method method = ReflectionUtils.tryToGetMethod(ConstraintSourceUtils.class, "findMappedClass",
+                PropertyStorage.class, Class.class, String.class);
+        assertNotNull(method);
+        method.setAccessible(true);
+        Object[] args = new Object[3];
+        args[0] = ReflectionUtils.getPropertyStorage();
+        args[1] = ConstraintSourceAwareBean.class;
+        args[2] = "property2";
+        Object result = ReflectionUtils.tryToInvokeMethodOfClass(ConstraintSourceUtils.class, method, args);
+        assertNotNull(result);
+        assertEquals(ConstraintSourceAwareMetaDataBean.class, result);
+
+    }
+
+    public void testConstraintSourceAnnotationCustomConfig()
+    {
+        Method method = ReflectionUtils.tryToGetMethod(ConstraintSourceUtils.class, "findMappedClass",
+                PropertyStorage.class, Class.class, String.class);
+        assertNotNull(method);
+        method.setAccessible(true);
+        Object[] args = new Object[3];
+        args[0] = ReflectionUtils.getPropertyStorage();
+        args[1] = ConstraintSourceAwareBean.class;
+        args[2] = "property2";
+        Object result = ReflectionUtils.tryToInvokeMethodOfClass(ConstraintSourceUtils.class, method, args);
+        assertNotNull(result);
+        assertEquals(ConstraintSourceAware2MetaDataBean.class, result);
+    }
+
+    public static Test suite()
+    {
+
+        return new ClassLoaderTestSuite(ExtValCoreConfigurationConstraintSourceAnnotationTestCase.class);
+    }
+
+}

Added: myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomBasePackageTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomBasePackageTestCase.java?rev=966614&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomBasePackageTestCase.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomBasePackageTestCase.java Thu Jul 22 12:24:16 2010
@@ -0,0 +1,103 @@
+/*
+ * 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.myfaces.extensions.validator.test.core.config;
+
+import junit.framework.Test;
+
+import org.apache.myfaces.extensions.validator.ExtValInformation;
+import org.apache.myfaces.extensions.validator.core.CustomInformation;
+import org.apache.myfaces.extensions.validator.core.DefaultExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.ExtValContext;
+import org.apache.myfaces.extensions.validator.core.ExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.test.base.util.ClassLoaderTestSuite;
+
+/**
+ * 
+ * @author Rudy De Busscher
+ * since v4
+ *
+ */
+public class ExtValCoreConfigurationCustomBasePackageTestCase extends ExtValCoreConfigurationTestCase
+{
+
+    private static final String ORG_APACHE_MYFACES_EXTENSIONS_VALIDATOR_TEST = "org.apache.myfaces.extensions.validator.test.";
+    private static final String ORG_APACHE_MYFACES_EXTENSIONS_VALIDATOR_CONFIG = "org.apache.myfaces.extensions.validator.config.";
+
+    public ExtValCoreConfigurationCustomBasePackageTestCase(String name)
+    {
+        super(name);
+
+    }
+
+    protected void addInitializationParameters()
+    {
+        super.addInitializationParameters();
+        if (needXmlParameters())
+        {
+            addInitParameter(ExtValInformation.WEBXML_PARAM_PREFIX + ".CUSTOM_BASE_PACKAGE",
+                    ORG_APACHE_MYFACES_EXTENSIONS_VALIDATOR_TEST);
+        }
+    }
+
+    @Override
+    protected ExtValCoreConfiguration getCustomExtValCoreConfiguration()
+    {
+        if (needCustomConfig())
+        {
+            return new DefaultExtValCoreConfiguration()
+            {
+                @Override
+                public String customBasePackage()
+                {
+                    return ORG_APACHE_MYFACES_EXTENSIONS_VALIDATOR_CONFIG;
+                }
+            };
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+    public void testCustomBasePackageDefault() throws Exception
+    {
+        String value = ExtValContext.getContext().getInformationProviderBean().get(CustomInformation.BASE_PACKAGE);
+        assertEquals("org.apache.myfaces.extensions.validator.custom.", value);
+    }
+
+    public void testCustomBasePackageWebXml()
+    {
+
+        String value = ExtValContext.getContext().getInformationProviderBean().get(CustomInformation.BASE_PACKAGE);
+        assertEquals(ORG_APACHE_MYFACES_EXTENSIONS_VALIDATOR_TEST, value);
+    }
+
+    public void testCustomBasePackageCustomConfig()
+    {
+
+        String value = ExtValContext.getContext().getInformationProviderBean().get(CustomInformation.BASE_PACKAGE);
+        assertEquals(ORG_APACHE_MYFACES_EXTENSIONS_VALIDATOR_CONFIG, value);
+    }
+
+    public static Test suite()
+    {
+        return new ClassLoaderTestSuite(ExtValCoreConfigurationCustomBasePackageTestCase.class);
+    }
+
+}

Added: myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomComponentInitializerClassNameTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomComponentInitializerClassNameTestCase.java?rev=966614&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomComponentInitializerClassNameTestCase.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomComponentInitializerClassNameTestCase.java Thu Jul 22 12:24:16 2010
@@ -0,0 +1,125 @@
+/*
+ * 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.myfaces.extensions.validator.test.core.config;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import junit.framework.Test;
+
+import org.apache.myfaces.extensions.validator.ExtValInformation;
+import org.apache.myfaces.extensions.validator.core.DefaultExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.ExtValContext;
+import org.apache.myfaces.extensions.validator.core.ExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.initializer.component.ComponentInitializer;
+import org.apache.myfaces.extensions.validator.test.base.util.ClassLoaderTestSuite;
+
+/**
+ * 
+ * @author Rudy De Busscher
+ * since v4
+ *
+ */
+public class ExtValCoreConfigurationCustomComponentInitializerClassNameTestCase extends ExtValCoreConfigurationTestCase
+{
+
+    public ExtValCoreConfigurationCustomComponentInitializerClassNameTestCase(String name)
+    {
+        super(name);
+    }
+
+    public static class CustomComponentInitializer implements ComponentInitializer
+    {
+
+        public void configureComponent(FacesContext facesContext, UIComponent uiComponent, Map<String, Object> metaData)
+        {
+
+        }
+
+    }
+
+    public static class Custom2ComponentInitializer implements ComponentInitializer
+    {
+
+        public void configureComponent(FacesContext facesContext, UIComponent uiComponent, Map<String, Object> metaData)
+        {
+
+        }
+
+    }
+
+    protected void addInitializationParameters()
+    {
+        super.addInitializationParameters();
+        if (needXmlParameters())
+        {
+            addInitParameter(ExtValInformation.WEBXML_PARAM_PREFIX + ".CUSTOM_COMPONENT_INITIALIZER",
+                    CustomComponentInitializer.class.getName());
+        }
+    }
+
+    @Override
+    protected ExtValCoreConfiguration getCustomExtValCoreConfiguration()
+    {
+        if (needCustomConfig())
+        {
+            return new DefaultExtValCoreConfiguration()
+            {
+                @Override
+                public String customComponentInitializerClassName()
+                {
+                    return Custom2ComponentInitializer.class.getName();
+                }
+            };
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+    public void testCustomComponentInitializerClassNameDefault()
+    {
+        assertEquals(0, ExtValContext.getContext().getComponentInitializers().size());
+    }
+
+    public void testCustomComponentInitializerClassNameWebXml()
+    {
+        List<ComponentInitializer> initializers = ExtValContext.getContext().getComponentInitializers();
+        assertEquals(1, initializers.size());
+        assertEquals(CustomComponentInitializer.class.getName(), initializers.get(0).getClass().getName());
+    }
+
+    public void testCustomComponentInitializerClassNameCustomConfig()
+    {
+        List<ComponentInitializer> initializers = ExtValContext.getContext().getComponentInitializers();
+        assertEquals(1, initializers.size());
+        assertEquals(Custom2ComponentInitializer.class.getName(), initializers.get(0).getClass().getName());
+    }
+
+    public static Test suite()
+    {
+
+        return new ClassLoaderTestSuite(ExtValCoreConfigurationCustomComponentInitializerClassNameTestCase.class);
+    }
+
+}

Added: myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomComponentMetaDataExtractorClassNameTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomComponentMetaDataExtractorClassNameTestCase.java?rev=966614&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomComponentMetaDataExtractorClassNameTestCase.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomComponentMetaDataExtractorClassNameTestCase.java Thu Jul 22 12:24:16 2010
@@ -0,0 +1,141 @@
+/*
+ * 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.myfaces.extensions.validator.test.core.config;
+
+import javax.faces.context.FacesContext;
+
+import junit.framework.Test;
+
+import org.apache.myfaces.extensions.validator.ExtValInformation;
+import org.apache.myfaces.extensions.validator.core.DefaultExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.ExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.metadata.extractor.DefaultComponentMetaDataExtractorFactory;
+import org.apache.myfaces.extensions.validator.core.metadata.extractor.MetaDataExtractor;
+import org.apache.myfaces.extensions.validator.core.property.DefaultPropertyInformation;
+import org.apache.myfaces.extensions.validator.core.property.PropertyInformation;
+import org.apache.myfaces.extensions.validator.core.property.PropertyInformationKeys;
+import org.apache.myfaces.extensions.validator.test.base.util.ClassLoaderTestSuite;
+
+/**
+ * 
+ * @author Rudy De Busscher
+ * since v4
+ *
+ */
+public class ExtValCoreConfigurationCustomComponentMetaDataExtractorClassNameTestCase extends
+        ExtValCoreConfigurationTestCase
+{
+    private static final String WEB_XML = "Web.XML";
+    private static final String CUSTOM_CONFIG = "Custom config";
+
+    public ExtValCoreConfigurationCustomComponentMetaDataExtractorClassNameTestCase(String name)
+    {
+        super(name);
+    }
+
+    public static class CustomMetaDataExtractor implements MetaDataExtractor
+    {
+
+        public PropertyInformation extract(FacesContext facesContext, Object object)
+        {
+            PropertyInformation result = new DefaultPropertyInformation();
+            result.setInformation(PropertyInformationKeys.CUSTOM_PROPERTIES, WEB_XML);
+            return result;
+        }
+
+    }
+
+    public static class CustomMetaDataExtractor2 implements MetaDataExtractor
+    {
+
+        public PropertyInformation extract(FacesContext facesContext, Object object)
+        {
+            PropertyInformation result = new DefaultPropertyInformation();
+            result.setInformation(PropertyInformationKeys.CUSTOM_PROPERTIES, CUSTOM_CONFIG);
+            return result;
+        }
+
+    }
+
+    protected void addInitializationParameters()
+    {
+        super.addInitializationParameters();
+        if (needXmlParameters())
+        {
+            addInitParameter(ExtValInformation.WEBXML_PARAM_PREFIX + ".CUSTOM_COMPONENT_META_DATA_EXTRACTOR",
+                    CustomMetaDataExtractor.class.getName());
+
+        }
+    }
+
+    @Override
+    protected ExtValCoreConfiguration getCustomExtValCoreConfiguration()
+    {
+        if (needCustomConfig())
+        {
+            return new DefaultExtValCoreConfiguration()
+            {
+                @Override
+                public String customComponentMetaDataExtractorClassName()
+                {
+                    return CustomMetaDataExtractor2.class.getName();
+                }
+            };
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+    public void testCustomComponentMetaDataExtractorClassNameDefault()
+    {
+        DefaultComponentMetaDataExtractorFactory factory = new DefaultComponentMetaDataExtractorFactory();
+        MetaDataExtractor extractor = factory.create();
+        PropertyInformation propInformation = extractor.extract(facesContext, new Object());
+        // Object isn't allowed so we get an empty propertyInformation object
+        // back.
+        // The web.xml and custom config sets an extractor that enters something
+        // here.
+        assertNull(propInformation.getInformation(PropertyInformationKeys.CUSTOM_PROPERTIES));
+    }
+
+    public void testCustomComponentMetaDataExtractorClassNameWebXml()
+    {
+        DefaultComponentMetaDataExtractorFactory factory = new DefaultComponentMetaDataExtractorFactory();
+        MetaDataExtractor extractor = factory.create();
+        PropertyInformation propInformation = extractor.extract(facesContext, new Object());
+        assertEquals(WEB_XML, propInformation.getInformation(PropertyInformationKeys.CUSTOM_PROPERTIES));
+    }
+
+    public void testCustomComponentMetaDataExtractorClassNameCustomConfig()
+    {
+        DefaultComponentMetaDataExtractorFactory factory = new DefaultComponentMetaDataExtractorFactory();
+        MetaDataExtractor extractor = factory.create();
+        PropertyInformation propInformation = extractor.extract(facesContext, new Object());
+        assertEquals(CUSTOM_CONFIG, propInformation.getInformation(PropertyInformationKeys.CUSTOM_PROPERTIES));
+    }
+
+    public static Test suite()
+    {
+
+        return new ClassLoaderTestSuite(ExtValCoreConfigurationCustomComponentMetaDataExtractorClassNameTestCase.class);
+    }
+
+}

Added: myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomComponentMetaDataExtractorFactoryClassNameTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomComponentMetaDataExtractorFactoryClassNameTestCase.java?rev=966614&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomComponentMetaDataExtractorFactoryClassNameTestCase.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomComponentMetaDataExtractorFactoryClassNameTestCase.java Thu Jul 22 12:24:16 2010
@@ -0,0 +1,149 @@
+/*
+ * 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.myfaces.extensions.validator.test.core.config;
+
+import java.util.Map;
+
+import junit.framework.Test;
+
+import org.apache.myfaces.extensions.validator.ExtValInformation;
+import org.apache.myfaces.extensions.validator.core.DefaultExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.ExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.factory.DefaultFactoryFinder;
+import org.apache.myfaces.extensions.validator.core.factory.FactoryFinder;
+import org.apache.myfaces.extensions.validator.core.factory.FactoryNames;
+import org.apache.myfaces.extensions.validator.core.metadata.extractor.ComponentMetaDataExtractorFactory;
+import org.apache.myfaces.extensions.validator.core.metadata.extractor.DefaultComponentMetaDataExtractorFactory;
+import org.apache.myfaces.extensions.validator.core.metadata.extractor.MetaDataExtractor;
+import org.apache.myfaces.extensions.validator.test.base.util.ClassLoaderTestSuite;
+
+/**
+ * 
+ * @author Rudy De Busscher
+ * since v4
+ *
+ */
+public class ExtValCoreConfigurationCustomComponentMetaDataExtractorFactoryClassNameTestCase extends
+        ExtValCoreConfigurationTestCase
+{
+    public ExtValCoreConfigurationCustomComponentMetaDataExtractorFactoryClassNameTestCase(String name)
+    {
+        super(name);
+    }
+
+    public static class CustomComponentMetaDataExtractorFactory implements ComponentMetaDataExtractorFactory
+    {
+
+        public MetaDataExtractor create()
+        {
+
+            return null;
+        }
+
+        public MetaDataExtractor createWith(Map<String, Object> properties)
+        {
+
+            return null;
+        }
+
+    }
+
+    public static class Custom2ComponentMetaDataExtractorFactory implements ComponentMetaDataExtractorFactory
+    {
+
+        public MetaDataExtractor create()
+        {
+
+            return null;
+        }
+
+        public MetaDataExtractor createWith(Map<String, Object> properties)
+        {
+
+            return null;
+        }
+
+    }
+
+    protected void addInitializationParameters()
+    {
+        super.addInitializationParameters();
+        if (needXmlParameters())
+        {
+            addInitParameter(ExtValInformation.WEBXML_PARAM_PREFIX + ".CUSTOM_COMPONENT_META_DATA_EXTRACTOR_FACTORY",
+                    CustomComponentMetaDataExtractorFactory.class.getName());
+
+        }
+    }
+
+    @Override
+    protected ExtValCoreConfiguration getCustomExtValCoreConfiguration()
+    {
+        if (needCustomConfig())
+        {
+            return new DefaultExtValCoreConfiguration()
+            {
+
+                @Override
+                public String customComponentMetaDataExtractorFactoryClassName()
+                {
+
+                    return Custom2ComponentMetaDataExtractorFactory.class.getName();
+                }
+
+            };
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+    public void testCustomComponentMetaDataExtractorFactoryClassNameDefault()
+    {
+        FactoryFinder factoryFinder = DefaultFactoryFinder.getInstance();
+        Object factory = factoryFinder.getFactory(FactoryNames.COMPONENT_META_DATA_EXTRACTOR_FACTORY,
+                ComponentMetaDataExtractorFactory.class);
+        assertEquals(DefaultComponentMetaDataExtractorFactory.class.getName(), factory.getClass().getName());
+    }
+
+    public void testCustomComponentMetaDataExtractorFactoryClassNameWebXml()
+    {
+        FactoryFinder factoryFinder = DefaultFactoryFinder.getInstance();
+        Object factory = factoryFinder.getFactory(FactoryNames.COMPONENT_META_DATA_EXTRACTOR_FACTORY,
+                ComponentMetaDataExtractorFactory.class);
+        assertEquals(CustomComponentMetaDataExtractorFactory.class.getName(), factory.getClass().getName());
+    }
+
+    public void testCustomComponentMetaDataExtractorFactoryClassNameCustomConfig()
+    {
+        FactoryFinder factoryFinder = DefaultFactoryFinder.getInstance();
+        Object factory = factoryFinder.getFactory(FactoryNames.COMPONENT_META_DATA_EXTRACTOR_FACTORY,
+                ComponentMetaDataExtractorFactory.class);
+        assertEquals(Custom2ComponentMetaDataExtractorFactory.class.getName(), factory.getClass().getName());
+    }
+
+    public static Test suite()
+    {
+
+        return new ClassLoaderTestSuite(
+                ExtValCoreConfigurationCustomComponentMetaDataExtractorFactoryClassNameTestCase.class);
+    }
+
+}

Added: myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomFacesMessageFactoryClassNameTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomFacesMessageFactoryClassNameTestCase.java?rev=966614&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomFacesMessageFactoryClassNameTestCase.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomFacesMessageFactoryClassNameTestCase.java Thu Jul 22 12:24:16 2010
@@ -0,0 +1,139 @@
+/*
+ * 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.myfaces.extensions.validator.test.core.config;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.application.FacesMessage.Severity;
+
+import junit.framework.Test;
+
+import org.apache.myfaces.extensions.validator.ExtValInformation;
+import org.apache.myfaces.extensions.validator.core.DefaultExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.ExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.factory.DefaultFactoryFinder;
+import org.apache.myfaces.extensions.validator.core.factory.FacesMessageFactory;
+import org.apache.myfaces.extensions.validator.core.factory.FactoryFinder;
+import org.apache.myfaces.extensions.validator.core.factory.FactoryNames;
+import org.apache.myfaces.extensions.validator.core.validation.message.DefaultFacesMessageFactory;
+import org.apache.myfaces.extensions.validator.test.base.util.ClassLoaderTestSuite;
+
+/**
+ * 
+ * @author Rudy De Busscher
+ * since v4
+ *
+ */
+public class ExtValCoreConfigurationCustomFacesMessageFactoryClassNameTestCase extends ExtValCoreConfigurationTestCase
+{
+    public ExtValCoreConfigurationCustomFacesMessageFactoryClassNameTestCase(String name)
+    {
+        super(name);
+    }
+
+    public static class CustomFacesMessageFactory implements FacesMessageFactory
+    {
+
+        public FacesMessage convert(FacesMessage facesMessage)
+        {
+            return null;
+        }
+
+        public FacesMessage create(Severity severity, String summary, String detail)
+        {
+            return null;
+        }
+
+    }
+
+    public static class Custom2FacesMessageFactory implements FacesMessageFactory
+    {
+
+        public FacesMessage convert(FacesMessage facesMessage)
+        {
+            return null;
+        }
+
+        public FacesMessage create(Severity severity, String summary, String detail)
+        {
+            return null;
+        }
+
+    }
+
+    @Override
+    protected void addInitializationParameters()
+    {
+        super.addInitializationParameters();
+        if (needXmlParameters())
+        {
+            addInitParameter(ExtValInformation.WEBXML_PARAM_PREFIX + ".CUSTOM_FACES_MESSAGE_FACTORY",
+                    CustomFacesMessageFactory.class.getName());
+
+        }
+    }
+
+    @Override
+    protected ExtValCoreConfiguration getCustomExtValCoreConfiguration()
+    {
+        if (needCustomConfig())
+        {
+            return new DefaultExtValCoreConfiguration()
+            {
+                @Override
+                public String customFacesMessageFactoryClassName()
+                {
+                    return Custom2FacesMessageFactory.class.getName();
+                }
+            };
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+    public void testCustomFacesMessageFactoryClassNameDefault()
+    {
+        FactoryFinder factoryFinder = DefaultFactoryFinder.getInstance();
+        Object factory = factoryFinder.getFactory(FactoryNames.FACES_MESSAGE_FACTORY, FacesMessageFactory.class);
+        assertEquals(DefaultFacesMessageFactory.class.getName(), factory.getClass().getName());
+
+    }
+
+    public void testCustomFacesMessageFactoryClassNameWebXml()
+    {
+        FactoryFinder factoryFinder = DefaultFactoryFinder.getInstance();
+        Object factory = factoryFinder.getFactory(FactoryNames.FACES_MESSAGE_FACTORY, FacesMessageFactory.class);
+        assertEquals(CustomFacesMessageFactory.class.getName(), factory.getClass().getName());
+    }
+
+    public void testCustomFacesMessageFactoryClassNameCustomConfig()
+    {
+        FactoryFinder factoryFinder = DefaultFactoryFinder.getInstance();
+        Object factory = factoryFinder.getFactory(FactoryNames.FACES_MESSAGE_FACTORY, FacesMessageFactory.class);
+        assertEquals(Custom2FacesMessageFactory.class.getName(), factory.getClass().getName());
+    }
+
+    public static Test suite()
+    {
+
+        return new ClassLoaderTestSuite(ExtValCoreConfigurationCustomFacesMessageFactoryClassNameTestCase.class);
+    }
+
+}

Added: myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomInformationProviderBeanClassNameTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomInformationProviderBeanClassNameTestCase.java?rev=966614&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomInformationProviderBeanClassNameTestCase.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/core/config/ExtValCoreConfigurationCustomInformationProviderBeanClassNameTestCase.java Thu Jul 22 12:24:16 2010
@@ -0,0 +1,134 @@
+/*
+ * 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.myfaces.extensions.validator.test.core.config;
+
+import java.util.Map;
+
+import junit.framework.Test;
+
+import org.apache.myfaces.extensions.validator.ExtValInformation;
+import org.apache.myfaces.extensions.validator.core.CustomInformation;
+import org.apache.myfaces.extensions.validator.core.DefaultExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.ExtValContext;
+import org.apache.myfaces.extensions.validator.core.ExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.InformationProviderBean;
+import org.apache.myfaces.extensions.validator.test.base.util.ClassLoaderTestSuite;
+
+/**
+ * 
+ * @author Rudy De Busscher
+ * since v4
+ *
+ */
+public class ExtValCoreConfigurationCustomInformationProviderBeanClassNameTestCase extends
+        ExtValCoreConfigurationTestCase
+{
+
+    public ExtValCoreConfigurationCustomInformationProviderBeanClassNameTestCase(String name)
+    {
+        super(name);
+
+    }
+
+    public static class CustomInformationProviderBean extends InformationProviderBean
+    {
+
+        @Override
+        protected void applyCustomValues(Map<CustomInformation, String> map)
+        {
+            map.put(CustomInformation.MESSAGE_BUNDLE_NAME, "X");
+        }
+
+    }
+
+    public static class CustomInformationProviderBean2 extends InformationProviderBean
+    {
+
+        @Override
+        protected void applyCustomValues(Map<CustomInformation, String> map)
+        {
+            map.put(CustomInformation.MESSAGE_BUNDLE_NAME, "Y");
+        }
+
+    }
+
+    protected void addInitializationParameters()
+    {
+        super.addInitializationParameters();
+        if (needXmlParameters())
+        {
+            addInitParameter(ExtValInformation.WEBXML_PARAM_PREFIX + ".CUSTOM_INFORMATION_PROVIDER_BEAN",
+                    CustomInformationProviderBean.class.getName());
+        }
+    }
+
+    @Override
+    protected ExtValCoreConfiguration getCustomExtValCoreConfiguration()
+    {
+        if (needCustomConfig())
+        {
+            return new DefaultExtValCoreConfiguration()
+            {
+                @Override
+                public String customInformationProviderBeanClassName()
+                {
+                    return CustomInformationProviderBean2.class.getName();
+                }
+
+            };
+        }
+        else
+        {
+            return null;
+        }
+
+    }
+
+    public void testCustomInformationProviderBeanClassNameDefault()
+    {
+        InformationProviderBean bean = ExtValContext.getContext().getInformationProviderBean();
+        assertEquals(InformationProviderBean.class.getName(), bean.getClass().getName());
+    }
+
+    public void testCustomInformationProviderBeanClassNameWebXml()
+    {
+        InformationProviderBean bean = ExtValContext.getContext().getInformationProviderBean();
+        assertEquals(CustomInformationProviderBean.class.getName(), bean.getClass().getName());
+        // An additional test to make sure we have the custom
+        // informationProviderBean.
+        assertEquals(ExtValInformation.EXTENSIONS_VALIDATOR_BASE_PACKAGE_NAME + ".custom.X", bean
+                .get(CustomInformation.MESSAGE_BUNDLE_NAME));
+    }
+
+    public void testCustomInformationProviderBeanClassNameCustomConfig()
+    {
+        InformationProviderBean bean = ExtValContext.getContext().getInformationProviderBean();
+        assertEquals(CustomInformationProviderBean2.class.getName(), bean.getClass().getName());
+        // An additional test to make sure we have the custom
+        // informationProviderBean.
+        assertEquals(ExtValInformation.EXTENSIONS_VALIDATOR_BASE_PACKAGE_NAME + ".custom.Y", bean
+                .get(CustomInformation.MESSAGE_BUNDLE_NAME));
+    }
+
+    public static Test suite()
+    {
+        return new ClassLoaderTestSuite(ExtValCoreConfigurationCustomInformationProviderBeanClassNameTestCase.class);
+    }
+
+}