Author: alexsmirnov
Date: 2010-11-02 02:11:17 -0400 (Tue, 02 Nov 2010)
New Revision: 19882
Added:
trunk/ui/validator/api/src/main/java/org/richfaces/validator/LibraryFunction.java
trunk/ui/validator/api/src/main/java/org/richfaces/validator/LibraryScriptString.java
trunk/ui/validator/ui/src/test/java/org/richfaces/component/Bean.java
trunk/ui/validator/ui/src/test/java/org/richfaces/component/Script.java
Removed:
trunk/ui/validator/api/src/main/java/org/richfaces/validator/ClientScript.java
trunk/ui/validator/api/src/main/java/org/richfaces/validator/ObjectValidator.java
trunk/ui/validator/ui/src/main/java/org/richfaces/component/ClonedObjectResolver.java
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScript.java
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScriptString.java
trunk/ui/validator/ui/src/test/java/org/richfaces/component/TestBean.java
trunk/ui/validator/ui/src/test/java/org/richfaces/component/TestScript.java
trunk/ui/validator/ui/src/test/java/org/richfaces/component/behavior/ClientValidatorBehaviorTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/convert/BaseConverterTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/convert/BaseConverterTestRunner.java
Modified:
trunk/parent/pom.xml
trunk/ui/validator/api/pom.xml
trunk/ui/validator/api/src/main/java/org/richfaces/validator/LibraryResource.java
trunk/ui/validator/impl/pom.xml
trunk/ui/validator/ui/pom.xml
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientAndAjaxScript.java
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientOnlyScript.java
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScriptFunction.java
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/NullConverterScript.java
trunk/ui/validator/ui/src/test/java/org/richfaces/component/UIValidatorScriptCollectionTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/component/UIViewResourceTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/convert/DateTimeConverterTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetClientSideScriptTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetComponentScriptTest.java
trunk/ui/validator/ui/src/test/resources/org/richfaces/component/WEB-INF/faces-config.xml
trunk/ui/validator/ui/src/test/resources/org/richfaces/component/faces-config.xml
Log:
https://jira.jboss.org/browse/RF-9221
Modified: trunk/parent/pom.xml
===================================================================
--- trunk/parent/pom.xml 2010-11-02 02:44:05 UTC (rev 19881)
+++ trunk/parent/pom.xml 2010-11-02 06:11:17 UTC (rev 19882)
@@ -58,22 +58,22 @@
<dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>htmlunit-client</artifactId>
- <version>1.0.4</version>
+ <version>1.0.5</version>
</dependency>
<dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-mock</artifactId>
- <version>1.0.4</version>
+ <version>1.0.5</version>
</dependency>
<dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-test-stage</artifactId>
- <version>1.0.4</version>
+ <version>1.0.5</version>
</dependency>
<dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-test-jetty</artifactId>
- <version>1.0.4</version>
+ <version>1.0.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Modified: trunk/ui/validator/api/pom.xml
===================================================================
--- trunk/ui/validator/api/pom.xml 2010-11-02 02:44:05 UTC (rev 19881)
+++ trunk/ui/validator/api/pom.xml 2010-11-02 06:11:17 UTC (rev 19882)
@@ -58,18 +58,6 @@
<version>1.0.0.GA</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-mock</artifactId>
- <version>1.0.5</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-test-stage</artifactId>
- <version>1.0.5</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<scm>
Deleted: trunk/ui/validator/api/src/main/java/org/richfaces/validator/ClientScript.java
===================================================================
---
trunk/ui/validator/api/src/main/java/org/richfaces/validator/ClientScript.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/api/src/main/java/org/richfaces/validator/ClientScript.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -1,39 +0,0 @@
-/*
- * $Id$
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.richfaces.validator;
-
-/**
- * <p class="changed_added_4_0">This class contains information about
JavaScript associated with JSF object ( converter or validator )</p>
- * @author asmirnov(a)exadel.com
- *
- */
-public interface ClientScript {
-
- String getLibrary();
-
- String getResourceName();
-
- String getFunctionName();
-
-}
Copied: trunk/ui/validator/api/src/main/java/org/richfaces/validator/LibraryFunction.java
(from rev 19881,
branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/LibraryFunction.java)
===================================================================
--- trunk/ui/validator/api/src/main/java/org/richfaces/validator/LibraryFunction.java
(rev 0)
+++
trunk/ui/validator/api/src/main/java/org/richfaces/validator/LibraryFunction.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -0,0 +1,39 @@
+/*
+ * $Id$
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.richfaces.validator;
+
+/**
+ * <p class="changed_added_4_0">
+ * This class contains information about JavaScript function in external library (
resource )
+ * </p>
+ *
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public interface LibraryFunction extends LibraryScript {
+
+
+ String getName();
+
+}
Modified:
trunk/ui/validator/api/src/main/java/org/richfaces/validator/LibraryResource.java
===================================================================
---
trunk/ui/validator/api/src/main/java/org/richfaces/validator/LibraryResource.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/api/src/main/java/org/richfaces/validator/LibraryResource.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -2,7 +2,6 @@
import java.util.LinkedHashSet;
-import org.richfaces.renderkit.html.LibraryScriptString;
import com.google.common.collect.Sets;
Copied:
trunk/ui/validator/api/src/main/java/org/richfaces/validator/LibraryScriptString.java
(from rev 19881,
branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/LibraryScriptString.java)
===================================================================
--- trunk/ui/validator/api/src/main/java/org/richfaces/validator/LibraryScriptString.java
(rev 0)
+++
trunk/ui/validator/api/src/main/java/org/richfaces/validator/LibraryScriptString.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -0,0 +1,13 @@
+package org.richfaces.validator;
+
+import org.ajax4jsf.javascript.ScriptString;
+
+/**
+ * This interface describes JavaScript object with possible dependent resource.
+ * @author asmirnov
+ *
+ */
+public interface LibraryScriptString extends LibraryScript, ScriptString {
+
+
+}
\ No newline at end of file
Deleted:
trunk/ui/validator/api/src/main/java/org/richfaces/validator/ObjectValidator.java
===================================================================
---
trunk/ui/validator/api/src/main/java/org/richfaces/validator/ObjectValidator.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/api/src/main/java/org/richfaces/validator/ObjectValidator.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -1,443 +0,0 @@
-package org.richfaces.validator;
-
-import java.beans.FeatureDescriptor;
-import java.util.Collection;
-import java.util.EmptyStackException;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.Set;
-import java.util.Stack;
-
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.ELResolver;
-import javax.el.ValueExpression;
-import javax.faces.FacesException;
-import javax.faces.application.Application;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.application.ServiceTracker;
-import org.richfaces.component.ClonedObjectResolver;
-import org.richfaces.el.ELContextWrapper;
-
-public abstract class ObjectValidator {
-
- private static final String RESOURCE_BUNDLE_IS_NOT_REGISTERED_FOR_CURRENT_LOCALE =
"Resource bundle is not registered for current locale";
-
- private static final String FACES_CONTEXT_IS_NULL = "Faces context is null";
- protected static final String INPUT_PARAMETERS_IS_NOT_CORRECT = "Input parameters
is not correct.";
- private static final String LOCALE_IS_NOT_SET = "Locale is not set";
- private static final String VIEW_ROOT_IS_NOT_INITIALIZED = "ViewRoot is not
initialized";
-
-
- protected final ObjectValidator parent;
-
-
- ObjectValidator() {
- this.parent = null;
- }
-
- ObjectValidator(ObjectValidator parent){
- this.parent = parent;
- }
- /**
- * Return BeanValidator object from a ServletContext attribute. Create new
- * instance if none is defined.
- *
- * @param context
- * @return
- */
- public static ObjectValidator getInstance(FacesContext context) {
- return ServiceTracker.getService(context, ObjectValidator.class);
- }
-
- public abstract Collection<String> validateGraph(FacesContext context, Object
value,
- Set<String> profiles);
-
- /**
- * Perform Validation for a new value.
- *
- * @param context
- * current faces context.
- * @param target
- * {@link ValueExpression} for a value assignment.
- * @param value
- * new value for validation
- * @param profiles TODO
- * @return null if no validation errors. Array of the validation messages
- * otherwise.
- * @throws FacesException
- * if locale or context not properly initialized
- */
- public Collection<String> validate(FacesContext context, ValueExpression target,
- Object value, Set<String> profiles) {
- if (null == context) {
- throw new FacesException(INPUT_PARAMETERS_IS_NOT_CORRECT);
- }
- Collection<String> validationMessages = null;
- if (null != target) {
- ELContext elContext = context.getELContext();
- ValidationResolver validationResolver = createValidationResolver(
- context, elContext.getELResolver(),profiles);
- ELContextWrapper wrappedElContext = new ELContextWrapper(elContext,
- validationResolver);
- try {
- target.setValue(wrappedElContext, value);
- } catch (ELException e) {
- throw new FacesException(e);
- }
- if (!validationResolver.isValid()) {
- validationMessages = validationResolver.getValidationMessages();
- }
- if(null != parent){
- Collection<String> parentMessages = parent.validate(context, target, value,
profiles);
- if (null != validationMessages) {
- if (null != parentMessages) {
- validationMessages.addAll(parentMessages);
- }
- } else {
- validationMessages = parentMessages;
- }
- }
-
- }
- return validationMessages;
- }
-
- /**
- * Validate bean property for a new value.
- * @param facesContext TODO
- * @param base
- * - bean
- * @param property
- * - bean property name.
- * @param value
- * new value.
- * @param profiles TODO
- *
- * @return null for a valid value, array of the validation messages
- * othervise.
- */
- protected abstract Collection<String> validate(FacesContext facesContext, Object
base,
- String property, Object value, Set<String> profiles);
-
- static Locale calculateLocale(FacesContext context) {
- if (null == context.getViewRoot()) {
- throw new FacesException(VIEW_ROOT_IS_NOT_INITIALIZED);
- } else if (null == context.getViewRoot().getLocale()) {
- throw new FacesException(LOCALE_IS_NOT_SET);
- }
- Locale locale = context.getViewRoot().getLocale();
- return locale;
- }
-
- static ResourceBundle getResourceBundle(FacesContext facesContext, String name) {
- ResourceBundle bundle = null;
- if (null != facesContext) {
- Application application = facesContext.getApplication();
- try {
- bundle = application.getResourceBundle(facesContext,
- name);
-
- } catch (Exception e) {
- // Let one more attempt to load resource
- }
- }
- if (null == bundle) {
- ClassLoader classLoader = Thread.currentThread()
- .getContextClassLoader();
- if (null == classLoader) {
- classLoader = ObjectValidator.class.getClassLoader();
- }
- try {
- bundle = ResourceBundle.getBundle(name, calculateLocale(facesContext),
- classLoader);
-
- } catch (MissingResourceException e) {
- // Do nothing, use default bundle.
- }
- }
- return bundle;
- }
-
- protected ValidationResolver createValidationResolver(FacesContext context,
- ELResolver parent, Set<String> profiles) {
- return new ValidationResolver(parent, context, profiles);
- }
-
- /**
- * @author asmirnov
- *
- */
- protected static class BasePropertyPair {
- private final Object base;
- private final Object property;
-
- /**
- * @param base
- * @param property
- */
- public BasePropertyPair(Object base, Object property) {
- this.base = base;
- this.property = property;
- }
-
- /**
- * @return the base
- */
- public Object getBase() {
- return base;
- }
-
- /**
- * @return the property
- */
- public Object getProperty() {
- return property;
- }
-
- }
-
- /**
- * Class for identify validator instance by locale
- *
- * @author amarkhel
- *
- */
- protected static class ValidatorKey {
- private final Class<? extends Object> validatableClass;
- private final Locale locale;
-
- /**
- * Constructor for ValidatorKey object
- *
- * @param validatableClass
- * - class to validate
- * @param locale
- * - User locale to determine Resource bundle, used during
- * validation process
- */
- public ValidatorKey(Class<? extends Object> validatableClass,
- Locale locale) {
- this.validatableClass = validatableClass;
- this.locale = locale;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result
- + ((locale == null) ? 0 : locale.hashCode());
- result = prime
- * result
- + ((validatableClass == null) ? 0 : validatableClass
- .hashCode());
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof ValidatorKey))
- return false;
- ValidatorKey other = (ValidatorKey) obj;
- if (locale == null) {
- if (other.locale != null)
- return false;
- } else if (!locale.equals(other.locale))
- return false;
- if (validatableClass == null) {
- if (other.validatableClass != null)
- return false;
- } else if (!validatableClass.equals(other.validatableClass))
- return false;
- return true;
- }
-
- }
-
- /**
- * Wrapper class for a {@link ELResolver}. For a setValue method, perform
- * validation instead of real assignment.
- *
- * @author asmirnov
- *
- */
- final class ValidationResolver extends ELResolver {
-
- /**
- * Original resolver.
- */
- private final ELResolver parent;
-
- private boolean valid = true;
-
- private Collection<String> validationMessages = null;
-
- private Stack<BasePropertyPair> valuesStack;
-
- private Set<String> profiles;
-
- private FacesContext facesContext;
-
- private boolean clonedObject = false;
-
- /**
- * @param parent
- * @param context
- */
- public ValidationResolver(ELResolver parent, FacesContext context, Set<String>
profiles) {
- this.parent = parent;
- this.valuesStack = new Stack<BasePropertyPair>();
- this.profiles = profiles;
- this.facesContext = context;
- }
-
- public boolean isValid() {
- return valid;
- }
-
- /**
- * @param context
- * @param base
- * @return
- * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext,
- * java.lang.Object)
- */
- public Class<?> getCommonPropertyType(ELContext context, Object base) {
- return parent.getCommonPropertyType(context, base);
- }
-
- /**
- * @param context
- * @param base
- * @return
- * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext,
- * java.lang.Object)
- */
- public Iterator<FeatureDescriptor> getFeatureDescriptors(
- ELContext context, Object base) {
- return parent.getFeatureDescriptors(context, base);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#getType(javax.el.ELContext,
- * java.lang.Object, java.lang.Object)
- */
- public Class<?> getType(ELContext context, Object base, Object property) {
- return parent.getType(context, base, property);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#getValue(javax.el.ELContext,
- * java.lang.Object, java.lang.Object)
- */
- public Object getValue(ELContext context, Object base, Object property) {
- Object value = ClonedObjectResolver.resolveCloned(context, base, property);
- if(null != value){
- this.clonedObject =true;
- context.setPropertyResolved(true);
- } else {
- value = parent.getValue(context, base, property);
- }
- valuesStack.push(new BasePropertyPair(base, property));
- return value;
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext,
- * java.lang.Object, java.lang.Object)
- */
- public boolean isReadOnly(ELContext context, Object base,
- Object property) {
- return parent.isReadOnly(context, base, property);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @param value
- * @see javax.el.ELResolver#setValue(javax.el.ELContext,
- * java.lang.Object, java.lang.Object, java.lang.Object)
- */
- public void setValue(ELContext context, Object base, Object property,
- Object value) {
- if (null != base && null != property) {
- // TODO - detect value object from inderect references ( e.g. data table variables
).
- if(this.clonedObject){
- parent.setValue(context, base, property, value);
- }
- context.setPropertyResolved(true);
- // For Arrays, Collection or Map use parent base and property.
- BasePropertyPair basePropertyPair = lookupBeanProperty(new BasePropertyPair(
- base, property));
- base = basePropertyPair.getBase();
- property = basePropertyPair.getProperty();
- if (null != base && null != property) {
- //
https://jira.jboss.org/jira/browse/RF-4034
- // apache el looses locale information during value
- // resolution,
- // so we use our own
- validationMessages = validate(facesContext, base,
- property.toString(), value, profiles);
- valid = null == validationMessages
- || 0 == validationMessages.size();
-
- }
- }
- }
-
- private BasePropertyPair lookupBeanProperty(BasePropertyPair pair) {
- Object base = pair.getBase();
- if (null != base
- && (base instanceof Collection || base instanceof Map || base
- .getClass().isArray())) {
- try {
- pair = lookupBeanProperty(valuesStack.pop());
- } catch (EmptyStackException e) {
- // Do nothing, this is a first item.
- }
- }
- return pair;
- }
-
- /**
- * @return the validationMessages
- */
- public Collection<String> getValidationMessages() {
- return validationMessages;
- }
-
- }
-
-}
\ No newline at end of file
Modified: trunk/ui/validator/impl/pom.xml
===================================================================
--- trunk/ui/validator/impl/pom.xml 2010-11-02 02:44:05 UTC (rev 19881)
+++ trunk/ui/validator/impl/pom.xml 2010-11-02 06:11:17 UTC (rev 19882)
@@ -71,19 +71,18 @@
<version>4.0.0.GA</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-mock</artifactId>
- <version>1.0.5</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-test-stage</artifactId>
- <version>1.0.5</version>
- <scope>test</scope>
- </dependency>
-
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.11</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.5.11</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<scm>
Modified: trunk/ui/validator/ui/pom.xml
===================================================================
--- trunk/ui/validator/ui/pom.xml 2010-11-02 02:44:05 UTC (rev 19881)
+++ trunk/ui/validator/ui/pom.xml 2010-11-02 06:11:17 UTC (rev 19882)
@@ -100,19 +100,6 @@
<artifactId>jsf-test-jetty</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-mock</artifactId>
- <version>1.0.5</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-test-stage</artifactId>
- <version>1.0.5</version>
- <scope>test</scope>
- </dependency>
-
</dependencies>
<scm>
Deleted:
trunk/ui/validator/ui/src/main/java/org/richfaces/component/ClonedObjectResolver.java
===================================================================
---
trunk/ui/validator/ui/src/main/java/org/richfaces/component/ClonedObjectResolver.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/main/java/org/richfaces/component/ClonedObjectResolver.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -1,103 +0,0 @@
-/**
- *
- */
-package org.richfaces.component;
-
-import java.beans.FeatureDescriptor;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import javax.el.ELContext;
-import javax.el.ELResolver;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.component.UIGraphValidator.GraphValidatorState;
-
-/**
- * @author asmirnov
- *
- */
-public class ClonedObjectResolver extends ELResolver {
-
- /* (non-Javadoc)
- * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext, java.lang.Object)
- */
- @Override
- public Class<?> getCommonPropertyType(ELContext context, Object base) {
- // Do nothing
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext, java.lang.Object)
- */
- @Override
- public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
- Object base) {
- // do nothing
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.el.ELResolver#getType(javax.el.ELContext, java.lang.Object,
java.lang.Object)
- */
- @Override
- public Class<?> getType(ELContext context, Object base, Object property) {
- Object cloned = resolveCloned(context, base, property);
- if(null != cloned){
- context.setPropertyResolved(true);
- return cloned.getClass();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.el.ELResolver#getValue(javax.el.ELContext, java.lang.Object,
java.lang.Object)
- */
- @Override
- public Object getValue(ELContext context, Object base, Object property) {
- Object cloned = resolveCloned(context, base, property);
- if(null != cloned){
- context.setPropertyResolved(true);
- }
- return cloned;
- }
-
-
- /* (non-Javadoc)
- * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext, java.lang.Object,
java.lang.Object)
- */
- @Override
- public boolean isReadOnly(ELContext context, Object base, Object property) {
- // TODO Auto-generated method stub
- return false;
- }
-
- /* (non-Javadoc)
- * @see javax.el.ELResolver#setValue(javax.el.ELContext, java.lang.Object,
java.lang.Object, java.lang.Object)
- */
- @Override
- public void setValue(ELContext context, Object base, Object property,
- Object value) {
- // TODO Auto-generated method stub
-
- }
-
- public static Object resolveCloned(ELContext context, Object base, Object property){
- if(null != base || null != property){
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Map<String, Object> requestMap =
facesContext.getExternalContext().getRequestMap();
- for (String key : requestMap.keySet()) {
- if(null != key && key.startsWith(UIGraphValidator.STATE_ATTRIBUTE_PREFIX)){
- UIGraphValidator.GraphValidatorState state = (GraphValidatorState)
requestMap.get(key);
- if(state.isSame(base, property)){
- return state.getCloned();
- }
- }
- }
- }
- return null;
- }
-}
Modified:
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientAndAjaxScript.java
===================================================================
---
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientAndAjaxScript.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientAndAjaxScript.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -2,7 +2,9 @@
import java.util.Collection;
+import org.richfaces.validator.LibraryScriptString;
+
public class ClientAndAjaxScript extends ClientOnlyScript{
Modified:
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientOnlyScript.java
===================================================================
---
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientOnlyScript.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientOnlyScript.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -4,6 +4,7 @@
import java.util.LinkedHashSet;
import org.richfaces.validator.LibraryResource;
+import org.richfaces.validator.LibraryScriptString;
import com.google.common.collect.Sets;
@@ -15,7 +16,11 @@
public ClientOnlyScript(LibraryScriptString clientSideConverterScript,
Collection<? extends LibraryScriptString> validatorScripts) {
super();
- this.converter = null==clientSideConverterScript ?
NULL_CONVERTER_SCRIPT:clientSideConverterScript;
+ if(null==clientSideConverterScript){
+ this.converter = NULL_CONVERTER_SCRIPT;
+ } else {
+ this.converter = clientSideConverterScript;
+ }
this.validators = validatorScripts;
}
Deleted:
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScript.java
===================================================================
---
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScript.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScript.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -1,13 +0,0 @@
-package org.richfaces.renderkit.html;
-
-import org.richfaces.validator.LibraryResource;
-
-public interface LibraryScript {
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the resourceName
- */
- LibraryResource getResource();
-
-}
\ No newline at end of file
Modified:
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScriptFunction.java
===================================================================
---
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScriptFunction.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScriptFunction.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -25,36 +25,44 @@
import org.ajax4jsf.javascript.JSFunction;
import org.richfaces.validator.LibraryResource;
-import org.richfaces.validator.LibraryScript;
+import org.richfaces.validator.LibraryFunction;
+import org.richfaces.validator.LibraryScriptString;
/**
- * <p class="changed_added_4_0">This class represents call to function in
external library.</p>
+ * <p class="changed_added_4_0">
+ * This class represents call to function in external library.
+ * </p>
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
-public class LibraryScriptFunction extends JSFunction implements LibraryScriptString {
+public class LibraryScriptFunction extends JSFunction implements LibraryScriptString {
private final LibraryResource resource;
private String name;
- public LibraryScriptFunction(LibraryScript libraryScript, Object... parameters) {
+ public LibraryScriptFunction(LibraryFunction libraryScript, Object... parameters) {
super(libraryScript.getName(), parameters);
this.resource = libraryScript.getResource();
name = libraryScript.getName();
}
-
+
public String getName() {
- return name;
- }
+ return name;
+ }
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.richfaces.renderkit.html.LibraryScriptString#getResource()
*/
public LibraryResource getResource() {
return resource;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#hashCode()
*/
@Override
@@ -67,7 +75,9 @@
return result;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
@@ -95,16 +105,16 @@
}
} else if (!resource.equals(other.resource)) {
return false;
- } else if (!getParameters().equals(other.getParameters())){
+ } else if (!getParameters().equals(other.getParameters())) {
return false;
}
return true;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#hashCode()
*/
-
-
}
Deleted:
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScriptString.java
===================================================================
---
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScriptString.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScriptString.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -1,13 +0,0 @@
-package org.richfaces.renderkit.html;
-
-import org.ajax4jsf.javascript.ScriptString;
-
-/**
- * This interface describes JavaScript object with possible dependent resource.
- * @author asmirnov
- *
- */
-public interface LibraryScriptString extends LibraryScript, ScriptString {
-
-
-}
\ No newline at end of file
Modified:
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/NullConverterScript.java
===================================================================
---
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/NullConverterScript.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/NullConverterScript.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -5,25 +5,29 @@
import org.ajax4jsf.javascript.JSLiteral;
import org.richfaces.validator.LibraryResource;
+import org.richfaces.validator.LibraryScriptString;
/**
* This class represents "dummy" converter call ( just refference to
"value" variable )
+ *
* @author asmirnov
- *
+ *
*/
public class NullConverterScript extends JSLiteral implements LibraryScriptString {
private String name;
-
+
public NullConverterScript() {
super(ClientValidatorRenderer.VALUE_VAR);
}
-
+
public String getName() {
- return name;
- }
-
- /* (non-Javadoc)
+ return name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.richfaces.renderkit.html.LibraryScriptString#getResource()
*/
public LibraryResource getResource() {
Copied: trunk/ui/validator/ui/src/test/java/org/richfaces/component/Bean.java (from rev
19881, trunk/ui/validator/ui/src/test/java/org/richfaces/component/TestBean.java)
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/component/Bean.java
(rev 0)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/component/Bean.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -0,0 +1,82 @@
+/**
+ *
+ */
+package org.richfaces.component;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.renderkit.html.ComponentValidatorScript;
+import org.richfaces.validator.LibraryResource;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class Bean {
+
+ public static final String TEST_SCRIPT_NAME = "test_script";
+
+ public static final String FOO_BAR = "foo.bar";
+
+ public static final String FOO = "foo";
+
+ public static final String FOO_VALUE = "fooValue";
+
+ public static final String TEST_SCRIPT = "function " + FOO +
"(id){alert(id);}";
+
+ private static final LibraryResource TEST_RESOURCE = new LibraryResource(FOO_BAR,
TEST_SCRIPT_NAME + ".js");
+
+ private static final ComponentValidatorScript SCRIPT = new ComponentValidatorScript()
{
+
+ public String toScript() {
+ return TEST_SCRIPT;
+ }
+
+ public void appendScript(StringBuffer functionString) {
+ functionString.append(TEST_SCRIPT);
+ }
+
+ public Collection<LibraryResource> getResources() {
+ return Collections.singleton(TEST_RESOURCE);
+ }
+
+ public String getName() {
+ return FOO;
+ }
+
+ public String createCallScript(String clientId,String sourceId) {
+ return FOO+"("+clientId+")";
+ }
+ };
+
+ private String value=FOO_VALUE;
+
+ /**
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * @param value the value to set
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public String action() {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ UIViewRoot viewRoot = facesContext.getViewRoot();
+ UIValidatorScript resource = (UIValidatorScript)
facesContext.getApplication().createComponent(UIValidatorScript.COMPONENT_TYPE);
+ resource.addOrFindScript(SCRIPT );
+ viewRoot.addComponentResource(facesContext, resource);
+ return null;
+ }
+
+
+}
Property changes on:
trunk/ui/validator/ui/src/test/java/org/richfaces/component/Bean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: trunk/ui/validator/ui/src/test/java/org/richfaces/component/Script.java (from rev
19881, trunk/ui/validator/ui/src/test/java/org/richfaces/component/TestScript.java)
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/component/Script.java
(rev 0)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/component/Script.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -0,0 +1,65 @@
+package org.richfaces.component;
+
+import org.richfaces.validator.LibraryResource;
+import org.richfaces.validator.LibraryScriptString;
+
+final class Script implements LibraryScriptString {
+ private final String name;
+
+ Script(String name) {
+ this.name = name;
+ }
+
+ public String toScript() {
+ return name;
+ }
+
+ public void appendScript(StringBuffer functionString) {
+ functionString.append(name);
+
+ }
+
+ public LibraryResource getResource() {
+ return UIValidatorScriptCollectionTest.FOO_RESOURCE;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ Script other = (Script) obj;
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ return true;
+ }
+
+ public String getName() {
+ return name;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/ui/validator/ui/src/test/java/org/richfaces/component/Script.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Deleted: trunk/ui/validator/ui/src/test/java/org/richfaces/component/TestBean.java
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/component/TestBean.java 2010-11-02
02:44:05 UTC (rev 19881)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/component/TestBean.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -1,82 +0,0 @@
-/**
- *
- */
-package org.richfaces.component;
-
-import java.util.Collection;
-import java.util.Collections;
-
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.renderkit.html.ComponentValidatorScript;
-import org.richfaces.validator.LibraryResource;
-
-/**
- * @author asmirnov
- *
- */
-public class TestBean {
-
- public static final String TEST_SCRIPT_NAME = "test_script";
-
- public static final String FOO_BAR = "foo.bar";
-
- public static final String FOO = "foo";
-
- public static final String FOO_VALUE = "fooValue";
-
- public static final String TEST_SCRIPT = "function " + FOO +
"(id){alert(id);}";
-
- private static final LibraryResource TEST_RESOURCE = new LibraryResource(FOO_BAR,
TEST_SCRIPT_NAME + ".js");
-
- private static final ComponentValidatorScript SCRIPT = new ComponentValidatorScript()
{
-
- public String toScript() {
- return TEST_SCRIPT;
- }
-
- public void appendScript(StringBuffer functionString) {
- functionString.append(TEST_SCRIPT);
- }
-
- public Collection<LibraryResource> getResources() {
- return Collections.singleton(TEST_RESOURCE);
- }
-
- public String getName() {
- return FOO;
- }
-
- public String createCallScript(String clientId,String sourceId) {
- return FOO+"("+clientId+")";
- }
- };
-
- private String value=FOO_VALUE;
-
- /**
- * @return the value
- */
- public String getValue() {
- return value;
- }
-
- /**
- * @param value the value to set
- */
- public void setValue(String value) {
- this.value = value;
- }
-
- public String action() {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- UIViewRoot viewRoot = facesContext.getViewRoot();
- UIValidatorScript resource = (UIValidatorScript)
facesContext.getApplication().createComponent(UIValidatorScript.COMPONENT_TYPE);
- resource.addOrFindScript(SCRIPT );
- viewRoot.addComponentResource(facesContext, resource);
- return null;
- }
-
-
-}
Deleted: trunk/ui/validator/ui/src/test/java/org/richfaces/component/TestScript.java
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/component/TestScript.java 2010-11-02
02:44:05 UTC (rev 19881)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/component/TestScript.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -1,61 +0,0 @@
-package org.richfaces.component;
-
-import org.richfaces.renderkit.html.LibraryScriptString;
-import org.richfaces.validator.LibraryResource;
-
-final class TestScript implements LibraryScriptString {
- private final String name;
-
- TestScript(String name) {
- this.name = name;
- }
-
- public String toScript() {
- return name;
- }
-
- public void appendScript(StringBuffer functionString) {
- functionString.append(name);
-
- }
-
- public LibraryResource getResource() {
- return UIValidatorScriptCollectionTest.FOO_RESOURCE;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- return result;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- TestScript other = (TestScript) obj;
- if (name == null) {
- if (other.name != null) {
- return false;
- }
- } else if (!name.equals(other.name)) {
- return false;
- }
- return true;
- }
-}
\ No newline at end of file
Modified:
trunk/ui/validator/ui/src/test/java/org/richfaces/component/UIValidatorScriptCollectionTest.java
===================================================================
---
trunk/ui/validator/ui/src/test/java/org/richfaces/component/UIValidatorScriptCollectionTest.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/test/java/org/richfaces/component/UIValidatorScriptCollectionTest.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -8,8 +8,8 @@
import org.junit.Test;
import org.richfaces.renderkit.html.ClientOnlyScript;
import org.richfaces.renderkit.html.ComponentValidatorScript;
-import org.richfaces.renderkit.html.LibraryScriptString;
import org.richfaces.validator.LibraryResource;
+import org.richfaces.validator.LibraryScriptString;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
@@ -59,7 +59,7 @@
}
private LibraryScriptString createLibraryScript(final String name) {
- return new TestScript(name);
+ return new Script(name);
}
private ComponentValidatorScript createValidatorScript(String converter, String
...validators){
Modified:
trunk/ui/validator/ui/src/test/java/org/richfaces/component/UIViewResourceTest.java
===================================================================
---
trunk/ui/validator/ui/src/test/java/org/richfaces/component/UIViewResourceTest.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/test/java/org/richfaces/component/UIViewResourceTest.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -49,20 +49,20 @@
FacesRequest request =
environment.createFacesRequest("http://localhost/test.jsf?foo=bar");
assertNotNull(request.execute());
String contentAsString = request.getConnection().getContentAsString();
- assertFalse(contentAsString.contains(TestBean.TEST_SCRIPT));
+ assertFalse(contentAsString.contains(Bean.TEST_SCRIPT));
FacesRequest request2 = submit(request).submit();
request2.execute();
String content2 = request2.getConnection().getContentAsString();
- assertFalse(content2.contains(TestBean.TEST_SCRIPT));
+ assertFalse(content2.contains(Bean.TEST_SCRIPT));
}
private FacesRequest submit(FacesRequest request) throws MalformedURLException {
FacesRequest request2 =
request.submit().withParameter("helloForm:input",
"BAZ").withParameter("helloForm:command", "Ok");
request2.execute();
String content2 = request2.getConnection().getContentAsString();
- assertTrue(content2.contains(TestBean.TEST_SCRIPT));
- assertTrue(content2.contains(TestBean.TEST_SCRIPT_NAME));
- assertTrue(content2.contains(TestBean.FOO_BAR));
+ assertTrue(content2.contains(Bean.TEST_SCRIPT));
+ assertTrue(content2.contains(Bean.TEST_SCRIPT_NAME));
+ assertTrue(content2.contains(Bean.FOO_BAR));
return request2;
}
Deleted:
trunk/ui/validator/ui/src/test/java/org/richfaces/component/behavior/ClientValidatorBehaviorTest.java
===================================================================
---
trunk/ui/validator/ui/src/test/java/org/richfaces/component/behavior/ClientValidatorBehaviorTest.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/test/java/org/richfaces/component/behavior/ClientValidatorBehaviorTest.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -1,180 +0,0 @@
-package org.richfaces.component.behavior;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIForm;
-import javax.faces.component.UIInput;
-import javax.faces.component.UIOutput;
-import javax.faces.component.UIViewRoot;
-import javax.faces.component.behavior.ClientBehaviorContext;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-
-import org.jboss.test.faces.mock.Environment;
-import org.jboss.test.faces.mock.Mock;
-import org.jboss.test.faces.mock.MockController;
-import org.jboss.test.faces.mock.MockFacesEnvironment;
-import org.jboss.test.faces.mock.MockTestRunner;
-import org.jboss.test.faces.mock.Stub;
-import org.jboss.test.faces.mock.Environment.Feature;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.richfaces.component.behavior.ClientValidatorBehavior;
-import org.richfaces.component.mock.MockUIForm;
-import org.richfaces.component.mock.MockUIMessage;
-
-
-/**
- * <p class="changed_added_4_0">This class tests client validator
behavior.
- * as it described at
https://community.jboss.org/wiki/ClientSideValidation # Server-side
rendering algorithm</p>
- * @author asmirnov(a)exadel.com
- *
- */
-(a)RunWith(MockTestRunner.class)
-public class ClientValidatorBehaviorTest {
-
- private static final String CLIENT_VALIDATION_FUNCTION = "rf.csv.v";
-
- private final class DummyConverter implements Converter {
- public String getAsString(FacesContext context, UIComponent component, Object
value) {
- return value.toString();
- }
-
- public Object getAsObject(FacesContext context, UIComponent component, String
value) {
- return value;
- }
- }
-
- private static final String FORM_ID = "formId";
-
- private static final String INPUT_ID = "inputId";
-
- private static final String MESSAGE_ID = "messageId";
-
- @Mock()
- @Environment({Feature.APPLICATION})
- protected MockFacesEnvironment environment;
-
- @Stub
- private UIOutput output;
-
- @Mock
- protected UIInput input;
-
- @Mock
- protected UIViewRoot root;
-
- @Mock
- protected MockUIForm form;
-
- @Mock
- protected MockUIMessage message;
-
- @Mock
- private ClientBehaviorContext behaviorContext;
-
- protected MockController controller;
-
- private ClientValidatorBehavior behavior;
-
- @Before
- public void setUp() {
- behavior = createBehavior();
- }
-
- /**
- * <p class="changed_added_4_0">Server-side rendering algorithm
.1</p>
- */
- @Test(expected=FacesException.class)
- public void testGetScriptForIllegalComponent() {
- getScript(output);
- }
-
- /**
- * <p class="changed_added_4_0">Server-side rendering algorithm
.2</p>
- * @throws Exception
- */
- @Test
- public void testGetScriptWithoutMessageComponent() throws Exception {
- buildForm(false);
- assertEquals(0, getScript(input).length());
- }
-
- /**
- * <p class="changed_added_4_0">Server-side rendering algorithm .3 -
determine client-side converter</p>
- * @throws Exception
- */
- @Test
- public void testGetClientConverter() throws Exception {
-
- }
- /**
- * <p class="changed_added_4_0">Server-side rendering algorithm
.3</p>
- * @throws Exception
- */
- @Test
- public void testGetScriptWithoutClientConverter() throws Exception {
- buildForm(true);
- expect(input.getConverter()).andStubReturn(new DummyConverter());
- String script = getScript(input);// ajax-only validator.
- assertFalse(script.contains(CLIENT_VALIDATION_FUNCTION));
- }
-
- /**
- * <p class="changed_added_4_0">Server-side rendering algorithm
.3</p>
- * @throws Exception
- */
- @Test
- public void testGetScriptWithClientConverter() throws Exception {
-
- }
-
- private String getScript(UIComponent component) {
- ClientBehaviorContext clientBehaviorContext = setupBehaviorContext(component);
- controller.replay();
- String script = behavior.getScript(clientBehaviorContext);
- controller.verify();
- return script;
- }
-
- private ClientBehaviorContext setupBehaviorContext(UIComponent component) {
- expect(behaviorContext.getComponent()).andStubReturn(component);
-
expect(behaviorContext.getFacesContext()).andStubReturn(environment.getFacesContext());
- return behaviorContext;
- }
-
- private void buildForm(boolean withMessage) {
- expect(environment.getFacesContext().getViewRoot()).andStubReturn(root);
- expect(form.getId()).andStubReturn(FORM_ID);
- List<UIComponent> formChildren = new ArrayList<UIComponent>();
- expect(form.getChildren()).andStubReturn(formChildren);
- expect(input.getId()).andStubReturn(INPUT_ID);
- expect(input.getParent()).andStubReturn(form);
- formChildren.add(input);
- expect(output.getParent()).andStubReturn(form);
- formChildren.add(output);
- if(withMessage){
- expect(message.getId()).andStubReturn(MESSAGE_ID);
- expect(message.getFor()).andStubReturn(INPUT_ID);
- expect(message.getParent()).andStubReturn(form);
- formChildren.add(message);
- }
-// root.getChildren().add(form);
- }
-
- private ClientValidatorBehavior createBehavior() {
- return new ClientValidatorBehavior();
- }
-
- @Test
- public void testDecode() {
- fail("Not yet implemented");
- }
-
-}
Deleted: trunk/ui/validator/ui/src/test/java/org/richfaces/convert/BaseConverterTest.java
===================================================================
---
trunk/ui/validator/ui/src/test/java/org/richfaces/convert/BaseConverterTest.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/test/java/org/richfaces/convert/BaseConverterTest.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -1,334 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces.convert;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.text.MessageFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.TimeZone;
-
-import javax.el.ExpressionFactory;
-import javax.el.ValueExpression;
-import javax.el.VariableMapper;
-import javax.faces.component.UIComponent;
-import javax.faces.component.html.HtmlInputText;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.convert.ConverterException;
-import javax.servlet.ServletRequestEvent;
-import javax.servlet.ServletRequestListener;
-
-import net.sourceforge.htmlunit.corejs.javascript.Scriptable;
-
-import org.ajax4jsf.javascript.JSFunction;
-import org.ajax4jsf.javascript.ScriptUtils;
-import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
-import org.jboss.test.faces.jetty.JettyServer;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.runner.RunWith;
-import org.richfaces.application.MessageFactory;
-import org.richfaces.application.ServiceTracker;
-
-import com.gargoylesoftware.htmlunit.ScriptResult;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.google.common.base.Strings;
-
-/**
- * @author Nick Belaevski
- *
- */
-(a)RunWith(BaseConverterTestRunner.class)
-public abstract class BaseConverterTest {
-
- public static final String TEST_COMPONENT_LABEL = "input";
-
- public class TestBean {
-
- private static final String CONVERTER_VAR = "__converter";
-
- private String converterId;
-
- private String clientConverterClassName;
-
- private String convertedValueAsScript;
-
- private String conversionErrorMessage;
-
- private Enum<?> conversionErrorMessageEnum;
-
- private ConverterException converterException;
-
- private Map<String, Object> attributes = new HashMap<String, Object>();
-
- private String converterParametersString;
-
- public void setClientConverterClassName(String clientConverterClassName) {
- this.clientConverterClassName = clientConverterClassName;
- }
-
- public String getClientConverterClassName() {
- return clientConverterClassName;
- }
-
- public void setConverterId(String converterId) {
- this.converterId = converterId;
- }
-
- public String getSubmittedValue() {
- return submittedValue;
- }
-
- public String getSubmittedValueAsScript() {
- return ScriptUtils.toScript(submittedValue);
- }
-
- public String getConversionErrorMessage() {
- return conversionErrorMessage;
- }
-
- public void setConversionErrorMessage(String conversionErrorMessage) {
- this.conversionErrorMessage = conversionErrorMessage;
- }
-
- public void setAttribute(String name, Object value) {
- attributes.put(name, value);
- }
-
- public String getConverterParametersString() {
- return converterParametersString;
- }
-
- public ConverterException getConverterException() {
- return converterException;
- }
-
- public void setConversionErrorMessageEnum(
- Enum<?> conversionErrorMessageEnum) {
- this.conversionErrorMessageEnum = conversionErrorMessageEnum;
- }
-
- private void configure(FacesContext facesContext, Converter converter) {
- ExpressionFactory expressionFactory =
facesContext.getApplication().getExpressionFactory();
-
- VariableMapper varMapper = facesContext.getELContext().getVariableMapper();
- ValueExpression originalExpr = varMapper.resolveVariable(CONVERTER_VAR);
- try {
- varMapper.setVariable(CONVERTER_VAR,
expressionFactory.createValueExpression(converter, Converter.class));
-
- for (Entry<String, Object> mapEntry: attributes.entrySet()) {
-
- String exprString = MessageFormat.format("#'{'{0}.{1}'}'",
CONVERTER_VAR, mapEntry.getKey());
- ValueExpression ve =
expressionFactory.createValueExpression(facesContext.getELContext(), exprString,
Object.class);
-
- ve.setValue(facesContext.getELContext(), mapEntry.getValue());
- }
- } finally {
- varMapper.setVariable(CONVERTER_VAR, originalExpr);
- }
- }
-
- private Converter createConverter(FacesContext facesContext) {
- Converter converter = facesContext.getApplication().createConverter(converterId);
- configure(facesContext, converter);
- return converter;
- }
-
- private UIComponent createTestComponent() {
- HtmlInputText testComponent = new HtmlInputText();
- testComponent.setLabel(TEST_COMPONENT_LABEL);
- return testComponent;
- }
-
- public String getConvertedValueAsScript() {
- return convertedValueAsScript != null ? convertedValueAsScript : "null";
- }
-
- public void init() {
- if (converterId == null || clientConverterClassName == null) {
- throw new NullPointerException();
- }
-
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Converter converter = createConverter(facesContext);
- try {
- Object convertedObject = converter.getAsObject(facesContext, createTestComponent(),
submittedValue);
- convertedValueAsScript = serializeObjectToScript(convertedObject);
- } catch (ConverterException e) {
- this.converterException = e;
- }
-
- if (Strings.isNullOrEmpty(conversionErrorMessage) &&
conversionErrorMessageEnum != null) {
- MessageFactory messageFactory = ServiceTracker.getService(MessageFactory.class);
- conversionErrorMessage = messageFactory.getMessageFormat(facesContext,
conversionErrorMessageEnum);
- }
-
- Map<String,Object> map = new HashMap<String, Object>(attributes);
- map.put("componentId", TEST_COMPONENT_LABEL);
- map.put("customMessage", MessageFormat.format(conversionErrorMessage ,
"{0}"));
-
- converterParametersString = ScriptUtils.toScript(map);
- }
- }
-
- private TestBean testBean;
-
- private HtmlUnitEnvironment environment;
-
- private String converterScriptName;
-
- private String submittedValue;
-
- private String failureMessage;
-
- public BaseConverterTest(String converterScriptName) {
- this.converterScriptName = converterScriptName;
- }
-
- @Before
- public void setUp() throws Exception {
- testBean = new TestBean();
-
- environment = new HtmlUnitEnvironment(new JettyServer());
- environment.getServer().addResource("/test.xhtml",
BaseConverterTest.class.getResource("test.xhtml"));
- environment.getServer().addResource("/resources/converter.js",
converterScriptName);
- environment.getServer().addWebListener(new ServletRequestListener() {
-
- public void requestInitialized(ServletRequestEvent sre) {
- sre.getServletRequest().setAttribute("testBean", testBean);
- }
-
- public void requestDestroyed(ServletRequestEvent sre) {
- }
- });
-
- environment.start();
- }
-
- @After
- public void tearDown() throws Exception {
- submittedValue = null;
- failureMessage = null;
-
- testBean = null;
-
- environment.release();
- environment = null;
- }
-
- protected String serializeObjectToScript(Object object) {
- if (object instanceof Date) {
- Calendar calendar = Calendar.getInstance();
- calendar.setTime((Date) object);
- calendar.setTimeZone(TimeZone.getTimeZone("UTC"));
-
- return new JSFunction("new Date", calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH),
- calendar.get(Calendar.DAY_OF_MONTH), calendar.get(Calendar.HOUR),
calendar.get(Calendar.MINUTE),
- calendar.get(Calendar.SECOND), calendar.get(Calendar.MILLISECOND)).toScript();
- }
-
- return ScriptUtils.toScript(object);
- }
-
- public void setConversionErrorMessage(String conversionErrorMessage) {
- testBean.setConversionErrorMessage(conversionErrorMessage);
- }
-
- public void setConverterId(String converterId) {
- testBean.setConverterId(converterId);
- }
-
- public void setClientConverterClassName(String clientConverterClassName) {
- testBean.setClientConverterClassName(clientConverterClassName);
- }
-
- public void setAttribute(String name, Object value) {
- testBean.setAttribute(name, value);
- }
-
- public void setSubmittedValue(String submittedValue) {
- this.submittedValue = submittedValue;
- }
-
- public void setFailureMessage(String failureMessage) {
- this.failureMessage = failureMessage;
- }
-
- public void setConversionErrorMessageEnum(
- Enum<?> conversionErrorMessageEnum) {
- testBean.setConversionErrorMessageEnum(conversionErrorMessageEnum);
- }
-
- public void assertConversionOk() throws Exception {
- HtmlPage page = environment.getPage("/test.jsf");
- System.out.println(page.asXml());
- assertTrue(page.getWebClient().isJavaScriptEnabled());
- ScriptResult conversionMessageResult =
page.executeJavaScript("verifyConversion()");
- if (!ScriptResult.isUndefined(conversionMessageResult)) {
- fail(conversionMessageResult.getJavaScriptResult().toString());
- }
- }
-
- public void assertConversionFailure() throws Exception {
- HtmlPage page = environment.getPage("/test.jsf");
-
- assertNotNull(testBean.getConverterException());
-
- assertTrue(page.getWebClient().isJavaScriptEnabled());
- ScriptResult conversionErrorResult =
page.executeJavaScript("window.conversionError");
-
- if (ScriptResult.isUndefined(conversionErrorResult)) {
- fail("converter has not thrown an error");
- return;
- }
-
- Object conversionErrorMessage;
-
- Object scriptResult = conversionErrorResult.getJavaScriptResult();
- if (scriptResult instanceof Scriptable) {
- Scriptable scriptable = (Scriptable) scriptResult;
- conversionErrorMessage = scriptable.get("message", scriptable);
- } else {
- conversionErrorMessage = scriptResult;
- }
-
- if (failureMessage != null) {
- assertEquals(failureMessage, conversionErrorMessage);
- } else {
- assertEquals(testBean.getConverterException().getMessage(), conversionErrorMessage);
- }
- }
-
- public void setup(TestData testData) {
- setSubmittedValue(testData.submittedValue());
- setFailureMessage(testData.failureMessage());
- }
-
-}
Deleted:
trunk/ui/validator/ui/src/test/java/org/richfaces/convert/BaseConverterTestRunner.java
===================================================================
---
trunk/ui/validator/ui/src/test/java/org/richfaces/convert/BaseConverterTestRunner.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/test/java/org/richfaces/convert/BaseConverterTestRunner.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -1,198 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.richfaces.convert;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.junit.Test;
-import org.junit.internal.runners.model.ReflectiveCallable;
-import org.junit.runner.Runner;
-import org.junit.runner.notification.RunNotifier;
-import org.junit.runners.BlockJUnit4ClassRunner;
-import org.junit.runners.Suite;
-import org.junit.runners.model.FrameworkMethod;
-import org.junit.runners.model.InitializationError;
-import org.junit.runners.model.Statement;
-import org.junit.runners.model.TestClass;
-
-import com.google.common.base.Strings;
-import com.google.common.collect.Lists;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class BaseConverterTestRunner extends Suite {
-
- private static final class ParameterizedFrameworkMethod extends FrameworkMethod {
-
- private TestData testData;
-
- private boolean failure;
-
- public ParameterizedFrameworkMethod(Method method, TestData testData, boolean
failure) {
- super(method);
- this.testData = testData;
- this.failure = failure;
- }
-
- public String getFormattedParameters() {
- if (testData == null) {
- return "no test data";
- }
-
- StringBuilder sb = new StringBuilder();
-
- if (failure) {
- sb.append("<failure>");
- } else {
- sb.append("<success>");
- }
-
- sb.append(" @TestData {");
-
- sb.append("submittedValue=" + testData.submittedValue());
-
- if (!Strings.isNullOrEmpty(testData.failureMessage())) {
- sb.append(", failureMessage=" + testData.failureMessage());
- }
-
- sb.append("}");
-
- return sb.toString();
- }
-
- @Override
- public Object invokeExplosively(final Object target, final Object... params)
throws Throwable {
- return new ReflectiveCallable() {
- @Override
- protected Object runReflectiveCall() throws Throwable {
- BaseConverterTest baseConverterTest = (BaseConverterTest) target;
-
- baseConverterTest.setSubmittedValue(testData.submittedValue());
-
- if (!Strings.isNullOrEmpty(testData.failureMessage())) {
- baseConverterTest.setFailureMessage(testData.failureMessage());
- }
-
- Object returnValue = getMethod().invoke(target, params);
-
- if (failure) {
- baseConverterTest.assertConversionFailure();
- } else {
- baseConverterTest.assertConversionOk();
- }
-
- return returnValue;
- }
- }.run();
- }
- }
-
- private class ParameterizedTestRunner extends BlockJUnit4ClassRunner {
-
- private String testMethodName;
-
- private List<FrameworkMethod> children = Lists.newArrayList();
-
- public ParameterizedTestRunner(Class<?> klass, FrameworkMethod testMethod)
- throws InitializationError {
-
- super(klass);
-
- this.testMethodName = testMethod.getName();
-
- TestDataHolder testDataHolder =
testMethod.getAnnotation(TestDataHolder.class);
- if (testDataHolder != null) {
- for (TestData testData : testDataHolder.successes()) {
- children.add(new ParameterizedFrameworkMethod(testMethod.getMethod(),
testData, false));
- }
-
- for (TestData testData : testDataHolder.failures()) {
- children.add(new ParameterizedFrameworkMethod(testMethod.getMethod(),
testData, true));
- }
- } else {
- children.add(testMethod);
- }
- }
-
- @Override
- public Object createTest() throws Exception {
- return getTestClass().getOnlyConstructor().newInstance();
- }
-
- @Override
- protected String getName() {
- return testMethodName;
- }
-
- @Override
- protected String testName(final FrameworkMethod method) {
- if (method instanceof ParameterizedFrameworkMethod) {
- String formattedParamsString = ((ParameterizedFrameworkMethod)
method).getFormattedParameters();
-
- return String.format("%s %s", testMethodName,
formattedParamsString);
- }
-
- return testMethodName;
- }
-
- @Override
- protected void validateConstructor(List<Throwable> errors) {
- validateOnlyOneConstructor(errors);
- }
-
- @Override
- protected Statement classBlock(RunNotifier notifier) {
- return childrenInvoker(notifier);
- }
-
- @Override
- protected List<FrameworkMethod> getChildren() {
- return children;
- }
-
- }
-
- private final ArrayList<Runner> runners = new ArrayList<Runner>();
-
- /**
- * Only called reflectively. Do not use programmatically.
- */
- public BaseConverterTestRunner(Class<?> klass) throws Throwable {
- super(klass, Collections.<Runner>emptyList());
-
- TestClass testClass = getTestClass();
- List<FrameworkMethod> testMethods =
testClass.getAnnotatedMethods(Test.class);
- for (FrameworkMethod testMethod: testMethods) {
- runners.add(new ParameterizedTestRunner(klass, testMethod));
- }
- }
-
- @Override
- protected List<Runner> getChildren() {
- return runners;
- }
-}
Modified:
trunk/ui/validator/ui/src/test/java/org/richfaces/convert/DateTimeConverterTest.java
===================================================================
---
trunk/ui/validator/ui/src/test/java/org/richfaces/convert/DateTimeConverterTest.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/test/java/org/richfaces/convert/DateTimeConverterTest.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -38,8 +38,8 @@
}
@Test
- @TestDataHolder(successes = { @TestData(submittedValue = "18-10-2010"),
- // @TestData(submittedValue = "17-10-2010")
+ @TestDataHolder(successes = { @TestData(submittedValue = "18-10-2010")
+ // ,@TestData(submittedValue = "17-10-2010")
}, failures = {
// @TestData(submittedValue = "10/17/2010")
})
Modified:
trunk/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetClientSideScriptTest.java
===================================================================
---
trunk/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetClientSideScriptTest.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetClientSideScriptTest.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -20,7 +20,8 @@
import org.richfaces.application.ServiceTracker;
import org.richfaces.validator.ClientScriptService;
import org.richfaces.validator.ConverterDescriptor;
-import org.richfaces.validator.LibraryScript;
+import org.richfaces.validator.LibraryFunction;
+import org.richfaces.validator.LibraryScriptString;
import org.richfaces.validator.ScriptNotFoundException;
import org.richfaces.validator.ValidatorDescriptor;
@@ -40,7 +41,7 @@
private ClientScriptService scriptService;
@Mock
- private LibraryScript script;
+ private LibraryFunction script;
private Collection<ValidatorDescriptor> descriptors;
Modified:
trunk/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetComponentScriptTest.java
===================================================================
---
trunk/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetComponentScriptTest.java 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetComponentScriptTest.java 2010-11-02
06:11:17 UTC (rev 19882)
@@ -40,7 +40,7 @@
@RunWith(MockTestRunner.class)
public class RendererGetComponentScriptTest extends RendererTestBase {
- private static final String JSF_AJAX_REQUEST =
"jsf.ajax.request(this,event)";
+ private static final String JSF_AJAX_REQUEST =
"jsf.ajax.request(element,event)";
private static final String NUMBER_CONVERTER = "numConverter";
@@ -87,6 +87,7 @@
private void exceptGetAjaxScript() {
expect(mockBehavior.getAjaxScript(behaviorContext)).andReturn(JSF_AJAX_REQUEST);
+
expect(behaviorContext.getSourceId()).andStubReturn("clientValidator");
}
/**
Modified:
trunk/ui/validator/ui/src/test/resources/org/richfaces/component/WEB-INF/faces-config.xml
===================================================================
---
trunk/ui/validator/ui/src/test/resources/org/richfaces/component/WEB-INF/faces-config.xml 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/test/resources/org/richfaces/component/WEB-INF/faces-config.xml 2010-11-02
06:11:17 UTC (rev 19882)
@@ -2,7 +2,7 @@
<faces-config version="2.0" metadata-complete="false"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<managed-bean>
<managed-bean-name>test</managed-bean-name>
- <managed-bean-class>org.richfaces.component.TestBean</managed-bean-class>
+ <managed-bean-class>org.richfaces.component.Bean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>
\ No newline at end of file
Modified:
trunk/ui/validator/ui/src/test/resources/org/richfaces/component/faces-config.xml
===================================================================
---
trunk/ui/validator/ui/src/test/resources/org/richfaces/component/faces-config.xml 2010-11-02
02:44:05 UTC (rev 19881)
+++
trunk/ui/validator/ui/src/test/resources/org/richfaces/component/faces-config.xml 2010-11-02
06:11:17 UTC (rev 19882)
@@ -2,7 +2,7 @@
<faces-config version="2.0" metadata-complete="false"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<managed-bean>
<managed-bean-name>test</managed-bean-name>
- <managed-bean-class>org.richfaces.component.TestBean</managed-bean-class>
+ <managed-bean-class>org.richfaces.component.Bean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>
\ No newline at end of file