I'm looking for a way of unit testing an action that uses annotations for
validation with 2.1.6. 

There is a nice example in the Struts 2.x docs on how to unit test
validation logic in an Action (see here
http://struts.apache.org/2.x/docs/how-do-i-unit-test-my-actions-validation-logic.html)

Unfortunately the ActionValidatorManagerFactory class is only present in
2.0.x as it was removed in 2.1.x so this example is no longer valid.

If you just new up an AnnotationActionValidatorManager you get an NPE and if
you populate the members all the way up (ValidatorFactory,
ValidatorFileParser, ObjectFactory) you get a message saying that you are
unable to load validator class
com.opensymphony.xwork2.validator.validators.RequiredFieldValidator as
specified in the default.xml file in the jar.

I've had a look on the mailing list and can't find anything so does anyone
have any ideas?
-- 
View this message in context: 
http://www.nabble.com/Unit-Testing-Actions-with-Annotation-based-validation-in-Struts-2.1.6-tp25800676p25800676.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to