You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Thibault Kruse (JIRA)" <ji...@apache.org> on 2014/08/06 18:33:12 UTC

[jira] [Commented] (WICKET-5666) WicketTester "page was null" for reused stateless Form

    [ https://issues.apache.org/jira/browse/WICKET-5666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14087871#comment-14087871 ] 

Thibault Kruse commented on WICKET-5666:
----------------------------------------

See here: https://github.com/tkruse/wicket-5666
Running the test testSubmitSecondPageFails() fails with the exception as described.

Maybe the symptom could be reproduced with even less code, but I need to get back to work.

> WicketTester "page was null" for reused stateless Form
> ------------------------------------------------------
>
>                 Key: WICKET-5666
>                 URL: https://issues.apache.org/jira/browse/WICKET-5666
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.16.0
>         Environment: Ubuntu, Java7
>            Reporter: Thibault Kruse
>
> Hi, so this is a weird bug, took ages to find out how to reproduce.
> Basically we have a page with a form that calls setResponsePage in onSubmit().
> Then we write a test for it that uses WicketTester.assertRenderedPage()
> And under specific circumstances, we get back an AssertionError
> {code}
> junit.framework.AssertionFailedError: page was null
> 	at org.apache.wicket.util.tester.WicketTester.assertResult(WicketTester.java:566)
> 	at org.apache.wicket.util.tester.WicketTester.assertRenderedPage(WicketTester.java:476)
> 	at com.example.TestHomePage.testSubmitSecondPageFails(TestHomePage.java:37)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> 	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> 	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
> 	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
> 	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
> 	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
> {code}
> which does not make sense. We also found that modifying our example slightly would make the assertion work again, such as not clearing Page Params. Will provide link to quickstart project example.



--
This message was sent by Atlassian JIRA
(v6.2#6252)