I'm not sure whether you are Maven user but if you are then create a
new quickstart project
(http://wicket.apache.org/start/quickstart.html), put your files in it
and attach the zipped application to a ticket in our Jira.

To run the test in your zip I'll have to create the application
myself, copy your files in it, ...
It is not that much but I prefer to do it with your help.

On Wed, Sep 21, 2011 at 2:43 PM, Gert-Jan Schouten
<gert-jan.schou...@roboreus.com> wrote:
> How is the zip incomplete? It's a unit-test, so it does not run standalone.
> It requires either wicket-1.4.15 or wicket-1.4.18 to be on the classpath.
> wicket.apache.org/help says: "We can help you much quicker if you provide us
> with a JUnit test case that demonstrates your issue. e.g. if you think
> you’ve found a bug, can you create a test case to demonstrate the bug?" So,
> that's what I did.
>
> Also there is no "error". It's just an assertion that fails in one case and
> succeeds in the other. I've done some further investigation and it appears
> that MockHttpServletResponse.redirectLocation has the correct value with
> 1.4.15, but has null with 1.4.18.
>
> It appears that MockHttpServletResponse.initialize() is run only once with
> 1.4.15, but is run TWICE with 1.4.18, thereby setting redirectLocation to
> null again.
>
> I appreciate the help and if you have any other requirements for my unit
> test, please let me know.
>
> Cheers,
>
>
> Gert-Jan Schouten
> Java Developer
>
> Roboreus
> 1 New Oxford Street
> London WC1a 1NU
> T: +44 (0) 7832916802
> E: gert-jan.schou...@roboreus.com
> Skype: gert.jan.schouten
>
> On 21/09/11 12:17, Martin Grigorov wrote:
>
> Check what is the redirect url and what you expect. I guess it is a
> matter of single character.
> Your .zip is incomplete and I'll have to spend my time to finish it
> and debug it.
>
> At least paste the error.
>
> On Wed, Sep 21, 2011 at 12:25 PM, Gert-Jan Schouten
> <gert-jan.schou...@roboreus.com> wrote:
>
> Hello all!
>
> As I haven't received a single response yet, even though I created a unit
> test that fails after upgrading to a new version, which seems serious to me,
> I would like to ask you again:
>
> This week we upgraded to Wicket 1.4.18 from 1.4.15 and suddenly, our unit
> tests started failing. It seems that it is caused by the fact that redirect
> behave differently. I have attached a unit test that demostrates this. It
> passes with 1.4.15, but fails with 1.4.18. To spare you the effort of
> unpacking the zip, here's the test class (Note: Page1 is a simple WebPage
> that redirects to Page2 in it's onInitialize(), all classes are in the zip):
>
> package com.roboreus.geosweep.wicket;
>
> import org.apache.wicket.PageParameters;
> import org.apache.wicket.RequestCycle;
> import org.apache.wicket.util.tester.WicketTester;
> import org.junit.Test;
>
> import static junit.framework.Assert.assertTrue;
>
> public class RedirectTest {
>
>     @Test
>     public void testRedirect() throws Exception {
>
>         WicketTester tester = new WicketTester();
>         tester.startPage(Page1.class);
>
>         assertTrue("Redirect expected",
> tester.getServletResponse().isRedirect());
>         String redirectLocation =
> tester.getServletResponse().getRedirectLocation();
>         assertTrue("Expected redirect location",
> !(redirectLocation.isEmpty()));
>
>         String redirectUrl = RequestCycle.get().urlFor(Page2.class, new
> PageParameters()).toString();
>         assertTrue("Expected redirect to '" + redirectUrl + "', but instead
> got one to '" + redirectLocation + "'.",
>                    redirectLocation.contains(redirectUrl));
>     }
> }
>
> Do any of you know the cause of this and how to solve it?
>
> Thanks and regards!
>
> Gert-Jan Schouten
>
>
> --
>
> Gert-Jan Schouten
> Java Developer
>
> Roboreus
> 1 New Oxford Street
> London WC1a 1NU
> T: +44 (0) 7832916802
> E: gert-jan.schou...@roboreus.com
> Skype: gert.jan.schouten
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to