You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rich Thornett <ri...@thornett.com> on 2007/04/02 21:21:48 UTC
Re: Struts 2 and Validation Testing
I'm seeing the same issue folks have described below. BTW, the validation
testing described in:
http://struts.apache.org/2.x/docs/how-do-i-unit-test-my-actions-validation-logic.html
did work, at least in Struts 2.0.1. I've entered the following jira issue
on the matter:
https://issues.apache.org/struts/browse/WW-1868
Hopefully it will be addressed soon.
k hall wrote:
>
> I really like Struts 2 but has anyone had any success in testing Struts
> 2's action validation logic?
>
> http://struts.apache.org/2.x/docs/how-do-i-unit-test-my-actions-validation-logic.html
>
> I'd like to test the validation messages I receive but get an exception
> where the objectFactory is null. I've tried with putting in my own
> validators.xml, but it gets hung up on the ObjectFactory and I really
> can't figure out how to correct that from a Unit Test.
>
> Any ideas to fix this Struts 2 gurus?
>
> Thanks.
>
>
--
View this message in context: http://www.nabble.com/Struts-2-and-Validation-Testing-tf3451623.html#a9797200
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Struts 2 and Validation Testing
Posted by Thomas Ferris Nicolaisen <tf...@gmail.com>.
I made a test that ran successfully when extending StrutsTestCase.
Attached the test to the Jira issue. As a result of extending
StrutsTestCase, I encountered a new bug in the spring-plugin, but
that's another story.
I still would like some dev to comment on whether there is an actual
requirement for our tests to extend StrutsTestCase like this. I would
like to avoid it as several of my tests already extend various Spring
utility test classes. If it is a requirement the spring-plugin should
be extended to support the StrutsTestCase.
On 4/6/07, Rich Thornett <ri...@thornett.com> wrote:
>
> Tried extending XWorkTestCase in a sample test, but sgot the same error. I'm
> extending MockObjectTestCase anyway, so inheritance wouldn't be the best
> solution for me.
>
> Doesn't look like there's been any traction on this issue in Jira yet:
> https://issues.apache.org/struts/browse/WW-1868
>
>
> qmnonic wrote:
> >
> >
> > I experienced the same problem in a test case (though different
> > circumstances), and it was solved by extending XWorkTestCase instead of
> > TestCase as noted in the example -
> > http://struts.apache.org/2.x/docs/how-do-i-unit-test-my-actions-validation-logic.html
> > . This might help...
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Struts-2-and-Validation-Testing-tf3451623.html#a9872429
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Struts 2 and Validation Testing
Posted by Rich Thornett <ri...@thornett.com>.
Tried extending XWorkTestCase in a sample test, but sgot the same error. I'm
extending MockObjectTestCase anyway, so inheritance wouldn't be the best
solution for me.
Doesn't look like there's been any traction on this issue in Jira yet:
https://issues.apache.org/struts/browse/WW-1868
qmnonic wrote:
>
>
> I experienced the same problem in a test case (though different
> circumstances), and it was solved by extending XWorkTestCase instead of
> TestCase as noted in the example -
> http://struts.apache.org/2.x/docs/how-do-i-unit-test-my-actions-validation-logic.html
> . This might help...
>
>
>
--
View this message in context: http://www.nabble.com/Struts-2-and-Validation-Testing-tf3451623.html#a9872429
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Struts 2 and Validation Testing
Posted by qmnonic <ma...@gmail.com>.
I experienced the same problem in a test case (though different
circumstances), and it was solved by extending XWorkTestCase instead of
TestCase as noted in the example -
http://struts.apache.org/2.x/docs/how-do-i-unit-test-my-actions-validation-logic.html
. This might help...
--
View this message in context: http://www.nabble.com/Struts-2-and-Validation-Testing-tf3451623.html#a9845287
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org