http://wiki.opensymphony.com/display/WW/Testing+Validation describes how
to do it for WebWork.  The process should be very similar for Struts 2.

Thanks,
Martin.


----- Original message -----
From: [EMAIL PROTECTED]
To: user@struts.apache.org
Date: Mon, 7 May 2007 12:52:40 +0200
Subject: Is it possible to unit test validatiors in xml?

Hi,

Is it possible to unit test validations created in xml? I.e. like this:

<validators>
   <!-- Plain Validator Syntax -->
        <validator type="stringlength">
                <param name="fieldName">myPurchaseCode</param>
                <param name="minLength">10</param>
            <param name="maxLength">10</param>
            <param name="trim">true</param>
            <message>Your purchase code needs to be 10 characters
long</message>          
      </validator>
   <!-- Field Validator Syntax -->
        <field name="myPurchaseCode">
                <param name="minLength">10</param>
            <param name="maxLength>10</param>
            <param name="trim">true</param>
            <message>Your purchase code needs to be 10 characters
long</message>
        </field-name>
</validators>

Regards
Gunnar



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to