EXTVAL-133: Removed ExtValMockApplication and MockELHelper to keep trunk and branch20 as much as possible in sync.
git-svn-id: https://svn.apache.org/repos/asf/myfaces/extensions/validator/trunk@1129062 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/AbstractExValTestCase.java b/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/AbstractExValTestCase.java
index 1826bb1..86154e5 100644
--- a/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/AbstractExValTestCase.java
+++ b/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/AbstractExValTestCase.java
@@ -84,14 +84,6 @@
}
@Override
- protected void setFactories() throws Exception
- {
- super.setFactories();
- FactoryFinder.setFactory("javax.faces.application.ApplicationFactory", ExtValMockApplicationFactory.class.getName());
-
- }
-
- @Override
protected void setUpRenderKit() throws Exception
{
// Don't call super since we need the ExtValRenderKit and not the Mock one.
@@ -143,20 +135,6 @@
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)
- .setCustomELHelperFactory(new AbstractELHelperFactory()
- {
-
- protected ELHelper createELHelper()
- {
- return new MockELHelper(defaultElHelper);
- }
- });
-
final ExtValCoreConfiguration customExtValCoreConfiguration = getCustomExtValCoreConfiguration();
//execute startup listener
diff --git a/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/mock/ExtValMockApplication.java b/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/mock/ExtValMockApplication.java
deleted file mode 100644
index 2ec685c..0000000
--- a/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/mock/ExtValMockApplication.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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.mock;
-
-import org.apache.myfaces.test.mock.MockApplication;
-
-import javax.el.ELContextListener;
-import javax.el.ELResolver;
-import javax.el.ExpressionFactory;
-import javax.el.ELException;
-import javax.faces.FacesException;
-import javax.faces.application.Application;
-import javax.faces.context.FacesContext;
-import java.util.ResourceBundle;
-
-/**
- * @author Gerhard Petracek
- */
-public class ExtValMockApplication extends MockApplication
-{
- private Application wrapped;
-
- public ExtValMockApplication()
- {
- super();
- }
-
- public ExtValMockApplication(Application application)
- {
- super();
- this.wrapped = application;
- }
-
- @Override
- public ELContextListener[] getELContextListeners()
- {
- return new ELContextListener[0];
- }
-
- @Override
- public ELResolver getELResolver()
- {
- return this.wrapped.getELResolver();
- }
-
- @Override
- public ExpressionFactory getExpressionFactory()
- {
- return new ExtValMockExpressionFactory();
- }
-
- @Override
- public Object evaluateExpressionGet(FacesContext facesContext, String expression, Class aClass) throws ELException
- {
- return wrapped.evaluateExpressionGet(facesContext, expression, aClass);
- }
-
- @Override
- public ResourceBundle getResourceBundle(FacesContext ctx, String name) throws FacesException, NullPointerException
- {
- // TODO We can try here to load a resource bundle.
- return null;
-
- }
-}
\ No newline at end of file
diff --git a/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/mock/ExtValMockApplicationFactory.java b/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/mock/ExtValMockApplicationFactory.java
deleted file mode 100644
index 3e8e095..0000000
--- a/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/mock/ExtValMockApplicationFactory.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.mock;
-
-
-import org.apache.myfaces.test.mock.MockApplicationFactory;
-
-import javax.faces.application.Application;
-
-/**
- * @author Gerhard Petracek
- */
-public class ExtValMockApplicationFactory extends MockApplicationFactory
-{
-
- /**
- * <p>The <code>Application</code> instance to be returned by
- * this factory.</p>
- */
- private Application application = null;
-
- @Override
- public Application getApplication()
- {
- if (application == null) {
- application = new ExtValMockApplication(super.getApplication());
- }
- return application;
- }
-}
\ No newline at end of file
diff --git a/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/mock/MockELHelper.java b/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/mock/MockELHelper.java
deleted file mode 100644
index 8eb21e1..0000000
--- a/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/mock/MockELHelper.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * 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.mock;
-
-import org.apache.myfaces.extensions.validator.core.el.ELHelper;
-import org.apache.myfaces.extensions.validator.core.el.ValueBindingExpression;
-import org.apache.myfaces.extensions.validator.core.property.PropertyDetails;
-
-import javax.faces.context.FacesContext;
-import javax.faces.component.UIComponent;
-
-public class MockELHelper implements ELHelper
-{
- private ELHelper wrapped;
-
- public MockELHelper(ELHelper wrapped)
- {
- this.wrapped = wrapped;
- }
-
- public Object getBean(String beanName)
- {
- return wrapped.getBean(beanName);
- }
-
- public Object getValueOfExpression(FacesContext facesContext, ValueBindingExpression valueBindingExpression)
- {
- if("#{true}".equals(valueBindingExpression.getExpressionString()))
- {
- return Boolean.TRUE;
- }
-
- return wrapped.getValueOfExpression(facesContext, valueBindingExpression);
- }
-
- public Class getTypeOfExpression(FacesContext facesContext, ValueBindingExpression valueBindingExpression)
- {
- return wrapped.getTypeOfExpression(facesContext, valueBindingExpression);
- }
-
- public PropertyDetails getPropertyDetailsOfValueBinding(UIComponent uiComponent)
- {
- return wrapped.getPropertyDetailsOfValueBinding(uiComponent);
- }
-
- public boolean isELTermValid(FacesContext facesContext, String valueBindingExpression)
- {
- return wrapped.isELTermValid(facesContext, valueBindingExpression);
- }
-
- public boolean isELTermWellFormed(Object o)
- {
- return wrapped.isELTermWellFormed(o);
- }
-
- public Object getBindingOfComponent(UIComponent uiComponent, String name)
- {
- return wrapped.getBindingOfComponent(uiComponent, name);
- }
-}
diff --git a/test-modules/pom.xml b/test-modules/pom.xml
index b8b2d5d..d3526ee 100644
--- a/test-modules/pom.xml
+++ b/test-modules/pom.xml
@@ -78,7 +78,7 @@
<dependency>
<groupId>org.apache.myfaces.test</groupId>
<artifactId>myfaces-test12</artifactId>
- <version>1.0.0</version>
+ <version>1.0.4-SNAPSHOT</version>
<scope>test</scope>
</dependency>