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

[jira] [Resolved] (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:all-tabpanel ]

Martin Grigorov resolved WICKET-5666.
-------------------------------------

    Resolution: Implemented

And the winner is:

0c79489b9c70a5d442b42fdb61b0384fa66065e4 is the first bad commit
commit 0c79489b9c70a5d442b42fdb61b0384fa66065e4
Author: andrea del bene <ad...@apache.org>
Date:   Wed Jul 16 19:29:28 2014 +0200

    WICKET-5643 storeBufferedResponse should check if session is temporary.
    
    added a check for session id and some JavaDoc


> 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)