Package org.apache.wicket.util.tester

Examples of org.apache.wicket.util.tester.WicketTester.startPage()


    };

    WicketTester tester = new WicketTester(application);
    try
    {
      tester.startPage(new CustomRequestPage());
    }
    finally
    {
      tester.destroy();
    }
View Full Code Here


   */
  public void testReCreateTheForm()
  {
    WicketTester tester = new WicketTester();
    UploadFormWithProgressBarTestPage testPage = null;
    tester.startPage(UploadFormWithProgressBarTestPage.class);
    testPage = (UploadFormWithProgressBarTestPage)tester.getLastRenderedPage();
    int oldFormInstanceId = testPage.form.getFormInstance();
    tester.clickLink("re-create");
    testPage = (UploadFormWithProgressBarTestPage)tester.getLastRenderedPage();
    assertNotSame(oldFormInstanceId, testPage.form.getFormInstance());
View Full Code Here

  public void showsInternalErrorPage()
  {

    WicketTester tester = new WicketTester();
    tester.setExposeExceptions(false);
    tester.startPage(InternalErrorCallsAjaxOnFailurePage.class);

    tester.clickLink("failure-link", true);

    // the response before current should holds the error page markup
    MockHttpServletResponse errorPageResponse = tester.getLastResponse();
View Full Code Here

   */
  private <T extends Page> void executeCombinedTest(final Class<T> pageClass,
    final String filename) throws Exception
  {
    WicketTester tester = new WicketTester();
    tester.startPage(pageClass);
    tester.assertRenderedPage(pageClass);
    tester.assertResultPage(getClass(), filename + "_2");
    System.setProperty("Wicket_HeaderRenderStrategy", "");
  }

View Full Code Here

          AjaxErrorStrategy.INVOKE_FAILURE_HANDLER);
      }

    });
    tester.setExposeExceptions(false);
    tester.startPage(InternalErrorCallsAjaxOnFailurePage.class);

    tester.clickLink("failure-link", true);

    MockHttpServletResponse errorPageResponse = tester.getLastResponse();
    assertEquals(500, errorPageResponse.getStatus());
View Full Code Here

    final String filename) throws Exception
  {
    // Default Config: parent first header render strategy
    log.error("=== PARENT first header render strategy ===");
    WicketTester tester = new WicketTester();
    tester.startPage(pageClass);
    tester.assertRenderedPage(pageClass);
    tester.assertResultPage(getClass(), filename);

    // child first header render strategy
    log.error("=== CHILD first header render strategy ===");
View Full Code Here

    // child first header render strategy
    log.error("=== CHILD first header render strategy ===");
    System.setProperty("Wicket_HeaderRenderStrategy",
      ChildFirstHeaderRenderStrategy.class.getName());
    tester = new WicketTester();
    tester.startPage(pageClass);
    tester.assertRenderedPage(pageClass);
    tester.assertResultPage(getClass(), filename + "_2");
    System.setProperty("Wicket_HeaderRenderStrategy", "");
  }
}
View Full Code Here

    WicketTester tester = new WicketTester();

    for (Locale locale : EXPECTED_LOCALIZATIONS.keySet())
    {
      tester.getSession().setLocale(locale);
      tester.startPage(PageWithXmlProperties.class);
    }
  }
}
View Full Code Here

   */
  @Test
  public void wicket1382()
  {
    WicketTester tester = new WicketTester();
    AjaxyImagesPage page = (AjaxyImagesPage)tester.startPage(AjaxyImagesPage.class);

    TagTester tagTester = tester.getTagById(page.image.getMarkupId());
    final String srcAttr = tagTester.getAttribute("src");
    assertFalse(
      "Image has not be rendered in Ajax request so it has no wicket:antiCache' parameter",
View Full Code Here

    WicketTester tester = new WicketTester();
    tester.getApplication()
      .getSecuritySettings()
      .setAuthorizationStrategy(
        new RoleAuthorizationStrategy(new UserRolesAuthorizer("ADMIN")));
    tester.startPage(AdminPage.class);
    tester.assertRenderedPage(AdminPage.class);
  }

  /**
   * @throws Exception
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.