[jira] Commented: (WICKET-702) MockWebApplication doesn't redirect properly to mounted pages under RestartResponseAtInterceptPageException

2007-11-04 Thread Maurice Marrink (JIRA)

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

Maurice Marrink commented on WICKET-702:


En bedankt Johan..
22 failing junit tests
vanwege een nullpointer op regel 534 in MockHttpServletRequest:
RequestCycle.get() leverd null op, want die is al gedetached.
Ik ben nog aan het uitzoeken hoe ik dit kan omzeilen in mn junit tests.

Maurice



 MockWebApplication doesn't redirect  properly to mounted pages under 
 RestartResponseAtInterceptPageException
 

 Key: WICKET-702
 URL: https://issues.apache.org/jira/browse/WICKET-702
 Project: Wicket
  Issue Type: Bug
  Components: wicket
Affects Versions: 1.3.0-beta1
Reporter: Mark Sandori
 Fix For: 1.3.0-rc1

 Attachments: 20070703-WICKET-702.txt, LoginPage.html, LoginPage.java, 
 ProtectedPage.html, ProtectedPage.java, RestartWithMountedPageTest.java


 The MockWebApplication doesn't decode the redirect request properly when 
 redirecting to a mounted page due to a 
 RestartResponseAtInterceptPageException.
 This is the test:
   @Test
 public void testPageRender()
 {
 WicketTest tester = new WicketTester(new MyApplication());
 //must be logged in to get to the Profile page
 tester.startPage(Profile.class);
 //should redirect to the Login page
 tester.assertRenderedPage(Login.class);
 }
 The application mounts pages via:
 mount(/main, PackageName.forPackage(Profile.class.getPackage()));
 Running the test results in this exception:
 org.apache.wicket.WicketRuntimeException: Already redirecting to 
 'main/Login'. Cannot redirect more than once
   at 
 org.apache.wicket.protocol.http.BufferedWebResponse.redirect(BufferedWebResponse.java:100)
   at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:219)
   at 
 org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
   at 
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:981)
   at org.apache.wicket.RequestCycle.step(RequestCycle.java:1048)
   at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1127)
   at org.apache.wicket.RequestCycle.request(RequestCycle.java:489)
   at 
 org.apache.wicket.protocol.http.MockWebApplication.postProcessRequestCycle(MockWebApplication.java:426)
   at 
 org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:372)
   at 
 org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:237)
 What is happening is that the redirect URL main/Login is not getting 
 resolved to a bookmarkable page and the RequestParameters is therefore not 
 setup correctly. Then in WebRequestCycleProcessor.resolve(final RequestCycle 
 requestCycle, final RequestParameters requestParameters) the 
 bookmarkablePageClass of the requestParameters is null and the method 
 resolves to the Home page instead of the page that is intended to redirect 
 to. This causes an attempt to redirect again thereby causing the exception.
 If the mount() is removed then the unit test passes.

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



[jira] Commented: (WICKET-702) MockWebApplication doesn't redirect properly to mounted pages under RestartResponseAtInterceptPageException

2007-11-04 Thread Maurice Marrink (JIRA)

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

Maurice Marrink commented on WICKET-702:


There was indeed a problem with the MHSR in combination with the BWR but johan 
fixed it.

 MockWebApplication doesn't redirect  properly to mounted pages under 
 RestartResponseAtInterceptPageException
 

 Key: WICKET-702
 URL: https://issues.apache.org/jira/browse/WICKET-702
 Project: Wicket
  Issue Type: Bug
  Components: wicket
Affects Versions: 1.3.0-beta1
Reporter: Mark Sandori
 Fix For: 1.3.0-rc1

 Attachments: 20070703-WICKET-702.txt, LoginPage.html, LoginPage.java, 
 ProtectedPage.html, ProtectedPage.java, RestartWithMountedPageTest.java


 The MockWebApplication doesn't decode the redirect request properly when 
 redirecting to a mounted page due to a 
 RestartResponseAtInterceptPageException.
 This is the test:
   @Test
 public void testPageRender()
 {
 WicketTest tester = new WicketTester(new MyApplication());
 //must be logged in to get to the Profile page
 tester.startPage(Profile.class);
 //should redirect to the Login page
 tester.assertRenderedPage(Login.class);
 }
 The application mounts pages via:
 mount(/main, PackageName.forPackage(Profile.class.getPackage()));
 Running the test results in this exception:
 org.apache.wicket.WicketRuntimeException: Already redirecting to 
 'main/Login'. Cannot redirect more than once
   at 
 org.apache.wicket.protocol.http.BufferedWebResponse.redirect(BufferedWebResponse.java:100)
   at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:219)
   at 
 org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
   at 
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:981)
   at org.apache.wicket.RequestCycle.step(RequestCycle.java:1048)
   at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1127)
   at org.apache.wicket.RequestCycle.request(RequestCycle.java:489)
   at 
 org.apache.wicket.protocol.http.MockWebApplication.postProcessRequestCycle(MockWebApplication.java:426)
   at 
 org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:372)
   at 
 org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:237)
 What is happening is that the redirect URL main/Login is not getting 
 resolved to a bookmarkable page and the RequestParameters is therefore not 
 setup correctly. Then in WebRequestCycleProcessor.resolve(final RequestCycle 
 requestCycle, final RequestParameters requestParameters) the 
 bookmarkablePageClass of the requestParameters is null and the method 
 resolves to the Home page instead of the page that is intended to redirect 
 to. This causes an attempt to redirect again thereby causing the exception.
 If the mount() is removed then the unit test passes.

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



[jira] Commented: (WICKET-702) MockWebApplication doesn't redirect properly to mounted pages under RestartResponseAtInterceptPageException

2007-10-03 Thread David Shepherdson (JIRA)

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

David Shepherdson commented on WICKET-702:
--

This issue is still happening with the latest version from the trunk. There 
seems to be something wrong in MockHttpServletRequest's 
setRequestToRedirectString(...) method. When it says:

url = getContextPath() + getServletPath() + / + redirect;

...that actually means the application name is put into the URL *twice*, 
because getServletPath() just returns getContextPath(). It ends up with 
something like '/AppName/AppName/redirectBit'.

Unlike Maurice above, we're seeing this happen when using 
continueToOriginalDestination(...) with a page that happens to be mounted.

Specifically, we tell WicketTester to start with our home page class (which is 
mounted at '/home'). That causes a redirectToInterceptPage(...) to the log-in 
page, with '/AppName' stored as the original destination URL. When the log-in 
page eventually calls continueToOriginalDestination(...), 
MockHttpServletRequest's setRequestToRedirectString(...) is called with 
'../AppName' as the redirect parameter. After passing through the line above, 
this becomes '/AppName/AppName/../AppName', which even after the dot-dots are 
stripped is still '/AppName/AppName'. As I understand it, Wicket then 
determines that, since '/AppName/AppName' isn't the same as '/AppName', it 
needs to redirect to '/AppName/home' (which is where we have the home page 
mounted) -- and at this point, the 'Cannot redirect more than once' exception 
is thrown.

We're going to try changing the line above in our local copy of 
MockHttpServletRequest so that it just uses getContextPath() to see if that 
fixes the problem or breaks anything else; if we have any luck, I'll comment 
here.

 MockWebApplication doesn't redirect  properly to mounted pages under 
 RestartResponseAtInterceptPageException
 

 Key: WICKET-702
 URL: https://issues.apache.org/jira/browse/WICKET-702
 Project: Wicket
  Issue Type: Bug
  Components: wicket
Affects Versions: 1.3.0-beta1
Reporter: Mark Sandori
Assignee: Jean-Baptiste Quenot
 Fix For: 1.3.0-beta4

 Attachments: 20070703-WICKET-702.txt, LoginPage.html, LoginPage.java, 
 ProtectedPage.html, ProtectedPage.java, RestartWithMountedPageTest.java


 The MockWebApplication doesn't decode the redirect request properly when 
 redirecting to a mounted page due to a 
 RestartResponseAtInterceptPageException.
 This is the test:
   @Test
 public void testPageRender()
 {
 WicketTest tester = new WicketTester(new MyApplication());
 //must be logged in to get to the Profile page
 tester.startPage(Profile.class);
 //should redirect to the Login page
 tester.assertRenderedPage(Login.class);
 }
 The application mounts pages via:
 mount(/main, PackageName.forPackage(Profile.class.getPackage()));
 Running the test results in this exception:
 org.apache.wicket.WicketRuntimeException: Already redirecting to 
 'main/Login'. Cannot redirect more than once
   at 
 org.apache.wicket.protocol.http.BufferedWebResponse.redirect(BufferedWebResponse.java:100)
   at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:219)
   at 
 org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
   at 
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:981)
   at org.apache.wicket.RequestCycle.step(RequestCycle.java:1048)
   at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1127)
   at org.apache.wicket.RequestCycle.request(RequestCycle.java:489)
   at 
 org.apache.wicket.protocol.http.MockWebApplication.postProcessRequestCycle(MockWebApplication.java:426)
   at 
 org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:372)
   at 
 org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:237)
 What is happening is that the redirect URL main/Login is not getting 
 resolved to a bookmarkable page and the RequestParameters is therefore not 
 setup correctly. Then in WebRequestCycleProcessor.resolve(final RequestCycle 
 requestCycle, final RequestParameters requestParameters) the 
 bookmarkablePageClass of the requestParameters is null and the method 
 resolves to the Home page instead of the page that is intended to redirect 
 to. This causes an attempt to redirect again thereby causing the exception.
 If the mount() is removed then the unit test passes.

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

[jira] Commented: (WICKET-702) MockWebApplication doesn't redirect properly to mounted pages under RestartResponseAtInterceptPageException

2007-08-23 Thread Maurice Marrink (JIRA)

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

Maurice Marrink commented on WICKET-702:


As submitted to the user list the current resolution breaks the behavior of 
continueToOriginalDestination  when not using mounted urls. Uncomment the code 
in org.apache.wicket.markup.html.form.login.InterceptTest to see it fail.

 MockWebApplication doesn't redirect  properly to mounted pages under 
 RestartResponseAtInterceptPageException
 

 Key: WICKET-702
 URL: https://issues.apache.org/jira/browse/WICKET-702
 Project: Wicket
  Issue Type: Bug
  Components: wicket
Affects Versions: 1.3.0-beta1
Reporter: Mark Sandori
Assignee: Jean-Baptiste Quenot
 Fix For: 1.3.0-beta4

 Attachments: 20070703-WICKET-702.txt, LoginPage.html, LoginPage.java, 
 ProtectedPage.html, ProtectedPage.java, RestartWithMountedPageTest.java


 The MockWebApplication doesn't decode the redirect request properly when 
 redirecting to a mounted page due to a 
 RestartResponseAtInterceptPageException.
 This is the test:
   @Test
 public void testPageRender()
 {
 WicketTest tester = new WicketTester(new MyApplication());
 //must be logged in to get to the Profile page
 tester.startPage(Profile.class);
 //should redirect to the Login page
 tester.assertRenderedPage(Login.class);
 }
 The application mounts pages via:
 mount(/main, PackageName.forPackage(Profile.class.getPackage()));
 Running the test results in this exception:
 org.apache.wicket.WicketRuntimeException: Already redirecting to 
 'main/Login'. Cannot redirect more than once
   at 
 org.apache.wicket.protocol.http.BufferedWebResponse.redirect(BufferedWebResponse.java:100)
   at 
 org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:219)
   at 
 org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
   at 
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:981)
   at org.apache.wicket.RequestCycle.step(RequestCycle.java:1048)
   at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1127)
   at org.apache.wicket.RequestCycle.request(RequestCycle.java:489)
   at 
 org.apache.wicket.protocol.http.MockWebApplication.postProcessRequestCycle(MockWebApplication.java:426)
   at 
 org.apache.wicket.protocol.http.MockWebApplication.processRequestCycle(MockWebApplication.java:372)
   at 
 org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:237)
 What is happening is that the redirect URL main/Login is not getting 
 resolved to a bookmarkable page and the RequestParameters is therefore not 
 setup correctly. Then in WebRequestCycleProcessor.resolve(final RequestCycle 
 requestCycle, final RequestParameters requestParameters) the 
 bookmarkablePageClass of the requestParameters is null and the method 
 resolves to the Home page instead of the page that is intended to redirect 
 to. This causes an attempt to redirect again thereby causing the exception.
 If the mount() is removed then the unit test passes.

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