Hi,

Thanks I can now unit test my xml validation files but with one problem. My
action class implements ModelDriven so I need to add "model." before all
ognl-expression and remove it again after the tests!

Is there any solutions to that?

Regards
Gunnar


Martin Gilday wrote:
> 
> 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Is-it-possible-to-unit-test-validatiors-in-xml--tf3703030.html#a10393478
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to