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 2010/05/09 21:59:28 UTC
svn commit: r942602 - in
/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules:
core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/
core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/mode...
Author: gpetracek
Date: Sun May 9 19:59:27 2010
New Revision: 942602
URL: http://svn.apache.org/viewvc?rev=942602&view=rev
Log:
EXTVAL-83 tests for extval constraints - thx to Rudy De Busscher
Added:
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/CustomAnnotation.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/CustomAnnotationMetaDataTransformer.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/CustomAnnotationStrategy.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/DataBean.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/TestMetaDataExtractionInterceptor.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/AbstractConstraintSourceTestCase.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation1TestCase.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation2TestCase.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation3TestCase.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation4TestCase.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation5TestCase.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation6TestCase.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomConstraintSource.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomIgnoreConstraintSource.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomTargetProperty.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomTargetPropertyId.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware1Bean.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware1MetaDataBean.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware2Bean.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware2MetaDataBean.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware3Bean.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware3MetaDataBean.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware4Bean.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware4MetaDataBean.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware5Bean.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware5MetaDataBean.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware6Bean.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware6MetaDataBean.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/Target3.java
myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/Target4.java
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/CustomAnnotation.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/CustomAnnotation.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/CustomAnnotation.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/CustomAnnotation.java Sun May 9 19:59:27 2010
@@ -0,0 +1,17 @@
+package org.apache.myfaces.extensions.validator.test.util.model;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+@Documented
+public @interface CustomAnnotation
+{
+ boolean required();
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/CustomAnnotationMetaDataTransformer.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/CustomAnnotationMetaDataTransformer.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/CustomAnnotationMetaDataTransformer.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/CustomAnnotationMetaDataTransformer.java Sun May 9 19:59:27 2010
@@ -0,0 +1,34 @@
+package org.apache.myfaces.extensions.validator.test.util.model;
+
+import java.lang.annotation.Annotation;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.myfaces.extensions.validator.core.metadata.CommonMetaDataKeys;
+import org.apache.myfaces.extensions.validator.core.metadata.MetaDataEntry;
+import org.apache.myfaces.extensions.validator.core.metadata.transformer.MetaDataTransformer;
+
+public class CustomAnnotationMetaDataTransformer implements MetaDataTransformer
+{
+
+ public Map<String, Object> convertMetaData(MetaDataEntry metaDataEntry)
+ {
+ Map<String, Object> results = new HashMap<String, Object>();
+
+ Annotation annotation = metaDataEntry.getValue(Annotation.class);
+
+ if (annotation instanceof CustomAnnotation)
+ {
+ if ((((CustomAnnotation) annotation).required()))
+ {
+ results.put(CommonMetaDataKeys.REQUIRED, true);
+ }
+ results.put(
+ TestMetaDataExtractionInterceptor.PROPERTY_KEY,
+ metaDataEntry
+ .getProperty(TestMetaDataExtractionInterceptor.PROPERTY_KEY));
+ }
+ return results;
+ }
+
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/CustomAnnotationStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/CustomAnnotationStrategy.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/CustomAnnotationStrategy.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/CustomAnnotationStrategy.java Sun May 9 19:59:27 2010
@@ -0,0 +1,31 @@
+package org.apache.myfaces.extensions.validator.test.util.model;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.ValidatorException;
+
+import org.apache.myfaces.extensions.validator.core.metadata.MetaDataEntry;
+import org.apache.myfaces.extensions.validator.core.validation.strategy.AbstractAnnotationValidationStrategy;
+
+public class CustomAnnotationStrategy extends
+ AbstractAnnotationValidationStrategy<CustomAnnotation>
+{
+
+ @Override
+ protected String getValidationErrorMsgKey(CustomAnnotation annotation)
+ {
+ // We don't have to do anything here, The tests in ExtValUtilsTestCase just deals with extraction.
+ return null;
+ }
+
+ @Override
+ protected void processValidation(FacesContext facesContext,
+ UIComponent uiComponent, MetaDataEntry metaDataEntry,
+ Object convertedObject) throws ValidatorException
+ {
+ return;
+ // We don't have to do anything here, The tests in ExtValUtilsTestCase just deals with extraction.
+
+ }
+
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/DataBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/DataBean.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/DataBean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/DataBean.java Sun May 9 19:59:27 2010
@@ -0,0 +1,8 @@
+package org.apache.myfaces.extensions.validator.test.util.model;
+
+public class DataBean
+{
+
+ @CustomAnnotation(required = true)
+ private String property;
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/TestMetaDataExtractionInterceptor.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/TestMetaDataExtractionInterceptor.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/TestMetaDataExtractionInterceptor.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/core-tests/src/test/java/org/apache/myfaces/extensions/validator/test/util/model/TestMetaDataExtractionInterceptor.java Sun May 9 19:59:27 2010
@@ -0,0 +1,23 @@
+package org.apache.myfaces.extensions.validator.test.util.model;
+
+import org.apache.myfaces.extensions.validator.core.interceptor.MetaDataExtractionInterceptor;
+import org.apache.myfaces.extensions.validator.core.metadata.MetaDataEntry;
+import org.apache.myfaces.extensions.validator.core.property.PropertyInformation;
+
+public class TestMetaDataExtractionInterceptor implements
+ MetaDataExtractionInterceptor
+{
+ public static final String PROPERTY_KEY = "JUnit";
+ public static final String PROPERTY_VALUE = "From MetaDataExtractionInterceptor";
+
+ public void afterExtracting(PropertyInformation propertyInformation)
+ {
+ for (MetaDataEntry metaDataEntry : propertyInformation
+ .getMetaDataEntries())
+ {
+ metaDataEntry.setProperty(PROPERTY_KEY, PROPERTY_VALUE);
+ }
+
+ }
+
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/AbstractConstraintSourceTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/AbstractConstraintSourceTestCase.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/AbstractConstraintSourceTestCase.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/AbstractConstraintSourceTestCase.java Sun May 9 19:59:27 2010
@@ -0,0 +1,119 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource;
+
+import javax.faces.component.UIInput;
+import javax.faces.component.UIViewRoot;
+import javax.faces.component.html.HtmlForm;
+import javax.faces.component.html.HtmlInputText;
+import javax.faces.el.ValueBinding;
+
+import org.apache.myfaces.extensions.validator.internal.Priority;
+import org.apache.myfaces.extensions.validator.internal.ToDo;
+import org.apache.myfaces.extensions.validator.test.propval.AbstractPropertyValidationTestCase;
+
+@ToDo(value=Priority.MEDIUM,description="This is more or less the same as BaseBeanValPropertyValidationTestCase but can it be unified ??")
+public abstract class AbstractConstraintSourceTestCase<T> extends AbstractPropertyValidationTestCase
+{
+
+ protected HtmlInputText inputComponent1 = null;
+ protected HtmlInputText inputComponent2 = null;
+ protected HtmlInputText inputComponent3 = null;
+
+ private UIViewRoot rootComponent = null;
+
+ protected T bean;
+
+ public AbstractConstraintSourceTestCase(String name)
+ {
+ super(name);
+ }
+
+ @SuppressWarnings({"UnusedDeclaration"})
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ bean = getBeanToTest();
+ bindBeanToExpression();
+
+ createComponents();
+
+ }
+
+ private void createComponents()
+ {
+ rootComponent = new UIViewRoot();
+ HtmlForm form = new HtmlForm();
+ form.setId("form");
+ rootComponent.getChildren().add(form);
+ inputComponent1 = new HtmlInputText();
+ inputComponent2 = new HtmlInputText();
+ inputComponent3 = new HtmlInputText();
+ form.getChildren().add(inputComponent1);
+ form.getChildren().add(inputComponent2);
+ form.getChildren().add(inputComponent3);
+ inputComponent1.setId("input1");
+ inputComponent2.setId("input2");
+ inputComponent3.setId("input3");
+ }
+
+ @SuppressWarnings({"UnusedDeclaration"})
+ private void bindBeanToExpression()
+ {
+ ValueBinding vb = application.createValueBinding("#{testBean}");
+ facesContext.getExternalContext().getRequestMap().put("testBean", bean);
+ }
+
+ protected abstract T getBeanToTest();
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ inputComponent1 = null;
+ inputComponent2 = null;
+ inputComponent3 = null;
+ rootComponent = null;
+ bean = null;
+ }
+
+ protected void createValueBindingForComponent(UIInput uiComponent, String valueBinding)
+ {
+ createValueBinding(uiComponent, "value", valueBinding);
+ }
+
+ protected void setValueToValidate(UIInput uiComponent, String valueToValidate)
+ {
+ uiComponent.setSubmittedValue(valueToValidate);
+ }
+
+ protected void validateComponents()
+ {
+ inputComponent1.processValidators(facesContext);
+ inputComponent2.processValidators(facesContext);
+ inputComponent3.processValidators(facesContext);
+ }
+
+ protected void updateComponents()
+ {
+ inputComponent1.processUpdates(facesContext);
+ inputComponent2.processUpdates(facesContext);
+ inputComponent3.processUpdates(facesContext);
+ }
+
+ protected void assertComponentValid(UIInput uiInput)
+ {
+ assertTrue(isComponentValid(uiInput));
+ }
+
+ protected void assertComponentInvalid(UIInput uiInput)
+ {
+ assertFalse(isComponentValid(uiInput));
+ }
+
+ private boolean isComponentValid(UIInput uiComponent)
+ {
+ return uiComponent.isValid();
+ }
+
+
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation1TestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation1TestCase.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation1TestCase.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation1TestCase.java Sun May 9 19:59:27 2010
@@ -0,0 +1,81 @@
+/*
+ * 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.propval.constraintsource;
+
+import javax.faces.application.FacesMessage;
+
+import org.apache.myfaces.extensions.validator.test.propval.constraintsource.model.ConstraintSourceAware1Bean;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * EXTVAL-83
+ *
+ * @author Gerhard Petracek
+ * @author Rudy De Busscher
+ */
+public class ConstraintSourceAwareValidation1TestCase extends
+ AbstractConstraintSourceTestCase<ConstraintSourceAware1Bean>
+{
+ public ConstraintSourceAwareValidation1TestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(ConstraintSourceAwareValidation1TestCase.class);
+ }
+
+ protected ConstraintSourceAware1Bean getBeanToTest()
+ {
+ return new ConstraintSourceAware1Bean();
+ }
+
+ public void testImplicitFieldMapping()
+ {
+ createValueBindingForComponent(this.inputComponent1,
+ "#{testBean.property1}");
+ setValueToValidate(this.inputComponent1, "");
+
+ validateComponents();
+
+ assertComponentInvalid(this.inputComponent1);
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+
+ public void testImplicitMethodMapping()
+ {
+ createValueBindingForComponent(this.inputComponent2,
+ "#{testBean.property2}");
+ setValueToValidate(this.inputComponent2, "");
+
+ validateComponents();
+
+ assertComponentInvalid(this.inputComponent2);
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation2TestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation2TestCase.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation2TestCase.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation2TestCase.java Sun May 9 19:59:27 2010
@@ -0,0 +1,55 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource;
+
+import javax.faces.application.FacesMessage;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.extensions.validator.test.propval.constraintsource.model.ConstraintSourceAware2Bean;
+
+public class ConstraintSourceAwareValidation2TestCase extends
+AbstractConstraintSourceTestCase<ConstraintSourceAware2Bean>
+{
+ public ConstraintSourceAwareValidation2TestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(ConstraintSourceAwareValidation2TestCase.class);
+ }
+
+ protected ConstraintSourceAware2Bean getBeanToTest()
+ {
+ return new ConstraintSourceAware2Bean();
+ }
+
+ public void testIgnoreConstraintSource()
+ {
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.property1}");
+ setValueToValidate(this.inputComponent1, "");
+
+ validateComponents();
+
+ assertComponentValid(this.inputComponent1);
+ assertNavigationBlocked(false);
+
+ checkMessageCount(0);
+ }
+
+ public void testStringBasedTargetProperty()
+ {
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.property2}");
+ setValueToValidate(this.inputComponent2, "");
+
+ validateComponents();
+
+ assertComponentInvalid(this.inputComponent2);
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation3TestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation3TestCase.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation3TestCase.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation3TestCase.java Sun May 9 19:59:27 2010
@@ -0,0 +1,54 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource;
+
+import javax.faces.application.FacesMessage;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.extensions.validator.test.propval.constraintsource.model.ConstraintSourceAware3Bean;
+
+public class ConstraintSourceAwareValidation3TestCase extends
+AbstractConstraintSourceTestCase<ConstraintSourceAware3Bean>
+{
+ public ConstraintSourceAwareValidation3TestCase(String name)
+ {
+ super(name);
+ }
+ public static Test suite()
+ {
+ return new TestSuite(ConstraintSourceAwareValidation3TestCase.class);
+ }
+
+ protected ConstraintSourceAware3Bean getBeanToTest()
+ {
+ return new ConstraintSourceAware3Bean();
+ }
+
+ public void testMissingBasedConstraintSource()
+ {
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.property1}");
+ setValueToValidate(this.inputComponent1, "");
+
+ validateComponents();
+
+ assertComponentValid(this.inputComponent1);
+ assertNavigationBlocked(false);
+
+ checkMessageCount(0);
+ }
+
+ public void testFieldBasedConstraintSource()
+ {
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.property2}");
+ setValueToValidate(this.inputComponent2, "");
+
+ validateComponents();
+
+ assertComponentInvalid(this.inputComponent2);
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation4TestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation4TestCase.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation4TestCase.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation4TestCase.java Sun May 9 19:59:27 2010
@@ -0,0 +1,55 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource;
+
+import javax.faces.application.FacesMessage;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.extensions.validator.test.propval.constraintsource.model.ConstraintSourceAware4Bean;
+
+public class ConstraintSourceAwareValidation4TestCase extends
+AbstractConstraintSourceTestCase<ConstraintSourceAware4Bean>
+{
+ public ConstraintSourceAwareValidation4TestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(ConstraintSourceAwareValidation4TestCase.class);
+ }
+
+ protected ConstraintSourceAware4Bean getBeanToTest()
+ {
+ return new ConstraintSourceAware4Bean();
+ }
+
+ public void testMethodBasedConstraintSourceAndTargetPropertyAnnotation()
+ {
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.property1}");
+ setValueToValidate(this.inputComponent1, "");
+
+ validateComponents();
+
+ assertComponentInvalid(this.inputComponent1);
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+
+ public void testMissingBasedConstraintSource()
+ {
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.property2}");
+ setValueToValidate(this.inputComponent2, "");
+
+ validateComponents();
+
+ assertComponentValid(this.inputComponent2);
+ assertNavigationBlocked(false);
+
+ checkMessageCount(0);
+ }
+
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation5TestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation5TestCase.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation5TestCase.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation5TestCase.java Sun May 9 19:59:27 2010
@@ -0,0 +1,80 @@
+/*
+ * 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.propval.constraintsource;
+
+import javax.faces.application.FacesMessage;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.extensions.validator.test.propval.constraintsource.model.ConstraintSourceAware5Bean;
+
+/**
+ * EXTVAL-83
+ *
+ * @author Gerhard Petracek
+ * @author Rudy De busscher
+ */
+public class ConstraintSourceAwareValidation5TestCase extends
+AbstractConstraintSourceTestCase<ConstraintSourceAware5Bean>
+{
+ public ConstraintSourceAwareValidation5TestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(ConstraintSourceAwareValidation5TestCase.class);
+ }
+
+ protected ConstraintSourceAware5Bean getBeanToTest()
+ {
+ return new ConstraintSourceAware5Bean();
+ }
+
+ public void testMethodBasedTargetPropertyIdAnnotation()
+ {
+ createValueBindingForComponent(this.inputComponent1, "#{testBean.property1}");
+ setValueToValidate(this.inputComponent1, "");
+
+ validateComponents();
+
+ assertComponentInvalid(this.inputComponent1);
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+
+ public void testFieldBasedTargetPropertyIdAnnotation()
+ {
+ createValueBindingForComponent(this.inputComponent2, "#{testBean.property2}");
+ setValueToValidate(this.inputComponent2, "");
+
+ validateComponents();
+
+ assertComponentInvalid(this.inputComponent2);
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation6TestCase.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation6TestCase.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation6TestCase.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/ConstraintSourceAwareValidation6TestCase.java Sun May 9 19:59:27 2010
@@ -0,0 +1,97 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource;
+
+import javax.faces.application.FacesMessage;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.extensions.validator.core.ExtValContext;
+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;
+import org.apache.myfaces.extensions.validator.core.validation.TargetPropertyId;
+import org.apache.myfaces.extensions.validator.test.propval.constraintsource.custom.CustomConstraintSource;
+import org.apache.myfaces.extensions.validator.test.propval.constraintsource.custom.CustomIgnoreConstraintSource;
+import org.apache.myfaces.extensions.validator.test.propval.constraintsource.custom.CustomTargetProperty;
+import org.apache.myfaces.extensions.validator.test.propval.constraintsource.custom.CustomTargetPropertyId;
+import org.apache.myfaces.extensions.validator.test.propval.constraintsource.model.ConstraintSourceAware6Bean;
+
+public class ConstraintSourceAwareValidation6TestCase extends
+ AbstractConstraintSourceTestCase<ConstraintSourceAware6Bean>
+{
+ public ConstraintSourceAwareValidation6TestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(ConstraintSourceAwareValidation6TestCase.class);
+ }
+
+ protected ConstraintSourceAware6Bean getBeanToTest()
+ {
+ return new ConstraintSourceAware6Bean();
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ ExtValContext extValContext = ExtValContext.getContext();
+
+ extValContext.addGlobalProperty(ConstraintSource.class.getName(),
+ CustomConstraintSource.class);
+ extValContext.addGlobalProperty(IgnoreConstraintSource.class.getName(),
+ CustomIgnoreConstraintSource.class);
+ extValContext.addGlobalProperty(TargetProperty.class.getName(),
+ CustomTargetProperty.class);
+ extValContext.addGlobalProperty(TargetPropertyId.class.getName(),
+ CustomTargetPropertyId.class);
+ }
+
+ public void testCustomAnnotations1()
+ {
+ createValueBindingForComponent(this.inputComponent1,
+ "#{testBean.property1}");
+ setValueToValidate(this.inputComponent1, "");
+
+ validateComponents();
+
+ assertComponentInvalid(this.inputComponent1);
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+
+ public void testCustomAnnotations2()
+ {
+ createValueBindingForComponent(this.inputComponent2,
+ "#{testBean.property2}");
+ setValueToValidate(this.inputComponent2, "");
+
+ validateComponents();
+
+ assertComponentInvalid(this.inputComponent2);
+ assertNavigationBlocked(true);
+
+ checkMessageCount(1);
+ checkMessageSeverities(FacesMessage.SEVERITY_ERROR);
+ }
+
+ public void testCustomAnnotations3()
+ {
+ createValueBindingForComponent(this.inputComponent3,
+ "#{testBean.property3}");
+ setValueToValidate(this.inputComponent3, "");
+
+ validateComponents();
+
+ assertComponentValid(this.inputComponent3);
+ assertNavigationBlocked(false);
+
+ checkMessageCount(0);
+ }
+
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomConstraintSource.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomConstraintSource.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomConstraintSource.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomConstraintSource.java Sun May 9 19:59:27 2010
@@ -0,0 +1,18 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.custom;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+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_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomIgnoreConstraintSource.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomIgnoreConstraintSource.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomIgnoreConstraintSource.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomIgnoreConstraintSource.java Sun May 9 19:59:27 2010
@@ -0,0 +1,16 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.custom;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Target( { FIELD, METHOD })
+@Retention(RUNTIME)
+@Documented
+public @interface CustomIgnoreConstraintSource
+{
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomTargetProperty.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomTargetProperty.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomTargetProperty.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomTargetProperty.java Sun May 9 19:59:27 2010
@@ -0,0 +1,17 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.custom;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+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_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomTargetPropertyId.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomTargetPropertyId.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomTargetPropertyId.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/custom/CustomTargetPropertyId.java Sun May 9 19:59:27 2010
@@ -0,0 +1,18 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.custom;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Annotation;
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+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_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware1Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware1Bean.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware1Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware1Bean.java Sun May 9 19:59:27 2010
@@ -0,0 +1,31 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.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_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware1MetaDataBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware1MetaDataBean.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware1MetaDataBean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware1MetaDataBean.java Sun May 9 19:59:27 2010
@@ -0,0 +1,23 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.model;
+
+import org.apache.myfaces.extensions.validator.baseval.annotation.Required;
+
+
+public class ConstraintSourceAware1MetaDataBean
+{
+ @Required
+ private String property1;
+
+ private String property2;
+
+ @Required
+ public String getProperty2()
+ {
+ return property2;
+ }
+
+ public void setProperty2(String property2)
+ {
+ this.property2 = property2;
+ }
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware2Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware2Bean.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware2Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware2Bean.java Sun May 9 19:59:27 2010
@@ -0,0 +1,35 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.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_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware2MetaDataBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware2MetaDataBean.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware2MetaDataBean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware2MetaDataBean.java Sun May 9 19:59:27 2010
@@ -0,0 +1,23 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.model;
+
+import org.apache.myfaces.extensions.validator.baseval.annotation.Required;
+
+public class ConstraintSourceAware2MetaDataBean
+{
+ @Required
+ private String property1;
+
+ private String property3;
+
+ @Required
+ public String getProperty3()
+ {
+ return property3;
+ }
+
+ public void setProperty3(String property3)
+ {
+ this.property3 = property3;
+ }
+
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware3Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware3Bean.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware3Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware3Bean.java Sun May 9 19:59:27 2010
@@ -0,0 +1,31 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.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_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware3MetaDataBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware3MetaDataBean.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware3MetaDataBean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware3MetaDataBean.java Sun May 9 19:59:27 2010
@@ -0,0 +1,12 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.model;
+
+import org.apache.myfaces.extensions.validator.baseval.annotation.Required;
+
+public class ConstraintSourceAware3MetaDataBean
+{
+ @Required
+ private String property1;
+
+ @Required
+ private String property2;
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware4Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware4Bean.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware4Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware4Bean.java Sun May 9 19:59:27 2010
@@ -0,0 +1,33 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.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_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware4MetaDataBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware4MetaDataBean.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware4MetaDataBean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware4MetaDataBean.java Sun May 9 19:59:27 2010
@@ -0,0 +1,15 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.model;
+
+import org.apache.myfaces.extensions.validator.baseval.annotation.Required;
+
+public class ConstraintSourceAware4MetaDataBean
+{
+ private String property;
+
+ @Required
+ public String getProperty()
+ {
+ return property;
+ }
+
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware5Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware5Bean.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware5Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware5Bean.java Sun May 9 19:59:27 2010
@@ -0,0 +1,34 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.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_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware5MetaDataBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware5MetaDataBean.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware5MetaDataBean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware5MetaDataBean.java Sun May 9 19:59:27 2010
@@ -0,0 +1,24 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.model;
+
+import org.apache.myfaces.extensions.validator.baseval.annotation.Required;
+
+public class ConstraintSourceAware5MetaDataBean
+{
+ @Required
+ @Target3
+ private String property3;
+
+ private String property4;
+
+ @Required
+ @Target4
+ public String getProperty4()
+ {
+ return property4;
+ }
+
+ public void setProperty4(String property4)
+ {
+ this.property4 = property4;
+ }
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware6Bean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware6Bean.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware6Bean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware6Bean.java Sun May 9 19:59:27 2010
@@ -0,0 +1,49 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.model;
+
+import org.apache.myfaces.extensions.validator.test.propval.constraintsource.custom.CustomConstraintSource;
+import org.apache.myfaces.extensions.validator.test.propval.constraintsource.custom.CustomIgnoreConstraintSource;
+import org.apache.myfaces.extensions.validator.test.propval.constraintsource.custom.CustomTargetProperty;
+import org.apache.myfaces.extensions.validator.test.propval.constraintsource.custom.CustomTargetPropertyId;
+
+@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_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware6MetaDataBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware6MetaDataBean.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware6MetaDataBean.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/ConstraintSourceAware6MetaDataBean.java Sun May 9 19:59:27 2010
@@ -0,0 +1,24 @@
+package org.apache.myfaces.extensions.validator.test.propval.constraintsource.model;
+
+import org.apache.myfaces.extensions.validator.baseval.annotation.Required;
+
+public class ConstraintSourceAware6MetaDataBean
+{
+ @Required
+ private String property3;
+
+ private String property4;
+
+ @Required
+ @Target4
+ public String getProperty4()
+ {
+ return property4;
+ }
+
+ public void setProperty4(String property4)
+ {
+ this.property4 = property4;
+ }
+
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/Target3.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/Target3.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/Target3.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/Target3.java Sun May 9 19:59:27 2010
@@ -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.propval.constraintsource.model;
+
+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 Target3
+{
+}
Added: myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/Target4.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/Target4.java?rev=942602&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/Target4.java (added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/test-modules/property-validation-tests/src/test/java/org/apache/myfaces/extensions/validator/test/propval/constraintsource/model/Target4.java Sun May 9 19:59:27 2010
@@ -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.propval.constraintsource.model;
+
+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 Target4
+{
+}