Package org.apache.wicket.request

Examples of org.apache.wicket.request.UrlRenderer


   *
   */
  @Test
  public void test6()
  {
    UrlRenderer r1 = new UrlRenderer(new MockWebRequest(Url.parse("url/")));
    assertEquals("./x?1", r1.renderUrl(Url.parse("url/x?1")));
  }
View Full Code Here


   *
   */
  @Test
  public void test7()
  {
    UrlRenderer r1 = new UrlRenderer(new MockWebRequest(
      Url.parse("MyTestPage/indexed1/indexed2/indexed3?10-27.ILinkListener-l2&p1=v1")));
    assertEquals("../../../MyTestPage?10", r1.renderUrl(Url.parse("MyTestPage?10")));
  }
View Full Code Here

   *
   */
  @Test
  public void test8()
  {
    UrlRenderer r1 = new UrlRenderer(new MockWebRequest(
      Url.parse("en/first-test-page?16-1.ILinkListener-l1")));
    assertEquals("./first-test-page/indexed1/indexed2/indexed3?p1=v1",
      r1.renderUrl(Url.parse("en/first-test-page/indexed1/indexed2/indexed3?p1=v1")));
  }
View Full Code Here

   *
   */
  @Test
  public void test9()
  {
    UrlRenderer r1 = new UrlRenderer(new MockWebRequest(Url.parse("a/b/q/d/e")));
    assertEquals("../../../q/c/d/e", r1.renderUrl(Url.parse("a/q/c/d/e")));
  }
View Full Code Here

  public void test10()
  {
    MockWebRequest request = new MockWebRequest(Url.parse("a/b/q/d/e"), "/contextPath",
      "/filterPath", "../");

    UrlRenderer r = new UrlRenderer(request);
    assertEquals("../../../../../", r.renderContextRelativeUrl(""));
    assertEquals("../../../../../", r.renderContextRelativeUrl("/"));
    assertEquals("../../../../../f", r.renderContextRelativeUrl("/f"));
    assertEquals("../../../../../../f", r.renderContextRelativeUrl("../f"));

    try
    {
      r.renderContextRelativeUrl(null);
      fail("Null 'url' is not allowed!");
    }
    catch (IllegalArgumentException iax)
    {
      assertTrue(true);
View Full Code Here

   * <a href="https://issues.apache.org/jira/browse/WICKET-3337">WICKET-3337</a>
   */
  @Test
  public void test11()
  {
    UrlRenderer r1 = new UrlRenderer(new MockWebRequest(Url.parse("a")));
    assertEquals(".", r1.renderUrl(Url.parse("")));
  }
View Full Code Here

   * <a href="https://issues.apache.org/jira/browse/WICKET-3567">WICKET-3567</a>
   */
  @Test
  public void test12()
  {
    UrlRenderer r1 = new UrlRenderer(new MockWebRequest(Url.parse("?0")));
    assertEquals("./", r1.renderUrl(Url.parse("")));
  }
View Full Code Here

   * '../' works better.
   */
  @Test
  public void test13()
  {
    UrlRenderer r1 = new UrlRenderer(new MockWebRequest(Url.parse("foo/bar")));
    assertEquals("../", r1.renderUrl(Url.parse("")));
  }
View Full Code Here

   * WICKET-4920 prevent double slash
   */
  @Test
  public void test14()
  {
    UrlRenderer r1 = new UrlRenderer(new MockWebRequest(new Url()));

    assertEquals(
      "./;jsessionid=1p87c5424zjuvd57kljcu2bwa?0-1.IBehaviorListener.1-component",
      r1.renderRelativeUrl(Url.parse("http://localhost:8080/;jsessionid=1p87c5424zjuvd57kljcu2bwa?0-1.IBehaviorListener.1-component")));
  }
View Full Code Here

   * WICKET-4935 prevent another double slash
   */
  @Test
  public void test15()
  {
    UrlRenderer r1 = new UrlRenderer(new MockWebRequest(Url.parse("private/AdminPage")));

    assertEquals("../signIn;jsessionid=16k3wqa9c4sgq1cnp7fisa20u",
      r1.renderRelativeUrl(Url.parse("/signIn;jsessionid=16k3wqa9c4sgq1cnp7fisa20u")));
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.UrlRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.