You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Roger Ball (JIRA)" <ji...@apache.org> on 2010/02/15 17:03:28 UTC

[jira] Commented: (WICKET-1292) WicketTester continueToOriginalDestination() uses application home page instead of original redictor

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

Roger Ball commented on WICKET-1292:
------------------------------------

I have been trying to implement the workaround you mention in this ticket. I have not been successful. I am not clear where the following code (from the comment in WICKET-1292) would go in the test case java files included in WICKET - 1292?

from ticket:

Workaround by Maurice Marrink:

// continueToOriginaldestination does not work if there is no url available, so we need to fake one here(testing only hack)

mock.setupRequestAndResponse();
WebRequestCycle cycle = mock.createRequestCycle();
String url1 = cycle.urlFor(new BookmarkablePageRequestTarget(YOUR_PAGE_HERE.class, null)).toString();

mock.getServletRequest().setURL("/GeneralTest$1/GeneralTest$1/" + url1);
mock.processRequestCycle();

---
mock is the WicketTester.
GeneralTest$1 from the url is the classname of your application without the package. (in my case it is an anonymous inner class hence the $1) Note that this classname appears twice in the url.

> WicketTester continueToOriginalDestination() uses application home page instead of original redictor
> ----------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1292
>                 URL: https://issues.apache.org/jira/browse/WICKET-1292
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-final
>            Reporter: Lauri Piispanen
>            Assignee: Maurice Marrink
>            Priority: Minor
>             Fix For: 1.3.4, 1.4-M2
>
>         Attachments: HomePage.html, HomePage.java, InterceptPage.html, InterceptPage.java, InterceptPageTestCase.java, MyApplication.java, TargetPage.html, TargetPage.java
>
>
> WicketTester continues to application home page when continueToOriginalDestination() is called, instead of the expected original destination. Attached is a test case to reproduce the issue. In servlet environment continueToOriginalDestination() works correctly.
> ---
> Workaround by Maurice Marrink:
> // continueToOriginaldestination does not work if there is no url available, so we need to fake one here(testing only hack)
> mock.setupRequestAndResponse();
> WebRequestCycle cycle = mock.createRequestCycle();
> String url1 = cycle.urlFor(new BookmarkablePageRequestTarget(YOUR_PAGE_HERE.class, null)).toString();
> mock.getServletRequest().setURL("/GeneralTest$1/GeneralTest$1/" + url1);
> mock.processRequestCycle();
> ---
> mock is the WicketTester.
> GeneralTest$1 from the url is the classname of your application without the package. (in my case it is an anonymous inner class hence the $1) Note that this classname appears twice in the url. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.