You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gp...@apache.org on 2009/11/08 02:19:01 UTC

svn commit: r833789 - in /myfaces/extensions/validator/trunk: core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/ test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/ test-modul...

Author: gpetracek
Date: Sun Nov  8 01:19:00 2009
New Revision: 833789

URL: http://svn.apache.org/viewvc?rev=833789&view=rev
Log:
EXTVAL-30 bv model validation test cases

Added:
    myfaces/extensions/validator/trunk/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/mock/MockELHelper.java
    myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ClassLevelValidationTestCase.java
    myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ModelValidationTestCase1Bean.java
    myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/validation/
    myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/validation/ClassLevelEqual.java
    myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/validation/ClassLevelEqualsValidator.java
    myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/view/
    myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/view/ModelValidationTestCase1PageBean.java
Modified:
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/AbstractValidationInterceptor.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/BaseBeanValPropertyValidationTestCase.java

Modified: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/AbstractValidationInterceptor.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/AbstractValidationInterceptor.java?rev=833789&r1=833788&r2=833789&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/AbstractValidationInterceptor.java (original)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/AbstractValidationInterceptor.java Sun Nov  8 01:19:00 2009
@@ -50,7 +50,7 @@
     public void beforeEncodeBegin(FacesContext facesContext, UIComponent uiComponent, Renderer wrapped)
             throws IOException, SkipBeforeInterceptorsException, SkipRendererDelegationException
     {
-        if(processComponent(uiComponent))
+        if(processComponent(uiComponent) && !isComponentInitializationDeactivated())
         {
             initComponent(facesContext, uiComponent);
         }
@@ -165,8 +165,7 @@
 
     protected boolean processComponent(UIComponent uiComponent)
     {
-        return uiComponent instanceof EditableValueHolder &&
-                !isComponentInitializationDeactivated() && isValueBindingOfComponentValid(uiComponent);
+        return uiComponent instanceof EditableValueHolder && isValueBindingOfComponentValid(uiComponent);
     }
 
     private boolean isValueBindingOfComponentValid(UIComponent uiComponent)

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=833789&r1=833788&r2=833789&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 Sun Nov  8 01:19:00 2009
@@ -22,10 +22,7 @@
 import org.apache.shale.test.mock.*;
 import org.apache.shale.test.el.MockExpressionFactory;
 import org.apache.myfaces.extensions.validator.ExtValInformation;
-import org.apache.myfaces.extensions.validator.test.base.mock.ExtValMockApplicationFactory;
-import org.apache.myfaces.extensions.validator.test.base.mock.MockValidationStrategyFactory;
-import org.apache.myfaces.extensions.validator.test.base.mock.MockMessageResolverFactory;
-import org.apache.myfaces.extensions.validator.test.base.mock.MockMetaDataTransformerFactory;
+import org.apache.myfaces.extensions.validator.test.base.mock.*;
 import org.apache.myfaces.extensions.validator.test.base.util.TestUtils;
 import org.apache.myfaces.extensions.validator.util.ExtValUtils;
 import org.apache.myfaces.extensions.validator.core.renderkit.DefaultRenderKitWrapperFactory;
@@ -33,6 +30,8 @@
 import org.apache.myfaces.extensions.validator.core.factory.DefaultFactoryFinder;
 import org.apache.myfaces.extensions.validator.core.factory.FactoryNames;
 import org.apache.myfaces.extensions.validator.core.ExtValContext;
+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;
 
 import javax.faces.render.RenderKit;
@@ -158,6 +157,17 @@
 
         expressionFactory = (MockExpressionFactory)application.getExpressionFactory();
 
+        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);
+                    }
+                });
+
         //execute startup listener
         new ExtValStartupListener() {
             private static final long serialVersionUID = -3861810605160281884L;

Added: myfaces/extensions/validator/trunk/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/mock/MockELHelper.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/mock/MockELHelper.java?rev=833789&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/mock/MockELHelper.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/base-test-infrastructure/src/test/java/org/apache/myfaces/extensions/validator/test/base/mock/MockELHelper.java Sun Nov  8 01:19:00 2009
@@ -0,0 +1,76 @@
+/*
+ * 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);
+    }
+}

Modified: myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/BaseBeanValPropertyValidationTestCase.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/BaseBeanValPropertyValidationTestCase.java?rev=833789&r1=833788&r2=833789&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/BaseBeanValPropertyValidationTestCase.java (original)
+++ myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/BaseBeanValPropertyValidationTestCase.java Sun Nov  8 01:19:00 2009
@@ -109,6 +109,13 @@
         inputComponent3.processValidators(facesContext);
     }
 
+    protected void updateComponents()
+    {
+        inputComponent1.processUpdates(facesContext);
+        inputComponent2.processUpdates(facesContext);
+        inputComponent3.processUpdates(facesContext);
+    }
+
     protected void assertComponentValid(UIInput uiInput)
     {
         assertTrue(isComponentValid(uiInput));

Added: myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ClassLevelValidationTestCase.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/ClassLevelValidationTestCase.java?rev=833789&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ClassLevelValidationTestCase.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ClassLevelValidationTestCase.java Sun Nov  8 01:19:00 2009
@@ -0,0 +1,99 @@
+/*
+ * 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.beanval;
+
+import org.apache.myfaces.extensions.validator.test.beanval.view.ModelValidationTestCase1PageBean;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import javax.faces.application.FacesMessage;
+
+public class ClassLevelValidationTestCase extends
+        BaseBeanValPropertyValidationTestCase<ModelValidationTestCase1PageBean>
+{
+    public ClassLevelValidationTestCase(String name)
+    {
+        super(name);
+    }
+
+    public static Test suite()
+    {
+        return new TestSuite(ClassLevelValidationTestCase.class);
+    }
+
+    protected ModelValidationTestCase1PageBean getBeanToTest()
+    {
+        return new ModelValidationTestCase1PageBean();
+    }
+
+    public void testClassLevelValidation()
+    {
+        createValueBindingForComponent(this.inputComponent1, "#{testBean.model1.property1}");
+        setValueToValidate(this.inputComponent1, "123");
+
+        createValueBindingForComponent(this.inputComponent2, "#{testBean.model1.property2}");
+        setValueToValidate(this.inputComponent2, "123");
+
+        validateComponents();
+        updateComponents();
+        processModelValidation();
+
+        assertNavigationBlocked(false);
+
+        checkMessageCount(0);
+    }
+
+    public void testClassLevelViolationWithGlobalViolationMessage()
+    {
+        createValueBindingForComponent(this.inputComponent1, "#{testBean.model1.property1}");
+        setValueToValidate(this.inputComponent1, "123");
+
+        createValueBindingForComponent(this.inputComponent2, "#{testBean.model1.property2}");
+        setValueToValidate(this.inputComponent2, "456");
+
+        validateComponents();
+        updateComponents();
+        processModelValidation();
+
+        assertNavigationBlocked(true);
+
+        checkMessageCount(1);
+        checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+    }
+
+    public void testClassLevelViolationWithInlineViolationMessage()
+    {
+        createValueBindingForComponent(this.inputComponent1, "#{testBean.model2.property1}");
+        setValueToValidate(this.inputComponent1, "123");
+
+        createValueBindingForComponent(this.inputComponent2, "#{testBean.model2.property2}");
+        setValueToValidate(this.inputComponent2, "456");
+
+        validateComponents();
+        updateComponents();
+        processModelValidation();
+
+        assertComponentInvalid(this.inputComponent1);
+        assertComponentInvalid(this.inputComponent2);
+        assertNavigationBlocked(true);
+
+        checkMessageCount(2);
+        checkMessageSeverities(FacesMessage.SEVERITY_ERROR, FacesMessage.SEVERITY_ERROR);
+    }
+}
\ No newline at end of file

Added: myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ModelValidationTestCase1Bean.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/model/ModelValidationTestCase1Bean.java?rev=833789&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ModelValidationTestCase1Bean.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ModelValidationTestCase1Bean.java Sun Nov  8 01:19:00 2009
@@ -0,0 +1,53 @@
+/*
+ * 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.beanval.model;
+
+import org.apache.myfaces.extensions.validator.test.beanval.validation.ClassLevelEqual;
+
+import javax.validation.constraints.NotNull;
+
+@ClassLevelEqual
+public class ModelValidationTestCase1Bean
+{
+    @NotNull
+    private String property1;
+
+    @NotNull
+    private String property2;
+
+    public String getProperty1()
+    {
+        return property1;
+    }
+
+    public void setProperty1(String property1)
+    {
+        this.property1 = property1;
+    }
+
+    public String getProperty2()
+    {
+        return property2;
+    }
+
+    public void setProperty2(String property2)
+    {
+        this.property2 = property2;
+    }
+}
\ No newline at end of file

Added: myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/validation/ClassLevelEqual.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/validation/ClassLevelEqual.java?rev=833789&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/validation/ClassLevelEqual.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/validation/ClassLevelEqual.java Sun Nov  8 01:19:00 2009
@@ -0,0 +1,37 @@
+/*
+ * 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.beanval.validation;
+
+import javax.validation.Payload;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@java.lang.annotation.Target(TYPE)
+@java.lang.annotation.Retention(RUNTIME)
+@java.lang.annotation.Documented
+@javax.validation.Constraint(validatedBy = ClassLevelEqualsValidator.class)
+public @interface ClassLevelEqual
+{
+    String message() default "class-level equal violation";
+
+    Class<?>[] groups() default {};
+
+    Class<? extends Payload>[] payload() default {};
+
+}

Added: myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/validation/ClassLevelEqualsValidator.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/validation/ClassLevelEqualsValidator.java?rev=833789&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/validation/ClassLevelEqualsValidator.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/validation/ClassLevelEqualsValidator.java Sun Nov  8 01:19:00 2009
@@ -0,0 +1,42 @@
+/*
+ * 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.beanval.validation;
+
+import org.apache.myfaces.extensions.validator.test.beanval.model.ModelValidationTestCase1Bean;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+
+public class ClassLevelEqualsValidator implements
+        ConstraintValidator<ClassLevelEqual, ModelValidationTestCase1Bean>
+{
+    public void initialize(ClassLevelEqual parameters)
+    {
+    }
+
+    public boolean isValid(ModelValidationTestCase1Bean pageBean,
+                           ConstraintValidatorContext constraintValidatorContext)
+    {
+        String property1 = pageBean.getProperty1();
+        String property2 = pageBean.getProperty2();
+
+        return property1 == null && property2 == null || property1 != null && property1.equals(property2);
+
+    }
+}

Added: myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/view/ModelValidationTestCase1PageBean.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/view/ModelValidationTestCase1PageBean.java?rev=833789&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/view/ModelValidationTestCase1PageBean.java (added)
+++ myfaces/extensions/validator/trunk/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/view/ModelValidationTestCase1PageBean.java Sun Nov  8 01:19:00 2009
@@ -0,0 +1,52 @@
+/*
+ * 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.beanval.view;
+
+import org.apache.myfaces.extensions.validator.beanval.annotation.BeanValidation;
+import org.apache.myfaces.extensions.validator.beanval.annotation.ModelValidation;
+import org.apache.myfaces.extensions.validator.test.beanval.model.ModelValidationTestCase1Bean;
+
+public class ModelValidationTestCase1PageBean
+{
+    @BeanValidation(modelValidation = @ModelValidation(isActive = true))
+    private ModelValidationTestCase1Bean model1 = new ModelValidationTestCase1Bean();
+
+    @BeanValidation(modelValidation = @ModelValidation(isActive = true, displayInline = true))
+    private ModelValidationTestCase1Bean model2 = new ModelValidationTestCase1Bean();
+
+    public ModelValidationTestCase1Bean getModel1()
+    {
+        return model1;
+    }
+
+    public void setModel1(ModelValidationTestCase1Bean model1)
+    {
+        this.model1 = model1;
+    }
+
+    public ModelValidationTestCase1Bean getModel2()
+    {
+        return model2;
+    }
+
+    public void setModel2(ModelValidationTestCase1Bean model2)
+    {
+        this.model2 = model2;
+    }
+}
\ No newline at end of file