You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Meier (Jira)" <ji...@apache.org> on 2020/11/28 20:40:00 UTC

[jira] [Comment Edited] (WICKET-6856) WicketTester fails do startComponentInPage() after session invalidation

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

Sven Meier edited comment on WICKET-6856 at 11/28/20, 8:39 PM:
---------------------------------------------------------------

Actually the new behavior is correct:

When you invalidate the session, all session data and pages are removed at the end of the request.

This had no effect for testcases before 8.11.0, since MockPageManager does not care about session invalidation.
Now Session#invalidateNow() calls getPageManager().clear() - to prevent pending pages from being stored after session invalidation. Thus your page is no longer available after redirect to render.


was (Author: svenmeier):
Many thanks, it was to be expected that WICKET-6848 would break something else.

I'll take a look.

> WicketTester fails do startComponentInPage() after session invalidation
> -----------------------------------------------------------------------
>
>                 Key: WICKET-6856
>                 URL: https://issues.apache.org/jira/browse/WICKET-6856
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 8.11.0
>            Reporter: Ilia Naryzhny
>            Assignee: Sven Meier
>            Priority: Minor
>
> Probably issue WICKET-6848 introduced the following issue. If there is a code which does session invalidation first and then starts testing of a component: the last one will fail with something like org.apache.wicket.protocol.http.PageExpiredException: Page with id '0' has expired.
> Simple example:
> {code:java}
> tester.getSession().invalidate();
> tester.startComponentInPage(new AnyPanel("panel"));
> {code}
> But, at the same time starting pages (by class or instance) do not have this negative side effect.
> P.S. Doing `invalidateNow()` will help to solve this particular case, but in our case exactly invalidate() invoked as part of signout - so not a part of actual test case code.
> P.P.S Wicket 8.10.0 didn't have this problem,



--
This message was sent by Atlassian Jira
(v8.3.4#803005)