Package org.apache.wicket

Examples of org.apache.wicket.MockPage


   *
   */
  @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");

    // 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

   *
   */
  @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");

    // 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

   *
   */
  @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

  @Override
  public void maxSizeDifferentSessions()
  {
    String sessionId2 = "0987654321";

    pageStore.storePage(sessionId, new MockPage(pageId));

    assertNotNull(pageStore.getPage(sessionId, pageId));

    pageStore.storePage(sessionId2, new MockPage(pageId));

    assertNotNull(pageStore.getPage(sessionId, pageId));
    assertNotNull(pageStore.getPage(sessionId2, pageId));
  }
View Full Code Here

   * Assert that a stored page is available to be read
   */
  @Test
  public void storePage()
  {
    pageStore.storePage(sessionId, new MockPage(pageId));

    assertNotNull(pageStore.getPage(sessionId, pageId));
  }
View Full Code Here

  {
    int maxEntries = 10;

    pageStore = createPageStore(serializer, dataStore, maxEntries);

    pageStore.storePage(sessionId, new MockPage(pageId));
    pageStore.storePage(sessionId, new MockPage(pageId));

    assertNotNull(pageStore.getPage(sessionId, pageId));

    pageStore.removePage(sessionId, pageId);
View Full Code Here

  }

  @Test
  public void removePage()
  {
    pageStore.storePage(sessionId, new MockPage(pageId));

    assertNotNull(pageStore.getPage(sessionId, pageId));

    pageStore.removePage(sessionId, pageId);
View Full Code Here

   * Verify that at most {@code maxEntries} per session can be put in the cache
   */
  @Test
  public void maxSizeSameSession()
  {
    pageStore.storePage(sessionId, new MockPage(pageId));

    assertNotNull(pageStore.getPage(sessionId, pageId));

    int pageId2 = 234;
    pageStore.storePage(sessionId, new MockPage(pageId2));
    assertNull(pageStore.getPage(sessionId, pageId));
    assertNotNull(pageStore.getPage(sessionId, pageId2));
  }
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.