You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by rd...@apache.org on 2011/05/30 10:38:54 UTC
svn commit: r1129058 [3/13] - in
/myfaces/extensions/validator/branches/branch_for_jsf_2_0: ./ test-modules/
test-modules/base-test-infrastructure/
test-modules/base-test-infrastructure/src/
test-modules/base-test-infrastructure/src/test/ test-modules/...
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ModelValidation2TestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ModelValidation2TestCase.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ModelValidation2TestCase.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ModelValidation2TestCase.java Mon May 30 08:38:45 2011
@@ -0,0 +1,71 @@
+/*
+ * 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.ModelValidationTestCase2PageBean;
+import org.junit.Test;
+
+import javax.faces.application.FacesMessage;
+
+public class ModelValidation2TestCase extends
+ BaseBeanValPropertyValidationTestCase<ModelValidationTestCase2PageBean>
+{
+
+ protected ModelValidationTestCase2PageBean getBeanToTest()
+ {
+ return new ModelValidationTestCase2PageBean();
+ }
+
+ @Test
+ public void testModelValidation()
+ {
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model.property1}");
+ setValueToValidate(this.inputComponent1, "123");
+
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model.property2}");
+ setValueToValidate(this.inputComponent2, "123");
+
+ validateComponents();
+ updateComponents();
+ processModelValidation();
+
+ assertNavigationBlocked(false);
+
+ checkMessageCount(0);
+ }
+
+ @Test
+ public void testModelViolationWithGlobalViolationMessageClassLevel()
+ {
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model.property1}");
+ setValueToValidate(this.inputComponent1, "123");
+
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model.property2}");
+ setValueToValidate(this.inputComponent2, "456");
+
+ validateComponents();
+ updateComponents();
+ processModelValidation();
+
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+}
\ No newline at end of file
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ModelValidation3TestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ModelValidation3TestCase.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ModelValidation3TestCase.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ModelValidation3TestCase.java Mon May 30 08:38:45 2011
@@ -0,0 +1,71 @@
+/*
+ * 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.ModelValidationTestCase3PageBean;
+import org.junit.Test;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+public class ModelValidation3TestCase extends
+ BaseBeanValPropertyValidationTestCase<ModelValidationTestCase3PageBean>
+{
+
+ protected ModelValidationTestCase3PageBean getBeanToTest()
+ {
+ return new ModelValidationTestCase3PageBean();
+ }
+
+ @Test
+ public void testModelValidationNoViewIdMatch()
+ {
+ validate();
+
+ assertNavigationBlocked(false);
+
+ checkMessageCount(0);
+ }
+
+ @Test
+ public void testModelValidationViewIdMatch()
+ {
+ FacesContext.getCurrentInstance().getViewRoot().setViewId("/pages/modelValidationAwarePage.xhtml");
+
+ validate();
+
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+
+ private void validate()
+ {
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model.property1}");
+ setValueToValidate(this.inputComponent1, "123");
+
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model.property2}");
+ setValueToValidate(this.inputComponent2, "456");
+
+ validateComponents();
+ updateComponents();
+ processModelValidation();
+ }
+}
\ No newline at end of file
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ModelValidation4TestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ModelValidation4TestCase.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ModelValidation4TestCase.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/ModelValidation4TestCase.java Mon May 30 08:38:45 2011
@@ -0,0 +1,71 @@
+/*
+ * 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.ModelValidationTestCase4PageBean;
+import org.junit.Test;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+public class ModelValidation4TestCase extends
+ BaseBeanValPropertyValidationTestCase<ModelValidationTestCase4PageBean>
+{
+
+ protected ModelValidationTestCase4PageBean getBeanToTest()
+ {
+ return new ModelValidationTestCase4PageBean();
+ }
+
+ @Test
+ public void testModelValidationNoViewIdMatch()
+ {
+ validate();
+
+ assertNavigationBlocked(false);
+
+ checkMessageCount(0);
+ }
+
+ @Test
+ public void testModelValidationViewIdMatch()
+ {
+ FacesContext.getCurrentInstance().getViewRoot().setViewId("/pages/modelValidationAwarePage.xhtml");
+
+ validate();
+
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+
+ private void validate()
+ {
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model.property1}");
+ setValueToValidate(this.inputComponent1, "123");
+
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model.property2}");
+ setValueToValidate(this.inputComponent2, "456");
+
+ validateComponents();
+ updateComponents();
+ processModelValidation();
+ }
+}
\ No newline at end of file
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/NotNullValidationTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/NotNullValidationTestCase.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/NotNullValidationTestCase.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/NotNullValidationTestCase.java Mon May 30 08:38:45 2011
@@ -0,0 +1,69 @@
+/*
+ * 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.core.DefaultExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.ExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.test.beanval.model.ConstraintSourceAware1MetaDataBean;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @author Rudy De Busscher
+ */
+public class NotNullValidationTestCase extends BaseBeanValPropertyValidationTestCase<ConstraintSourceAware1MetaDataBean>
+{
+
+ @Override
+ protected ConstraintSourceAware1MetaDataBean getBeanToTest()
+ {
+ return new ConstraintSourceAware1MetaDataBean();
+ }
+
+ @Override
+ protected void setUpTestCase()
+ {
+ super.setUpTestCase();
+ ((DefaultExtValCoreConfiguration) ExtValCoreConfiguration.get()).overruleActivateRequiredInitialization(true, true);
+ }
+
+ @Test
+ public void testNotNullValidation()
+ {
+ // This tests is not testing that isn't already tested somewhere else. Just to see if the 'config of the test object is ok.
+ createValueBindingForComponent(inputComponent1, "#{testBean.property2}");
+ setValueToValidate(inputComponent1, "");
+ validateComponents();
+
+ assertComponentInvalid(this.inputComponent1);
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+
+ }
+
+ @Test
+ public void testInitialization() throws Exception
+ {
+ // This will trigger the ValidationStrategyToMetaDataTransformerSubMapperAwareNameMapper what we really liked to test
+ createValueBindingForComponent(inputComponent1, "#{testBean.property2}");
+ inputComponent1.encodeAll(facesContext);
+ Assert.assertTrue(inputComponent1.isRequired());
+ }
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/RestrictGroupsTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/RestrictGroupsTestCase.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/RestrictGroupsTestCase.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/RestrictGroupsTestCase.java Mon May 30 08:38:45 2011
@@ -0,0 +1,143 @@
+/*
+ * 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.RestrictGroupValidationTestCase1PageBean;
+import org.apache.myfaces.extensions.validator.test.beanval.model.SimulatedUserInformation;
+import org.junit.Test;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+public class RestrictGroupsTestCase extends BaseBeanValPropertyValidationTestCase<RestrictGroupValidationTestCase1PageBean>
+{
+
+ protected RestrictGroupValidationTestCase1PageBean getBeanToTest()
+ {
+ return new RestrictGroupValidationTestCase1PageBean();
+ }
+
+ @Test
+ public void testRestrictedGroup()
+ {
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model1.property1}");
+ setValueToValidate(this.inputComponent1, "");
+
+ validateComponents();
+
+ assertComponentValid(this.inputComponent1);
+ assertNavigationBlocked(false);
+
+ checkMessageCount(0);
+ }
+
+ @Test
+ public void testRestrictedGroupWithAdminRole()
+ {
+ createRequestScopedBean("currentUser", new SimulatedUserInformation("admin"));
+
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model2.property1}");
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model2.property2}");
+ setValueToValidate(this.inputComponent1, "");
+ setValueToValidate(this.inputComponent2, "");
+
+ validateComponents();
+
+ assertComponentValid(this.inputComponent1);
+ assertComponentValid(this.inputComponent2);
+
+ assertNavigationBlocked(false);
+ checkMessageCount(0);
+ }
+
+ @Test
+ public void testRestrictedGroupWithUserRole()
+ {
+ createRequestScopedBean("currentUser", new SimulatedUserInformation("user"));
+
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model2.property1}");
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model2.property2}");
+ setValueToValidate(this.inputComponent1, "");
+ setValueToValidate(this.inputComponent2, "");
+
+ validateComponents();
+
+ assertComponentInvalid(this.inputComponent1);
+ assertComponentValid(this.inputComponent2);
+
+ assertNavigationBlocked(true);
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+
+ @Test
+ public void testRestrictedGroupWithCorrectViewId()
+ {
+ FacesContext.getCurrentInstance().getViewRoot().setViewId("/pages/groupValidationAwarePage.xhtml");
+
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model3.property1}");
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model3.property2}");
+ setValueToValidate(this.inputComponent1, "");
+ setValueToValidate(this.inputComponent2, "");
+
+ validateComponents();
+
+ assertComponentValid(this.inputComponent1);
+ assertComponentValid(this.inputComponent2);
+
+ assertNavigationBlocked(false);
+ checkMessageCount(0);
+ }
+
+ @Test
+ public void testRestrictedGroupWithWrongViewId()
+ {
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model3.property1}");
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model3.property2}");
+ setValueToValidate(this.inputComponent1, "");
+ setValueToValidate(this.inputComponent2, "");
+
+ validateComponents();
+
+ assertComponentInvalid(this.inputComponent1);
+ assertComponentValid(this.inputComponent2);
+
+ assertNavigationBlocked(true);
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+
+ @Test
+ public void testUsedAndRestrictedGroup()
+ {
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model4.property1}");
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model4.property2}");
+ setValueToValidate(this.inputComponent1, "");
+ setValueToValidate(this.inputComponent2, "");
+
+ validateComponents();
+
+ assertComponentValid(this.inputComponent1);
+ assertComponentInvalid(this.inputComponent2);
+
+ assertNavigationBlocked(true);
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+}
\ No newline at end of file
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/UseGroupValidation1TestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/UseGroupValidation1TestCase.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/UseGroupValidation1TestCase.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/UseGroupValidation1TestCase.java Mon May 30 08:38:45 2011
@@ -0,0 +1,164 @@
+/*
+ * 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.UseGroupValidationTestCase1PageBean;
+import org.apache.myfaces.extensions.validator.test.beanval.model.SimulatedUserInformation;
+import org.junit.Test;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+public class UseGroupValidation1TestCase extends BaseBeanValPropertyValidationTestCase<UseGroupValidationTestCase1PageBean>
+{
+
+ protected UseGroupValidationTestCase1PageBean getBeanToTest()
+ {
+ return new UseGroupValidationTestCase1PageBean();
+ }
+
+ @Test
+ public void testGroup1AwareValidation()
+ {
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model1.property1}");
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model1.property2}");
+ setValueToValidate(this.inputComponent1, "");
+ setValueToValidate(this.inputComponent2, "");
+
+ validateComponents();
+
+ assertComponentInvalid(this.inputComponent1);
+ assertComponentValid(this.inputComponent2);
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+
+ @Test
+ public void testGroup1AndGroup2AwareValidation()
+ {
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model2.property1}");
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model2.property2}");
+ setValueToValidate(this.inputComponent1, "");
+ setValueToValidate(this.inputComponent2, "");
+
+ validateComponents();
+
+ assertComponentInvalid(this.inputComponent1);
+ assertComponentInvalid(this.inputComponent2);
+ assertNavigationBlocked(true);
+
+ checkMessageCount(2);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR, FacesMessage.SEVERITY_ERROR);
+ }
+
+ @Test
+ public void testGroup2AndGroup3AwareValidationWithWrongViewId()
+ {
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model3.property1}");
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model3.property2}");
+ setValueToValidate(this.inputComponent1, "g");
+ setValueToValidate(this.inputComponent2, "p");
+
+ validateComponents();
+
+ assertComponentValid(this.inputComponent1);
+ assertComponentValid(this.inputComponent2);
+ assertNavigationBlocked(false);
+
+ checkMessageCount(0);
+ }
+
+ @Test
+ public void testGroup2AndGroup3AwareValidationWithCorrectViewId1()
+ {
+ FacesContext.getCurrentInstance().getViewRoot().setViewId("/pages/page1.xhtml");
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model3.property1}");
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model3.property2}");
+ setValueToValidate(this.inputComponent1, "g");
+ setValueToValidate(this.inputComponent2, "p");
+
+ validateComponents();
+
+ assertComponentValid(this.inputComponent1);
+ assertComponentInvalid(this.inputComponent2);
+ assertNavigationBlocked(true);
+
+ checkMessageCount(2);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR, FacesMessage.SEVERITY_ERROR);
+ }
+
+ @Test
+ public void testGroup2AndGroup3AwareValidationWithCorrectViewId2()
+ {
+ FacesContext.getCurrentInstance().getViewRoot().setViewId("/pages/page2.xhtml");
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model3.property1}");
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model3.property2}");
+ setValueToValidate(this.inputComponent1, "g");
+ setValueToValidate(this.inputComponent2, "p");
+
+ validateComponents();
+
+ assertComponentValid(this.inputComponent1);
+ assertComponentInvalid(this.inputComponent2);
+ assertNavigationBlocked(true);
+
+ checkMessageCount(2);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR, FacesMessage.SEVERITY_ERROR);
+ }
+
+ @Test
+ public void testGroup2AwareValidationWithRoleAdmin()
+ {
+ createRequestScopedBean("currentUser", new SimulatedUserInformation("admin"));
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model4.property1}");
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model4.property2}");
+ setValueToValidate(this.inputComponent1, "g"); //don't force a violation with Group1
+ setValueToValidate(this.inputComponent2, "");
+
+ validateComponents();
+
+ assertComponentValid(this.inputComponent1);
+ assertComponentInvalid(this.inputComponent2);
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+
+ @Test
+ public void testGroup2AndGroup3AwareValidationWithRoleUser()
+ {
+ createRequestScopedBean("currentUser", new SimulatedUserInformation("user"));
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model4.property1}");
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model4.property2}");
+ setValueToValidate(this.inputComponent1, "g");
+ setValueToValidate(this.inputComponent2, "p");
+
+ validateComponents();
+
+ assertComponentValid(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/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/UseGroupValidation2TestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/UseGroupValidation2TestCase.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/UseGroupValidation2TestCase.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/UseGroupValidation2TestCase.java Mon May 30 08:38:45 2011
@@ -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;
+
+import org.apache.myfaces.extensions.validator.test.beanval.view.UseGroupValidationTestCase2PageBean;
+import org.junit.Test;
+
+import javax.faces.application.FacesMessage;
+
+public class UseGroupValidation2TestCase extends BaseBeanValPropertyValidationTestCase<UseGroupValidationTestCase2PageBean>
+{
+
+ protected UseGroupValidationTestCase2PageBean getBeanToTest()
+ {
+ return new UseGroupValidationTestCase2PageBean();
+ }
+
+ @Test
+ public void testGroup1AwareValidation()
+ {
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.model.property1}");
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.model.property2}");
+ setValueToValidate(this.inputComponent1, "");
+ setValueToValidate(this.inputComponent2, "");
+
+ validateComponents();
+
+ assertComponentInvalid(this.inputComponent1);
+ assertComponentValid(this.inputComponent2);
+
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+}
\ No newline at end of file
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomConstraintSource.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomConstraintSource.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomConstraintSource.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomConstraintSource.java Mon May 30 08:38:45 2011
@@ -0,0 +1,33 @@
+/*
+ * 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.custom;
+
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+@Target({TYPE, FIELD, METHOD})
+@Retention(RUNTIME)
+@Documented
+public @interface CustomConstraintSource
+{
+ public abstract Class value();
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomIgnoreConstraintSource.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomIgnoreConstraintSource.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomIgnoreConstraintSource.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomIgnoreConstraintSource.java Mon May 30 08:38:45 2011
@@ -0,0 +1,33 @@
+/*
+ * 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.custom;
+
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+@Target({FIELD, METHOD})
+@Retention(RUNTIME)
+@Documented
+public @interface CustomIgnoreConstraintSource
+{
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomTargetProperty.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomTargetProperty.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomTargetProperty.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomTargetProperty.java Mon May 30 08:38:45 2011
@@ -0,0 +1,34 @@
+/*
+ * 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.custom;
+
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+@Target({FIELD, METHOD})
+@Retention(RUNTIME)
+@Documented
+public @interface CustomTargetProperty
+{
+ public abstract String value();
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomTargetPropertyId.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomTargetPropertyId.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomTargetPropertyId.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomTargetPropertyId.java Mon May 30 08:38:45 2011
@@ -0,0 +1,35 @@
+/*
+ * 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.custom;
+
+import java.lang.annotation.Annotation;
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+@Target({FIELD, METHOD})
+@Retention(RUNTIME)
+@Documented
+public @interface CustomTargetPropertyId
+{
+ public abstract Class<? extends Annotation> value();
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomViolationSeverity.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomViolationSeverity.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomViolationSeverity.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/custom/CustomViolationSeverity.java Mon May 30 08:38:45 2011
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.validator.test.beanval.custom;
+
+import javax.validation.Payload;
+
+public interface CustomViolationSeverity
+{
+ interface Warning extends Payload
+ {
+ }
+}
\ No newline at end of file
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/CascadedValidationTestCase1Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/CascadedValidationTestCase1Bean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/CascadedValidationTestCase1Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/CascadedValidationTestCase1Bean.java Mon May 30 08:38:45 2011
@@ -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.model;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
+public class CascadedValidationTestCase1Bean
+{
+ @NotNull
+ @Valid
+ private CustomTypeForCascadedValidationTestCase1Bean property;
+
+ @Valid
+ private CustomTypeForCascadedValidationTestCase1Bean nullProperty;
+
+ public CustomTypeForCascadedValidationTestCase1Bean getProperty()
+ {
+ return property;
+ }
+
+ public void setProperty(CustomTypeForCascadedValidationTestCase1Bean property)
+ {
+ this.property = property;
+ }
+
+ public CustomTypeForCascadedValidationTestCase1Bean getNullProperty()
+ {
+ return nullProperty;
+ }
+
+ public void setNullProperty(CustomTypeForCascadedValidationTestCase1Bean nullProperty)
+ {
+ this.nullProperty = nullProperty;
+ }
+}
\ No newline at end of file
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware1Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware1Bean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware1Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware1Bean.java Mon May 30 08:38:45 2011
@@ -0,0 +1,49 @@
+/*
+ * 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.core.validation.ConstraintSource;
+
+@ConstraintSource(ConstraintSourceAware1MetaDataBean.class)
+public class ConstraintSourceAware1Bean
+{
+ private String property1;
+
+ 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;
+ }
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware1MetaDataBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware1MetaDataBean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware1MetaDataBean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware1MetaDataBean.java Mon May 30 08:38:45 2011
@@ -0,0 +1,40 @@
+/*
+ * 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 javax.validation.constraints.NotNull;
+
+public class ConstraintSourceAware1MetaDataBean
+{
+ @NotNull
+ private String property1;
+
+ private String property2;
+
+ @NotNull
+ public String getProperty2()
+ {
+ return property2;
+ }
+
+ public void setProperty2(String property2)
+ {
+ this.property2 = property2;
+ }
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware2Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware2Bean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware2Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware2Bean.java Mon May 30 08:38:45 2011
@@ -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.core.validation.ConstraintSource;
+import org.apache.myfaces.extensions.validator.core.validation.IgnoreConstraintSource;
+import org.apache.myfaces.extensions.validator.core.validation.TargetProperty;
+
+@ConstraintSource(ConstraintSourceAware2MetaDataBean.class)
+public class ConstraintSourceAware2Bean
+{
+ @IgnoreConstraintSource
+ private String property1;
+
+ @TargetProperty("property3")
+ 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;
+ }
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware2MetaDataBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware2MetaDataBean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware2MetaDataBean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware2MetaDataBean.java Mon May 30 08:38:45 2011
@@ -0,0 +1,40 @@
+/*
+ * 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 javax.validation.constraints.NotNull;
+
+public class ConstraintSourceAware2MetaDataBean
+{
+ @NotNull
+ private String property1;
+
+ private String property3;
+
+ @NotNull
+ public String getProperty3()
+ {
+ return property3;
+ }
+
+ public void setProperty3(String property3)
+ {
+ this.property3 = property3;
+ }
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware3Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware3Bean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware3Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware3Bean.java Mon May 30 08:38:45 2011
@@ -0,0 +1,49 @@
+/*
+ * 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.core.validation.ConstraintSource;
+
+public class ConstraintSourceAware3Bean
+{
+ private String property1;
+
+ @ConstraintSource(ConstraintSourceAware3MetaDataBean.class)
+ 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;
+ }
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware3MetaDataBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware3MetaDataBean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware3MetaDataBean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware3MetaDataBean.java Mon May 30 08:38:45 2011
@@ -0,0 +1,30 @@
+/*
+ * 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 javax.validation.constraints.NotNull;
+
+public class ConstraintSourceAware3MetaDataBean
+{
+ @NotNull
+ private String property1;
+
+ @NotNull
+ private String property2;
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware4Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware4Bean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware4Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware4Bean.java Mon May 30 08:38:45 2011
@@ -0,0 +1,51 @@
+/*
+ * 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.core.validation.ConstraintSource;
+import org.apache.myfaces.extensions.validator.core.validation.TargetProperty;
+
+public class ConstraintSourceAware4Bean
+{
+ private String property1;
+
+ private String property2;
+
+ @TargetProperty("property")
+ @ConstraintSource(ConstraintSourceAware4MetaDataBean.class)
+ 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;
+ }
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware4MetaDataBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware4MetaDataBean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware4MetaDataBean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware4MetaDataBean.java Mon May 30 08:38:45 2011
@@ -0,0 +1,32 @@
+/*
+ * 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 javax.validation.constraints.NotNull;
+
+public class ConstraintSourceAware4MetaDataBean
+{
+ private String property;
+
+ @NotNull
+ public String getProperty()
+ {
+ return property;
+ }
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware5Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware5Bean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware5Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware5Bean.java Mon May 30 08:38:45 2011
@@ -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.model;
+
+import org.apache.myfaces.extensions.validator.core.validation.ConstraintSource;
+import org.apache.myfaces.extensions.validator.core.validation.TargetPropertyId;
+
+@ConstraintSource(ConstraintSourceAware5MetaDataBean.class)
+public class ConstraintSourceAware5Bean
+{
+ private String property1;
+
+ @TargetPropertyId(Target4.class)
+ private String property2;
+
+ @TargetPropertyId(Target3.class)
+ 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;
+ }
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware5MetaDataBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware5MetaDataBean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware5MetaDataBean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware5MetaDataBean.java Mon May 30 08:38:45 2011
@@ -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.model;
+
+import javax.validation.constraints.NotNull;
+
+public class ConstraintSourceAware5MetaDataBean
+{
+ @NotNull
+ @Target3
+ private String property3;
+
+ private String property4;
+
+ @NotNull
+ @Target4
+ public String getProperty4()
+ {
+ return property4;
+ }
+
+ public void setProperty4(String property4)
+ {
+ this.property4 = property4;
+ }
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware6Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware6Bean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware6Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware6Bean.java Mon May 30 08:38:45 2011
@@ -0,0 +1,67 @@
+/*
+ * 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.custom.CustomConstraintSource;
+import org.apache.myfaces.extensions.validator.test.beanval.custom.CustomTargetProperty;
+import org.apache.myfaces.extensions.validator.test.beanval.custom.CustomTargetPropertyId;
+import org.apache.myfaces.extensions.validator.test.beanval.custom.CustomIgnoreConstraintSource;
+
+@CustomConstraintSource(ConstraintSourceAware6MetaDataBean.class)
+public class ConstraintSourceAware6Bean
+{
+ private String property1;
+
+ @CustomTargetPropertyId(Target4.class)
+ private String property2;
+
+ @CustomIgnoreConstraintSource
+ private String property3;
+
+ @CustomTargetProperty("property3")
+ 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;
+ }
+
+ public String getProperty3()
+ {
+ return property3;
+ }
+
+ public void setProperty3(String property3)
+ {
+ this.property3 = property3;
+ }
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware6MetaDataBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware6MetaDataBean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware6MetaDataBean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ConstraintSourceAware6MetaDataBean.java Mon May 30 08:38:45 2011
@@ -0,0 +1,41 @@
+/*
+ * 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 javax.validation.constraints.NotNull;
+
+public class ConstraintSourceAware6MetaDataBean
+{
+ @NotNull
+ private String property3;
+
+ private String property4;
+
+ @NotNull
+ @Target4
+ public String getProperty4()
+ {
+ return property4;
+ }
+
+ public void setProperty4(String property4)
+ {
+ this.property4 = property4;
+ }
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/CustomTypeForCascadedValidationTestCase1Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/CustomTypeForCascadedValidationTestCase1Bean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/CustomTypeForCascadedValidationTestCase1Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/CustomTypeForCascadedValidationTestCase1Bean.java Mon May 30 08:38:45 2011
@@ -0,0 +1,47 @@
+/*
+ * 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 javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
+public class CustomTypeForCascadedValidationTestCase1Bean
+{
+ @NotNull
+ private String property1;
+
+ @Size(min = 3)
+ private String property2;
+
+ public CustomTypeForCascadedValidationTestCase1Bean(String property1, String property2)
+ {
+ this.property1 = property1;
+ this.property2 = property2;
+ }
+
+ public String getProperty1()
+ {
+ return property1;
+ }
+
+ public String getProperty2()
+ {
+ return property2;
+ }
+}
\ No newline at end of file
Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/GroupValidationTestCase1Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/GroupValidationTestCase1Bean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/GroupValidationTestCase1Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/GroupValidationTestCase1Bean.java Mon May 30 08:38:45 2011
@@ -0,0 +1,58 @@
+/*
+ * 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.Group1;
+import org.apache.myfaces.extensions.validator.test.beanval.validation.Group2;
+import org.apache.myfaces.extensions.validator.test.beanval.validation.Group3;
+
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import javax.validation.constraints.Pattern;
+
+public class GroupValidationTestCase1Bean
+{
+ @NotNull(groups = Group1.class)
+ private String property1;
+
+ @Pattern(regexp = "[A-Z][a-z]", groups = Group3.class)
+ @Size(min = 3, groups = Group2.class)
+ @NotNull(groups = Group2.class)
+ 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/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/GroupValidationTestCase2Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/GroupValidationTestCase2Bean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/GroupValidationTestCase2Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/GroupValidationTestCase2Bean.java Mon May 30 08:38:45 2011
@@ -0,0 +1,55 @@
+/*
+ * 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.Group1;
+import org.apache.myfaces.extensions.validator.test.beanval.validation.Group2;
+import org.apache.myfaces.extensions.validator.beanval.annotation.BeanValidation;
+
+import javax.validation.constraints.NotNull;
+
+public class GroupValidationTestCase2Bean
+{
+ @BeanValidation(useGroups = Group1.class)
+ @NotNull(groups = Group1.class)
+ private String property1;
+
+ @NotNull(groups = Group2.class)
+ 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/branches/branch_for_jsf_2_0/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/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ModelValidationTestCase1Bean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ModelValidationTestCase1Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ModelValidationTestCase1Bean.java Mon May 30 08:38:45 2011
@@ -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/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ModelValidationTestCase2Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ModelValidationTestCase2Bean.java?rev=1129058&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ModelValidationTestCase2Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/test-modules/bean-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/beanval/model/ModelValidationTestCase2Bean.java Mon May 30 08:38:45 2011
@@ -0,0 +1,57 @@
+/*
+ * 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 org.apache.myfaces.extensions.validator.beanval.annotation.BeanValidation;
+import org.apache.myfaces.extensions.validator.beanval.annotation.ModelValidation;
+
+import javax.validation.constraints.NotNull;
+
+@ClassLevelEqual
+@BeanValidation(viewIds = "/pages/modelValidationAwarePage.xhtml",
+ modelValidation = @ModelValidation(isActive = true))
+public class ModelValidationTestCase2Bean
+{
+ @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