You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Dane Laverty <da...@gmail.com> on 2010/01/15 23:17:28 UTC
Finding output from WicketTester
A while back I added basic WicketTester rendering tests for each of my
pages. They have been great for discovering problems, but not so great for
telling me what those problems are. My tests are of the most basic kind:
tester.startPage(MyPage.*class*);
tester.assertRenderedPage(MyPage.*class*);
When a test fails, though, the only feedback I get is:
junit.framework.AssertionFailedError: expected:<MyPage> but was:<ErrorPage>
[stack trace follows]
I understand that MyPage threw an exception, resulting in ErrorPage at the
assert step. What I don't know is how I can get the error that was thrown. I
tried removing my RequestCycle's onRuntimeException(), but then I just get
an equally useless stack trace that tells me:
...at
edu.chemeketa.foodhandler.webapp.TestMyPage.testRenderMyPage(TestMyPage.java:58)
I know that WicketTester is great, so I'm assuming that the problem is on my
end. Is there a simple way of printing out the exceptions that occur during
a WicketTester test run?
thanks,
Dane
Re: Finding output from WicketTester
Posted by Igor Vaynberg <ig...@gmail.com>.
the exception is spit out into the log
-igor
On Fri, Jan 15, 2010 at 2:17 PM, Dane Laverty <da...@gmail.com> wrote:
> A while back I added basic WicketTester rendering tests for each of my
> pages. They have been great for discovering problems, but not so great for
> telling me what those problems are. My tests are of the most basic kind:
>
>
>
> tester.startPage(MyPage.*class*);
>
> tester.assertRenderedPage(MyPage.*class*);
>
>
> When a test fails, though, the only feedback I get is:
>
>
> junit.framework.AssertionFailedError: expected:<MyPage> but was:<ErrorPage>
> [stack trace follows]
>
> I understand that MyPage threw an exception, resulting in ErrorPage at the
> assert step. What I don't know is how I can get the error that was thrown. I
> tried removing my RequestCycle's onRuntimeException(), but then I just get
> an equally useless stack trace that tells me:
>
>
> ...at
> edu.chemeketa.foodhandler.webapp.TestMyPage.testRenderMyPage(TestMyPage.java:58)
>
>
> I know that WicketTester is great, so I'm assuming that the problem is on my
> end. Is there a simple way of printing out the exceptions that occur during
> a WicketTester test run?
>
>
> thanks,
>
>
> Dane
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org