You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "daniel H." <da...@gmail.com> on 2007/07/16 20:41:22 UTC
Re: Struts 2 and Validation Testing
Thanks.
I did get the same error with Struts 2.0.6 and Junit 4.0. After adding the
statement of ObjectFactory in setUpBeforeClass, it works.
Daniel H.
Ben Morgan wrote:
>
>
> k hall wrote:
>>
>> I really like Struts 2 but has anyone had any success in testing Struts
>> 2's action validation logic?
>>
>
> I also really like Struts2 and have been suffering the same irritation
> with testing validation logic.
>
> Having spent a while stepping through the code, it appears that the
> problem stems from the fact that there isn't a configured object factory
> for the test, which results in a NullPointerException. I've solved this
> using the following code :
>
> ObjectFactory.setObjectFactory( new ObjectFactory() );
>
> Hope this helps.
>
> Ben
>
--
View this message in context: http://www.nabble.com/Struts-2-and-Validation-Testing-tf3451623.html#a11628613
Sent from the Struts - User mailing list archive at Nabble.com.