Package org.apache.wicket

Examples of org.apache.wicket.MockPage


   *
   */
  @Test
  public void encodeNamedPageParameters()
  {
    MockPage page = new MockPage(15);
    page.setBookmarkable(true);
    page.setCreatedBookmarkable(true);
    page.setPageStateless(true);

    IPageProvider provider = new PageProvider(page);
    page.getPageParameters().set("foo", "fooValue");
    page.getPageParameters().set("bar", "barValue");
    IRequestHandler handler = new RenderPageRequestHandler(provider);

    Url url = namedParametersEncoder.mapHandler(handler);

    assertEquals(MOUNT_PATH + "/fooValue/barValue/" + PAGE_CLASS_NAME, url.toString());
View Full Code Here


   * https://issues.apache.org/jira/browse/WICKET-3941
   */
  @Test
  public void encodeAlias()
  {
    MockPage page = new MockPage(15);
    page.setBookmarkable(true);
    page.setCreatedBookmarkable(true);
    page.setPageStateless(true);

    IPageProvider provider = new PageProvider(page);
    IRequestHandler handler = new RenderPageRequestHandler(provider);

    Url url = aliasEncoder.mapHandler(handler);
View Full Code Here

   *
   */
  @Test
  public void encode4()
  {
    MockPage page = new MockPage(15);
    page.getPageParameters().set(0, "i1");
    page.getPageParameters().set(1, "i2");
    page.getPageParameters().set("a", "b");
    page.getPageParameters().set("b", "c");
    page.setCreatedBookmarkable(true);

    IPageProvider provider = new PageProvider(page);
    IRequestHandler handler = new RenderPageRequestHandler(provider);
    Url url = encoder.mapHandler(handler);

View Full Code Here

   *
   */
  @Test
  public void encode5()
  {
    MockPage page = new MockPage(15);
    page.getPageParameters().set(0, "i1");
    page.getPageParameters().set(1, "i2");
    page.getPageParameters().set("a", "b");
    page.getPageParameters().set("b", "c");

    page.setCreatedBookmarkable(false);

    IPageProvider provider = new PageProvider(page);
    IRequestHandler handler = new RenderPageRequestHandler(provider);
    Url url = encoder.mapHandler(handler);

View Full Code Here

   *
   */
  @Test
  public void encode6()
  {
    MockPage page = new MockPage(15);
    page.getPageParameters().set(0, "i1");
    page.getPageParameters().set(1, "i2");
    page.getPageParameters().set("a", "b");
    page.getPageParameters().set("b", "c");
    page.setRenderCount(4);

    // shouldn't make any difference for
    // BookmarkableListenerInterfaceRequestHandler,
    // as this explicitely says the url must be bookmarkable
    page.setCreatedBookmarkable(false);

    IRequestableComponent c = page.get("foo:bar");

    PageAndComponentProvider provider = new PageAndComponentProvider(page, c);
    IRequestHandler handler = new BookmarkableListenerInterfaceRequestHandler(provider,
      ILinkListener.INTERFACE);

View Full Code Here

   * of BookmarkableListenerInterfaceRequestHandler
   */
  @Test
  public void encode6_1()
  {
    MockPage page = new MockPage(15);
    page.getPageParameters().set(0, "i1");
    page.getPageParameters().set(1, "i2");
    page.getPageParameters().set("a", "b");
    page.getPageParameters().set("b", "c");

    // WICKET-4038
    page.getPageParameters().add(WebRequest.PARAM_AJAX, "true");
    page.getPageParameters().add(WebRequest.PARAM_AJAX_BASE_URL, "some/base/url");

    page.setRenderCount(4);

    // shouldn't make any difference for ListenerInterfaceRequestHandler,
    // as this explicitely says the url must be bookmarkable
    page.setCreatedBookmarkable(false);

    IRequestableComponent c = page.get("foo:bar");

    PageAndComponentProvider provider = new PageAndComponentProvider(page, c);
    IRequestHandler handler = new ListenerInterfaceRequestHandler(provider,
      ILinkListener.INTERFACE);

View Full Code Here

   *
   */
  @Test
  public void encode7()
  {
    MockPage page = new MockPage(15);
    page.getPageParameters().set(0, "i1");
    page.getPageParameters().set(1, "i2");
    page.getPageParameters().set("a", "b");
    page.getPageParameters().set("b", "c");
    page.setRenderCount(5);

    // shouldn't make any difference for
    // BookmarkableListenerInterfaceRequestHandler,
    // as this explicitely says the url must be bookmarkable
    page.setCreatedBookmarkable(false);

    IRequestableComponent c = page.get("foo:bar");

    PageAndComponentProvider provider = new PageAndComponentProvider(page, c);
    IRequestHandler handler = new BookmarkableListenerInterfaceRequestHandler(provider,
      ILinkListener.INTERFACE, 4);

View Full Code Here

   * of BookmarkableListenerInterfaceRequestHandler
   */
  @Test
  public void encode7_1()
  {
    MockPage page = new MockPage(15);
    page.getPageParameters().set(0, "i1");
    page.getPageParameters().set(1, "i2");
    page.getPageParameters().set("a", "b");
    page.getPageParameters().set("b", "c");
    page.setRenderCount(5);

    // shouldn't make any difference for ListenerInterfaceRequestHandler,
    // as this explicitely says the url must be bookmarkable
    page.setCreatedBookmarkable(false);

    IRequestableComponent c = page.get("foo:bar");

    PageAndComponentProvider provider = new PageAndComponentProvider(page, c);
    IRequestHandler handler = new ListenerInterfaceRequestHandler(provider,
      ILinkListener.INTERFACE, 4);

View Full Code Here

   *
   */
  @Test
  public void encode8()
  {
    MockPage page = new MockPage(15);
    page.setBookmarkable(true);
    page.setCreatedBookmarkable(true);
    page.setPageStateless(true);

    IPageProvider provider = new PageProvider(page);
    IRequestHandler handler = new RenderPageRequestHandler(provider);

    Url url = encoder.mapHandler(handler);
View Full Code Here

   * WICKET-5247 page instantiated without required parameters won't be mapped
   */
  @Test
  public void placeholderEncode4()
  {
    PageProvider provider = new PageProvider(new MockPage())
    {
      @Override
      public boolean isNewPageInstance()
      {
        return false;
View Full Code Here

TOP

Related Classes of org.apache.wicket.MockPage

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.