Package org.apache.wicket.request.mapper.parameter

Examples of org.apache.wicket.request.mapper.parameter.PageParameters


   *
   */
  @Test
  public void decodeParam_simpleParam_noQuestionMark()
  {
    final PageParameters params = new PageParameters();
    RequestUtils.decodeParameters("key=value", params, UTF_8_CHARSET);
    assertEquals("value", params.get("key").toString());
  }
View Full Code Here


   *
   */
  @Test
  public void decodeParam_simpleParamWithoutValueAndAnotherParam_NoQuestionMark()
  {
    final PageParameters params = new PageParameters();
    RequestUtils.decodeParameters("123&key=value", params, UTF_8_CHARSET);
    assertEquals("", params.get("123").toString());
    assertEquals("value", params.get("key").toString());
  }
View Full Code Here

   *
   */
  @Test
  public void decodeParam_simpleParamWithoutValue_NoQuestionMark()
  {
    final PageParameters params = new PageParameters();
    RequestUtils.decodeParameters("123", params, UTF_8_CHARSET);
    assertEquals("", params.get("123").toString());
  }
View Full Code Here

  /**
   * Construct.
   */
  public MockFormFileUploadPage()
  {
    this(new PageParameters().set("required", "true"));
  }
View Full Code Here

   * Test page without throwing abort.
   */
  @Test
  public void testNoAbort()
  {
    tester.startPage(AbortExceptionPage.class, new PageParameters().set("trigger", false));
    Assert.assertEquals(1234, tester.getLastResponse().getStatus());
  }
View Full Code Here

  @Test
  public void testAbort()
  {
    try
    {
      tester.startPage(AbortExceptionPage.class, new PageParameters().set("trigger", true));
      Assert.assertEquals(1234, tester.getLastResponse().getStatus()); // this will
      // fail
    }
    catch (RuntimeException x)
    {
View Full Code Here

      new QueryStringWithVersionResourceCachingStrategy(versionParameter, resourceVersion);

  @Test
  public void testDecorateUrl() throws Exception
  {
    ResourceUrl resourceUrl = new ResourceUrl("some-resource.txt", new PageParameters());
    strategy.decorateUrl(resourceUrl, new TestResource());

    assertEquals("some-resource.txt", resourceUrl.getFileName());
    assertEquals(TEST_RESOURCE_VERSION, resourceUrl.getParameters().get(versionParameter).toString());
  }
View Full Code Here

  }

  @Test
  public void testUndecorateUrl() throws Exception
  {
    PageParameters urlParameters = new PageParameters();
    urlParameters.add(versionParameter, TEST_RESOURCE_VERSION, INamedParameters.Type.QUERY_STRING);
    ResourceUrl resourceUrl = new ResourceUrl("some-resource.txt", urlParameters);
    strategy.undecorateUrl(resourceUrl);

    assertEquals("some-resource.txt", resourceUrl.getFileName());
    assertNull(resourceUrl.getParameters().get(versionParameter).toString());
View Full Code Here

    WicketTester tester = new WicketTester();
    tester.getApplication().getResourceSettings().setCachingStrategy(strategy);

    try
    {
      PageParameters urlParameters = new PageParameters();
      urlParameters.add(versionParameter, "9A0364B9E99BB480DD25E1F0284C8555", INamedParameters.Type.QUERY_STRING);
      ResourceUrl resourceUrl = new ResourceUrl("some-resource.txt", urlParameters);
      strategy.undecorateUrl(resourceUrl);

      String version = tester.getRequestCycle().getMetaData(IResourceCachingStrategy.URL_VERSION);
View Full Code Here

      new FilenameWithVersionResourceCachingStrategy(versionPrefix, resourceVersion);

  @Test
  public void testDecorateUrl() throws Exception
  {
    ResourceUrl resourceUrl = new ResourceUrl("some-resource.txt", new PageParameters());
    strategy.decorateUrl(resourceUrl, new TestResource());

    assertEquals("some-resource--vers--"+TEST_RESOURCE_VERSION+".txt", resourceUrl.getFileName());

    // don't issue an error
    resourceUrl = new ResourceUrl("some-resource--vers--with-prefix.txt", new PageParameters());
    strategy.decorateUrl(resourceUrl, new TestResource());

    assertEquals("some-resource--vers--with-prefix--vers--"+TEST_RESOURCE_VERSION+".txt", resourceUrl.getFileName());
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.mapper.parameter.PageParameters

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.