http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-results.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-results.xml b/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-results.xml new file mode 100644 index 0000000..5df61c7 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-results.xml @@ -0,0 +1,32 @@ +<!DOCTYPE xwork PUBLIC + "-//Apache Struts//XWork 1.1.1//EN" + "http://struts.apache.org/dtds/xwork-1.1.1.dtd" + > + +<xwork> + <include file="xwork-test-beans.xml" /> + <package name="default"> + <result-types> + <result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult" default="true"/> + <result-type name="mock" class="com.opensymphony.xwork2.mock.MockResult"/> + </result-types> + + <global-results> + <!-- should be chain type since it is the default --> + <result name="login">login</result> + </global-results> + + <action name="Bar" class="com.opensymphony.xwork2.SimpleAction"> + <result name="chainDefaultTypedResult" /> + <result name="mockTypedResult" type="mock" /> + <result name="specificLocationResult"> + <param name="actionName">bar.vm</param> + </result> + <result name="defaultLocationResult">foo.vm</result> + <result name="noDefaultLocationResult"> <!-- this will have only one param, named foo --> + foo.vm + <param name="foo">bar</param> + </result> + </action> + </package> +</xwork>
http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-wildcard-1.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-wildcard-1.xml b/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-wildcard-1.xml new file mode 100644 index 0000000..e10d2b7 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-wildcard-1.xml @@ -0,0 +1,8 @@ +<!DOCTYPE xwork PUBLIC + "-//Apache Struts//XWork 1.1.1//EN" + "http://struts.apache.org/dtds/xwork-1.1.1.dtd" + > + +<xwork> + <package name="default-1" /> +</xwork> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-wildcard-2.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-wildcard-2.xml b/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-wildcard-2.xml new file mode 100644 index 0000000..3039d84 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-wildcard-2.xml @@ -0,0 +1,8 @@ +<!DOCTYPE xwork PUBLIC + "-//Apache Struts//XWork 1.1.1//EN" + "http://struts.apache.org/dtds/xwork-1.1.1.dtd" + > + +<xwork> + <package name="default-2" /> +</xwork> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-wildcard-include.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-wildcard-include.xml b/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-wildcard-include.xml new file mode 100644 index 0000000..d101a40 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-test-wildcard-include.xml @@ -0,0 +1,10 @@ +<!DOCTYPE xwork PUBLIC + "-//Apache Struts//XWork 1.1.1//EN" + "http://struts.apache.org/dtds/xwork-1.1.1.dtd" + > + +<xwork> + <include file="xwork-test-beans.xml" /> + <include file="com/opensymphony/xwork2/config/providers/xwork-test-wildcard-*.xml" /> + <package name="default-wildcard" /> +</xwork> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-unknownhandler-stack-empty.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-unknownhandler-stack-empty.xml b/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-unknownhandler-stack-empty.xml new file mode 100644 index 0000000..6140484 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-unknownhandler-stack-empty.xml @@ -0,0 +1,12 @@ +<!DOCTYPE xwork PUBLIC + "-//Apache Struts//XWork 2.1//EN" + "http://struts.apache.org/dtds/xwork-2.1.dtd" + > + +<xwork> + <bean type="com.opensymphony.xwork2.UnknownHandler" name="uh1" class="com.opensymphony.xwork2.config.providers.SomeUnknownHandler"/> + <bean type="com.opensymphony.xwork2.UnknownHandler" name="uh2" class="com.opensymphony.xwork2.config.providers.SomeUnknownHandler"/> + + <unknown-handler-stack> + </unknown-handler-stack> +</xwork> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-unknownhandler-stack.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-unknownhandler-stack.xml b/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-unknownhandler-stack.xml new file mode 100644 index 0000000..6b06a4e --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/config/providers/xwork-unknownhandler-stack.xml @@ -0,0 +1,14 @@ +<!DOCTYPE xwork PUBLIC + "-//Apache Struts//XWork 2.1//EN" + "http://struts.apache.org/dtds/xwork-2.1.dtd" + > + +<xwork> + <bean type="com.opensymphony.xwork2.UnknownHandler" name="uh1" class="com.opensymphony.xwork2.config.providers.SomeUnknownHandler"/> + <bean type="com.opensymphony.xwork2.UnknownHandler" name="uh2" class="com.opensymphony.xwork2.config.providers.SomeUnknownHandler"/> + + <unknown-handler-stack> + <unknown-handler-ref name="uh1" /> + <unknown-handler-ref name="uh2" /> + </unknown-handler-stack> +</xwork> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/conversion/impl/test-xwork-conversion.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/conversion/impl/test-xwork-conversion.properties b/core/src/test/resources/com/opensymphony/xwork2/conversion/impl/test-xwork-conversion.properties new file mode 100644 index 0000000..42fde48 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/conversion/impl/test-xwork-conversion.properties @@ -0,0 +1 @@ +com.opensymphony.xwork2.util.Bar=com.opensymphony.xwork2.conversion.impl.FooBarConverter \ No newline at end of file http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/somefile.txt ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/somefile.txt b/core/src/test/resources/com/opensymphony/xwork2/somefile.txt new file mode 100644 index 0000000..2b9e251 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/somefile.txt @@ -0,0 +1,9 @@ +this +is +a +file +of +great +import +or +something http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/spring/actionContext-spring.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/spring/actionContext-spring.xml b/core/src/test/resources/com/opensymphony/xwork2/spring/actionContext-spring.xml new file mode 100644 index 0000000..02a4f33 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/spring/actionContext-spring.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans.xsd"> + + <bean id="simple-action" class="com.opensymphony.xwork2.SimpleAction" scope="prototype"/> + + <bean id="dependency-action" class="com.opensymphony.xwork2.SimpleAction" scope="prototype"> + <property name="blah"><value>injected</value></property> + </bean> + + <bean id="execute-interceptor" class="com.opensymphony.xwork2.spring.ExecuteInterceptor"/> + + <bean id="proxied-action" class="org.springframework.aop.framework.ProxyFactoryBean"> + <property name="singleton"><value>false</value></property> + <property name="proxyTargetClass"><value>true</value></property> + <property name="interceptorNames"> + <list> + <value>execute-interceptor</value> + <!-- When "singleton" is false, the target appears to be required here to + ensure that the config works as it should --> + <value>simple-action</value> + </list> + </property> + </bean> + + <bean id="auto-proxied-action" class="com.opensymphony.xwork2.SimpleAction" scope="prototype"/> + + <bean id="xwork-actions-proxy-creator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"> + <property name="proxyTargetClass"><value>true</value></property> + <property name="interceptorNames"> + <list> + <value>execute-interceptor</value> + </list> + </property> + <property name="beanNames"><value>auto-proxied-action</value></property> + </bean> + + <bean id="springResult" class="com.opensymphony.xwork2.spring.SpringResult" init-method="initialize"> + <property name="stringParameter" value="my string"/> + </bean> +</beans> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/spring/actionContext-xwork.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/spring/actionContext-xwork.xml b/core/src/test/resources/com/opensymphony/xwork2/spring/actionContext-xwork.xml new file mode 100644 index 0000000..988956f --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/spring/actionContext-xwork.xml @@ -0,0 +1,23 @@ +<!DOCTYPE xwork PUBLIC "-//Apache Struts//XWork 2.0//EN" "http://struts.apache.org/dtds/xwork-2.0.dtd"> +<xwork> + <bean type="com.opensymphony.xwork2.ObjectFactory" class="com.opensymphony.xwork2.spring.SpringObjectFactory" /> + <constant name="applicationContextPath" value="com/opensymphony/xwork2/spring/actionContext-spring.xml" /> + <package name="default"> + <result-types> + <result-type name="null" class="com.opensymphony.xwork2.mock.MockResult" default="true"/> + <result-type name="springResult" class="springResult" /> + </result-types> + + <action name="simpleAction" class="simple-action"/> + + <action name="dependencyAction" class="dependency-action"/> + + <action name="proxiedAction" class="proxied-action"/> + + <action name="autoProxiedAction" class="auto-proxied-action"/> + + <action name="simpleActionSpringResult" class="simple-action"> + <result name="error" type="springResult"/> + </action> + </package> +</xwork> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/spring/autowireContext.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/spring/autowireContext.xml b/core/src/test/resources/com/opensymphony/xwork2/spring/autowireContext.xml new file mode 100644 index 0000000..059bb4a --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/spring/autowireContext.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> + +<beans> + <bean id="spring-object-factory" class="com.opensymphony.xwork2.spring.SpringObjectFactory" init-method="initObjectFactory"/> +</beans> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/spring/resolverApplicationContext.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/spring/resolverApplicationContext.xml b/core/src/test/resources/com/opensymphony/xwork2/spring/resolverApplicationContext.xml new file mode 100644 index 0000000..6f0908f --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/spring/resolverApplicationContext.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> + +<beans> + <bean id="myFoo" class="com.opensymphony.xwork2.spring.Foo"> + <property name="name"><value>Little Foo</value></property> + </bean> + <bean id="myBar" class="com.opensymphony.xwork2.spring.Bar" autowire="byType"> + <property name="value"><value>16</value></property> + </bean> +</beans> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/spring/xwork-autowire.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/spring/xwork-autowire.xml b/core/src/test/resources/com/opensymphony/xwork2/spring/xwork-autowire.xml new file mode 100644 index 0000000..a86ce20 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/spring/xwork-autowire.xml @@ -0,0 +1,22 @@ +<!DOCTYPE xwork PUBLIC "-//Apache Struts//XWork 2.0//EN" "http://struts.apache.org/dtds/xwork-2.0.dtd"> +<xwork> + <bean type="com.opensymphony.xwork2.ActionProxyFactory" name="default" class="com.opensymphony.xwork2.DefaultActionProxyFactory" /> + <bean type="com.opensymphony.xwork2.ObjectFactory" name="default" class="com.opensymphony.xwork2.spring.SpringObjectFactory" /> + <constant name="applicationContextPath" value="com/opensymphony/xwork2/spring/actionContext-spring.xml" /> + <package name="default"> + <result-types> + <result-type name="null" +class="com.opensymphony.xwork2.result.NullResult" default="true"/> + </result-types> + + <interceptors> + <interceptor name="autowire" class="com.opensymphony.xwork2.spring.interceptor.ActionAutowiringInterceptor"> + <param name="autowireStrategy">@org.springframework.beans.factory.config.AutowireCapableBeanFactory@AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE</param> + </interceptor> + </interceptors> + + <default-interceptor-ref name="autowire"/> + + <action name="simpleAction" class="com.opensymphony.xwork2.SimpleAction"/> + </package> +</xwork> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/test.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/test.properties b/core/src/test/resources/com/opensymphony/xwork2/test.properties new file mode 100644 index 0000000..7edc23d --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/test.properties @@ -0,0 +1 @@ +xwork.error.action.execution=Testing resource bundle override http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/test/DataAware-conversion.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/test/DataAware-conversion.properties b/core/src/test/resources/com/opensymphony/xwork2/test/DataAware-conversion.properties new file mode 100644 index 0000000..cd84249 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/test/DataAware-conversion.properties @@ -0,0 +1 @@ +barObj=com.opensymphony.xwork2.conversion.impl.FooBarConverter http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/test/DataAware-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/test/DataAware-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/test/DataAware-validation.xml new file mode 100644 index 0000000..8bc0a7b --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/test/DataAware-validation.xml @@ -0,0 +1,8 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd"> +<validators> + <field name="data"> + <field-validator type="required"> + <message>You must enter a value for data.</message> + </field-validator> + </field> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/test/DataAware-validationAlias-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/test/DataAware-validationAlias-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/test/DataAware-validationAlias-validation.xml new file mode 100644 index 0000000..f32dd3b --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/test/DataAware-validationAlias-validation.xml @@ -0,0 +1,8 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd"> +<validators> + <field name="data"> + <field-validator type="requiredstring"> + <message>You must enter a value for data.</message> + </field-validator> + </field> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/test/DataAware.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/test/DataAware.properties b/core/src/test/resources/com/opensymphony/xwork2/test/DataAware.properties new file mode 100644 index 0000000..64800c5 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/test/DataAware.properties @@ -0,0 +1,2 @@ +test.foo = Foo! +test.bar = Bar! http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/test/DataAware2-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/test/DataAware2-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/test/DataAware2-validation.xml new file mode 100644 index 0000000..054d34f --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/test/DataAware2-validation.xml @@ -0,0 +1,8 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd"> +<validators> + <field name="bling"> + <field-validator type="requiredstring"> + <message>You must enter a value for data.</message> + </field-validator> + </field> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/test/Equidae-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/test/Equidae-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/test/Equidae-validation.xml new file mode 100644 index 0000000..b59fe1f --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/test/Equidae-validation.xml @@ -0,0 +1,52 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd"> +<validators> + <field name="horse"> + <field-validator type="requiredstring"> + <param name="trim">false</param> + <message>noTrim</message> + </field-validator> + <field-validator type="requiredstring"> + <param name="trim">true</param> + <message>trim</message> + </field-validator> + </field> + + <field name="cow"> + <field-validator type="stringlength"> + <param name="trim">false</param> + <param name="minLength">5</param> + <message>noTrim-min5</message> + </field-validator> + <field-validator type="stringlength"> + <param name="trim">false</param> + <param name="minLength">5</param> + <param name="maxLength">10</param> + <message>noTrim-min5-max10</message> + </field-validator> + <field-validator type="stringlength"> + <param name="trim">false</param> + <param name="maxLength">10</param> + <message>noTrim-max10</message> + </field-validator> + </field> + + <field name="donkey"> + <field-validator type="stringlength"> + <param name="trim">true</param> + <param name="minLength">5</param> + <message>trim-min5</message> + </field-validator> + <field-validator type="stringlength"> + <param name="trim">true</param> + <param name="minLength">5</param> + <param name="maxLength">10</param> + <message>trim-min5-max10</message> + </field-validator> + <field-validator type="stringlength"> + <param name="trim">true</param> + <param name="maxLength">10</param> + <message>trim-max10</message> + </field-validator> + </field> + +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/test/SimpleAction2-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/test/SimpleAction2-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/test/SimpleAction2-validation.xml new file mode 100644 index 0000000..a48237f --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/test/SimpleAction2-validation.xml @@ -0,0 +1,13 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd"> +<validators> + <field name="count"> + <field-validator type="required"> + <message>You must enter a value for count.</message> + </field-validator> + <field-validator type="int"> + <param name="min">0</param> + <param name="max">5</param> + <message>count must be between ${min} and ${max}, current value is ${count}.</message> + </field-validator> + </field> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/test/SimpleAction2-validationAlias-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/test/SimpleAction2-validationAlias-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/test/SimpleAction2-validationAlias-validation.xml new file mode 100644 index 0000000..e22d206 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/test/SimpleAction2-validationAlias-validation.xml @@ -0,0 +1,13 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd"> +<validators> + <field name="baz"> + <field-validator type="required"> + <message>You must enter a value for baz.</message> + </field-validator> + <field-validator type="int"> + <param name="min">2</param> + <param name="max">4</param> + <message>baz out of range.</message> + </field-validator> + </field> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/test/TestBean2-conversion.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/test/TestBean2-conversion.properties b/core/src/test/resources/com/opensymphony/xwork2/test/TestBean2-conversion.properties new file mode 100644 index 0000000..6b1e4df --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/test/TestBean2-conversion.properties @@ -0,0 +1 @@ +cat = com.opensymphony.xwork2.conversion.impl.FooBarConverter http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/test/User-conversion.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/test/User-conversion.properties b/core/src/test/resources/com/opensymphony/xwork2/test/User-conversion.properties new file mode 100644 index 0000000..171c610 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/test/User-conversion.properties @@ -0,0 +1,2 @@ +Collection_list = java.lang.String +Collection_map = java.lang.String http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/test/User-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/test/User-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/test/User-validation.xml new file mode 100644 index 0000000..afe5d33 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/test/User-validation.xml @@ -0,0 +1,38 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd"> +<validators> + <field name="name"> + <field-validator type="required"> + <message key="name.key">You must enter a value for name.</message> + </field-validator> + </field> + + <field name="email"> + <field-validator type="email" short-circuit="true"> + <message>Not a valid e-mail.</message> + </field-validator> + <field-validator type="fieldexpression"> + <param name="expression">email.endsWith('mycompany.com')</param> + <message>Email not from the right company.</message> + </field-validator> + </field> + + <field name="email2"> + <field-validator type="email"> + <message>Not a valid e-mail2.</message> + </field-validator> + <field-validator type="fieldexpression"> + <param name="expression">email.endsWith('mycompany.com')</param> + <message>Email2 not from the right company.</message> + </field-validator> + </field> + + <validator type="expression"> + <param name="expression">email.startsWith('mark')</param> + <message>Email does not start with mark</message> + </validator> + <validator type="expression"> + <param name="expression">email2.startsWith('mark')</param> + <message>Email2 does not start with mark</message> + </validator> + +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/test/UserMarker-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/test/UserMarker-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/test/UserMarker-validation.xml new file mode 100644 index 0000000..e96fa54 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/test/UserMarker-validation.xml @@ -0,0 +1,17 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd"> +<validators> + <field name="email"> + <field-validator type="required" short-circuit="true"> + <message>You must enter a value for email.</message> + </field-validator> + </field> + <field name="email2"> + <field-validator type="required" short-circuit="true"> + <message>You must enter a value for email2.</message> + </field-validator> + </field> + <validator type="expression" short-circuit="true"> + <param name="expression">email.equals(email2)</param> + <message>Email not the same as email2</message> + </validator> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/test/package.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/test/package.properties b/core/src/test/resources/com/opensymphony/xwork2/test/package.properties new file mode 100644 index 0000000..269e249 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/test/package.properties @@ -0,0 +1 @@ +package.properties=It works! http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/util/Bar.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/util/Bar.properties b/core/src/test/resources/com/opensymphony/xwork2/util/Bar.properties new file mode 100644 index 0000000..c60d3e9 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/util/Bar.properties @@ -0,0 +1,2 @@ +title=Title: +invalid.fieldvalue.title=Title is invalid! http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/util/Cat-conversion.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/util/Cat-conversion.properties b/core/src/test/resources/com/opensymphony/xwork2/util/Cat-conversion.properties new file mode 100644 index 0000000..7a9efb6 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/util/Cat-conversion.properties @@ -0,0 +1,2 @@ +Collection_kittens = com.opensymphony.xwork2.util.Cat +foo.number = com.opensymphony.xwork2.conversion.impl.FooNumberConverter http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/util/FindMe.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/util/FindMe.properties b/core/src/test/resources/com/opensymphony/xwork2/util/FindMe.properties new file mode 100644 index 0000000..8ee6614 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/util/FindMe.properties @@ -0,0 +1,2 @@ +bean.name=Haha you cant FindMe! +bean2.name=Okay! You found Me! http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/util/Foo-conversion.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/util/Foo-conversion.properties b/core/src/test/resources/com/opensymphony/xwork2/util/Foo-conversion.properties new file mode 100644 index 0000000..09b79ac --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/util/Foo-conversion.properties @@ -0,0 +1,11 @@ +bar=com.opensymphony.xwork2.conversion.impl.FooBarConverter +Element_cats=com.opensymphony.xwork2.util.Cat +Element_moreCats=com.opensymphony.xwork2.util.Cat +Element_catMap=com.opensymphony.xwork2.util.Cat +Key_anotherCatMap=java.lang.Long +Element_anotherCatMap=com.opensymphony.xwork2.util.Cat +KeyProperty_barCollection=id +Element_barCollection=com.opensymphony.xwork2.util.Bar +KeyProperty_barList=id +Element_barList=com.opensymphony.xwork2.util.Bar + http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/util/ListHolder-conversion.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/util/ListHolder-conversion.properties b/core/src/test/resources/com/opensymphony/xwork2/util/ListHolder-conversion.properties new file mode 100644 index 0000000..e7d6839 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/util/ListHolder-conversion.properties @@ -0,0 +1,3 @@ +Element_longs = java.lang.Long +Element_strings = java.lang.String +Element_dates = java.util.Date http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/util/LocalizedTextUtilTest.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/util/LocalizedTextUtilTest.properties b/core/src/test/resources/com/opensymphony/xwork2/util/LocalizedTextUtilTest.properties new file mode 100644 index 0000000..5bde086 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/util/LocalizedTextUtilTest.properties @@ -0,0 +1,3 @@ +test.format.date={0,date,short} +xw377=xw377 +username=Santa http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/util/MyBeanAction-conversion.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/util/MyBeanAction-conversion.properties b/core/src/test/resources/com/opensymphony/xwork2/util/MyBeanAction-conversion.properties new file mode 100644 index 0000000..b8d68d6 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/util/MyBeanAction-conversion.properties @@ -0,0 +1,8 @@ +KeyProperty_beanList=id +Element_beanList=com.opensymphony.xwork2.util.MyBean +CreateIfNull_beanList=true + +Key_beanMap=java.lang.Long +KeyProperty_beanMap=id +Element_beanMap=com.opensymphony.xwork2.util.MyBean + http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/util/Tiger-conversion.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/util/Tiger-conversion.properties b/core/src/test/resources/com/opensymphony/xwork2/util/Tiger-conversion.properties new file mode 100644 index 0000000..ebe7be1 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/util/Tiger-conversion.properties @@ -0,0 +1 @@ +Collection_dogs = com.opensymphony.xwork2.util.Dog http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/util/XW404_de.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/util/XW404_de.properties b/core/src/test/resources/com/opensymphony/xwork2/util/XW404_de.properties new file mode 100644 index 0000000..b1f6327 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/util/XW404_de.properties @@ -0,0 +1,3 @@ +# Do not create a default bundle, XW404 tests a condition where there are no default bundle + +hello=Hallo http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/util/XW404_fr.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/util/XW404_fr.properties b/core/src/test/resources/com/opensymphony/xwork2/util/XW404_fr.properties new file mode 100644 index 0000000..a1766b3 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/util/XW404_fr.properties @@ -0,0 +1,3 @@ +# Do not create a default bundle, XW404 tests a condition where there are no default bundle + +hello=Bonjour http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/util/location/xml-with-location.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/util/location/xml-with-location.xml b/core/src/test/resources/com/opensymphony/xwork2/util/location/xml-with-location.xml new file mode 100644 index 0000000..3e709c8 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/util/location/xml-with-location.xml @@ -0,0 +1,8 @@ +<foo xmlns:loc="http://struts.apache.org/xwork/location" + loc:src="foo.xml" + loc:line="1" + loc:column="1"> + <bar loc:src="foo.xml" + loc:line="5" + loc:column="6" /> +</foo> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/CompositeTextProviderTestResourceBundle1.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/CompositeTextProviderTestResourceBundle1.properties b/core/src/test/resources/com/opensymphony/xwork2/validator/CompositeTextProviderTestResourceBundle1.properties new file mode 100644 index 0000000..f365a4a --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/CompositeTextProviderTestResourceBundle1.properties @@ -0,0 +1,10 @@ +# common in both CompositeTextProviderTestResourceBundle1.properties +# and CompositeTextProviderTestResourceBunlde2.properties +name=1 name +age=1 age +goodnight=1 good night {0} +goodmorning=1 good morning {0} and {1} + +# specific to CompositeTextProviderTestResourceBundle1.properties +car=This is a car +bike=This is a bike http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/CompositeTextProviderTestResourceBundle2.properties ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/CompositeTextProviderTestResourceBundle2.properties b/core/src/test/resources/com/opensymphony/xwork2/validator/CompositeTextProviderTestResourceBundle2.properties new file mode 100644 index 0000000..d030485 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/CompositeTextProviderTestResourceBundle2.properties @@ -0,0 +1,11 @@ +# common in both CompositeTextProviderTestResourceBundle1.properties +# and CompositeTextProviderTestResourceBunlde2.properties +name=2 name +age=2 age +goodnight=2 good night {0} +goodmorning=2 good morning {0} and {1} + + +# specific to CompositeTextProviderTestResourceBundle2.properties +cat=This is a cat +dog=This is a dog http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorModelAction-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorModelAction-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorModelAction-validation.xml new file mode 100644 index 0000000..2b4d8f7 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorModelAction-validation.xml @@ -0,0 +1,9 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd"> +<validators> + <field name="model"> + <field-validator type="visitor"> + <param name="appendPrefix">false</param> + <message>model: </message> + </field-validator> + </field> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-beanMessageBundle-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-beanMessageBundle-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-beanMessageBundle-validation.xml new file mode 100644 index 0000000..69380c6 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-beanMessageBundle-validation.xml @@ -0,0 +1,8 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd"> +<validators> + <field name="bean"> + <field-validator type="visitor"> + <message>bean: </message> + </field-validator> + </field> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validateArray-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validateArray-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validateArray-validation.xml new file mode 100644 index 0000000..be4d34c --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validateArray-validation.xml @@ -0,0 +1,8 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd"> +<validators> + <field name="testBeanArray"> + <field-validator type="visitor"> + <message>testBeanArray: </message> + </field-validator> + </field> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validateList-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validateList-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validateList-validation.xml new file mode 100644 index 0000000..f83f101 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validateList-validation.xml @@ -0,0 +1,8 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd"> +<validators> + <field name="testBeanList"> + <field-validator type="visitor"> + <message>testBeanList: </message> + </field-validator> + </field> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validation.xml new file mode 100644 index 0000000..03dfc5b --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-validation.xml @@ -0,0 +1,8 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd"> +<validators> + <field name="context"> + <field-validator type="requiredstring"> + <message>You must enter a context.</message> + </field-validator> + </field> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-visitorChildValidation-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-visitorChildValidation-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-visitorChildValidation-validation.xml new file mode 100644 index 0000000..69380c6 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-visitorChildValidation-validation.xml @@ -0,0 +1,8 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd"> +<validators> + <field name="bean"> + <field-validator type="visitor"> + <message>bean: </message> + </field-validator> + </field> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-visitorValidation-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-visitorValidation-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-visitorValidation-validation.xml new file mode 100644 index 0000000..69380c6 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-visitorValidation-validation.xml @@ -0,0 +1,8 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd"> +<validators> + <field name="bean"> + <field-validator type="visitor"> + <message>bean: </message> + </field-validator> + </field> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-visitorValidationAlias-validation.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-visitorValidationAlias-validation.xml b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-visitorValidationAlias-validation.xml new file mode 100644 index 0000000..c9fc4f7 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/VisitorValidatorTestAction-visitorValidationAlias-validation.xml @@ -0,0 +1,9 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd"> +<validators> + <field name="bean"> + <field-validator type="visitor"> + <param name="context">anotherContext</param> + <message>bean: </message> + </field-validator> + </field> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test.xml b/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test.xml new file mode 100644 index 0000000..9302f2f --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test.xml @@ -0,0 +1,33 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd"> +<validators> + <field name="foo"> + <field-validator type="required"> + <message key="test.key">You must enter a value for foo.</message> + </field-validator> + </field> + <field name="bar"> + <field-validator type="required" short-circuit="true"> + <message key="bar.key">You must enter a value for bar.</message> + </field-validator> + <field-validator type="int"> + <param name="min">6</param> + <param name="max">10</param> + <message>bar must be between ${min} and ${max}, current value is ${bar}.</message> + </field-validator> + <field-validator type="regex"> + <param name="expression"> + <!-- Some useless comment for the following expression, which should be ignored by parser --> + <![CDATA[([aAbBcCdD][123][eEfFgG][456])]]> + </param> + <message>bar must must match the given expression.</message> + </field-validator> + </field> + <validator type="expression"> + <param name="expression">email.equals(email2)</param> + <message>Email not the same as email2</message> + </validator> + <validator type="expression" short-circuit="true"> + <param name="expression">email.startsWith('mark')</param> + <message>Email does not start with mark</message> + </validator> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test2.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test2.xml b/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test2.xml new file mode 100644 index 0000000..cf7798a --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test2.xml @@ -0,0 +1,17 @@ +<!DOCTYPE validators PUBLIC + "-//Apache Struts//XWork Validator 1.0.2//EN" + "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd"> + +<validators> + <field name="myField"> + <field-validator type="required"> + <message>a field error message</message> + </field-validator> + </field> + <validator type="expression"> + <param name="expression"><![CDATA[false]]></param> + <message>an expression error message</message> + </validator> +</validators> + + http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test3.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test3.xml b/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test3.xml new file mode 100644 index 0000000..b09037b --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test3.xml @@ -0,0 +1,11 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd"> +<validators> + <validator type="expression" bar="die"> + <param name="expression">email.equals(email2)</param> + <message>Email not the same as email2</message> + </validator> + <validator type="expression" short-circuit="true"> + <param name="expression">email.startsWith('mark')</param> + <message>Email does not start with mark</message> + </validator> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test4.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test4.xml b/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test4.xml new file mode 100644 index 0000000..379f216 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test4.xml @@ -0,0 +1,12 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd"> + +<validators> + <validator type="expression"> + <param name="expression">email.equals(email2)</param> + <message>Email not the same as email2</message> + </validator> + <validator type="expression" short-circuit="true"> + <param name="expression">email.startsWith('mark')</param> + <message>Email does not start with mark</message> + </validator> +/validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test5.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test5.xml b/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test5.xml new file mode 100644 index 0000000..3f4bbb6 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test5.xml @@ -0,0 +1,4 @@ +<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd"> +<validators> + <validator name="foo" class="bar" /> +</validators> http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test6.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test6.xml b/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test6.xml new file mode 100644 index 0000000..1ecd594 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/validator-parser-test6.xml @@ -0,0 +1,27 @@ +<!DOCTYPE validators PUBLIC + "-//Apache Struts//XWork Validator 1.0.3//EN" + "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd"> + +<validators> + <field name="name"> + <field-validator type="requiredstring"> + <message key="error.name">default message 1</message> + </field-validator> + </field> + <field name="address"> + <field-validator type="requiredstring"> + <param name="trim">true</param> + <param name="anotherParam">anotherValue</param> + <message key="error.address"> ddddd + <param name="1">'tmjee'</param> + <param name="2">'phil'</param> + <param name="10">'jimmy'</param> + <param name="6">'hopkins'</param> + <param name="defaultMessage">The Default Message</param> + <param name="someNonsenseKey">Some Nonesense Value</param> + <param name="3">'rainer'</param> + </message> + </field-validator> + </field> +</validators> + http://git-wip-us.apache.org/repos/asf/struts/blob/82cb1286/core/src/test/resources/com/opensymphony/xwork2/validator/validators-fail.xml ---------------------------------------------------------------------- diff --git a/core/src/test/resources/com/opensymphony/xwork2/validator/validators-fail.xml b/core/src/test/resources/com/opensymphony/xwork2/validator/validators-fail.xml new file mode 100644 index 0000000..890a4a1 --- /dev/null +++ b/core/src/test/resources/com/opensymphony/xwork2/validator/validators-fail.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE validators PUBLIC + "-//Apache Struts//XWork Validator Config 1.0//EN" + "http://struts.apache.org/dtds/xwork-validator-config-1.0.dtd"> +<!-- START SNIPPET: validators-default --> +<validators> + <validator name="required" class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/> + <validator nameFail="requiredstring" class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/> + <validator name="int" class="com.opensymphony.xwork2.validator.validators.IntRangeFieldValidator"/> + <validator name="double" class="com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator"/> + <validator name="date" class="com.opensymphony.xwork2.validator.validators.DateRangeFieldValidator"/> + <validator name="expression" class="com.opensymphony.xwork2.validator.validators.ExpressionValidator"/> + <validator name="fieldexpression" class="com.opensymphony.xwork2.validator.validators.FieldExpressionValidator"/> + <validator name="email" class="com.opensymphony.xwork2.validator.validators.EmailValidator"/> + <validator name="url" class="com.opensymphony.xwork2.validator.validators.URLValidator"/> + <validator name="visitor" class="com.opensymphony.xwork2.validator.validators.VisitorFieldValidator"/> + <validator name="conversion" class="com.opensymphony.xwork2.validator.validators.ConversionErrorFieldValidator"/> + <validator name="stringlength" class="com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator"/> + <validator name="regex" class="com.opensymphony.xwork2.validator.validators.RegexFieldValidator"/> +</validators> +<!-- END SNIPPET: validators-default -->
