[ 
https://issues.apache.org/struts/browse/WW-1868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Don Brown resolved WW-1868.
---------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.8
         Assignee: Don Brown

I modified xwork to throw a more helpful error message if it detects the object 
factory to be null.  You should only need to add 
"ObjectFactory.setObjectFactory(new ObjectFactory())" to your setup() method if 
you don't want to extend StrutsTestCase.  The error message says as much.  

> Struts 2 validation testing fails because ObjectFactory is null
> ---------------------------------------------------------------
>
>                 Key: WW-1868
>                 URL: https://issues.apache.org/struts/browse/WW-1868
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.0.6
>            Reporter: Rich Thornett
>         Assigned To: Don Brown
>             Fix For: 2.0.8
>
>         Attachments: TestValidation.patch
>
>
> Recenly upgraded from Struts 2.0.1 to Struts 2.0.6 and my unit tests of 
> Struts2 validation now fail.  Unit tests followed the pattern described here:
> http://struts.apache.org/2.x/docs/how-do-i-unit-test-my-actions-validation-logic.html
> The issue has been noticed by others and is described in more detail here:
> http://www.nabble.com/Struts-2-and-Validation-Testing-t3451623.html
> Core problem seems to be that ObjectFactory is not getting set by the time it 
> is referenced in
> ValidatorFileParser.parseValidatorDefinitions()  // xwork-2.0.1

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to