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 2011/09/13 10:24:09 UTC

[jira] [Resolved] (WICKET-4045) Calling wicketTester.clickLink(...) on a StatelessLink causes "PageExpiredException" with Wicket 1.5.0

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

Martin Grigorov resolved WICKET-4045.
-------------------------------------

    Resolution: Duplicate

The fix for this problem is in WICKET-3991.
Current trunk works OK with the provided quickstart.

> Calling wicketTester.clickLink(...) on a StatelessLink causes "PageExpiredException" with Wicket 1.5.0
> ------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4045
>                 URL: https://issues.apache.org/jira/browse/WICKET-4045
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.0
>         Environment: Ubuntu Linux 11.04
> Java 1.7
>            Reporter: Jeff Campbell
>            Assignee: Martin Grigorov
>            Priority: Minor
>         Attachments: myproject.zip
>
>
> When running a JUnit test and I call wicketTester.clickLink(...) on a StatlessLink in a 1.5.0 project, will cause a PageExpiredException, if I change the code back to Wicket 1.4.18 the code does NOT throw any exception and the test works as expected.  This is marked BLOCKER because this bug causes all of our unit tests to fail when we migrate over to Wicket 1.5.0 
> Reproduce
> 1. I created a new Maven archetype project:
> mvn archetype:generate -DarchetypeGroupId=org.apache.wicket -DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.5.0 -DgroupId=com.mycompany -DartifactId=myproject -DarchetypeRepository=https://repository.apache.org/ -DinteractiveMode=false
> 2. Add a link to HomePage.html
> <a wicket:id="clickMeLink" href="#">Click Me</a>
> 3. Add a StatelessLink to HomePage.java
>      add(new StatelessLink("clickMeLink") {
>         @Override
>         public void onClick() {
>           System.out.println("Clicked!!");
>           setResponsePage(OtherPage.class);
>         }
>      });
> 4. Add a blank OtherPage.java and OtherPage.html
> 5. Add a JUnit test:
>   @Test
>   public void homepageRendersSuccessfully() {
>     //start and render the test page
>     tester.startPage(HomePage.class);
>     //assert rendered page class
>     tester.assertRenderedPage(HomePage.class);
>     tester.clickLink("clickMeLink");                         // !!!!! "PageExpiredException" with Wicket 1.5.0
>     tester.assertRenderedPage(OtherPage.class);
>   }
> 6. Run "mvn install"
> Results
> An Test failure occurs with: 
> org.apache.wicket.protocol.http.PageExpiredException: Page expired.
> 	at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:171)
> 	at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.getPage(ListenerInterfaceRequestHandler.java:89)
> 	at org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:149)
> 	at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:719)
> 	at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63)
> 	at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)
> 	at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253)
> 	at org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:596)
> 	at org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:516)
> 	at org.apache.wicket.util.tester.BaseWicketTester.executeListener(BaseWicketTester.java:988)
> 	at org.apache.wicket.util.tester.BaseWicketTester.clickLink(BaseWicketTester.java:1795)
> 	at org.apache.wicket.util.tester.BaseWicketTester.clickLink(BaseWicketTester.java:1677)
> 	at com.mycompany.TestHomePage.homepageRendersSuccessfully(TestHomePage.java:29)
> Expected Results
> No Test failures
> Other Notes:
> If I change the link from "StatelessLink" to "Link" then the Test will succeed (although this is NOT what we want to do... we want our pages to be Stateless)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira