Package org.apache.wicket.util.tester

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


  public void fixedIdFromJavaForLabelOverridesIdFromMarkup()
  {
    WicketTester tester = new WicketTester();

    ComponentMarkupIdTestPage page = new ComponentMarkupIdTestPage();
    tester.startPage(page);
    tester.assertRenderedPage(ComponentMarkupIdTestPage.class);

    Assert.assertEquals("javaLabel", page.fixedLabel.getMarkupId());
  }
View Full Code Here


  public void fixedIdFromJavaForPanelOverridesIdFromMarkup()
  {
    WicketTester tester = new WicketTester();

    ComponentMarkupIdTestPage page = new ComponentMarkupIdTestPage();
    tester.startPage(page);
    tester.assertRenderedPage(ComponentMarkupIdTestPage.class);

    Assert.assertEquals("javaPanel", page.fixedPanel.getMarkupId());
  }
}
View Full Code Here

  public void testHeaderContribution()
  {
    WicketTester tester = new WicketTester();

    HeaderContributorTestPage page = new HeaderContributorTestPage();
    tester.startPage(page);

    Assert.assertTrue("component", page.component.get());
    Assert.assertTrue("behavior", page.behavior.get());
    Assert.assertTrue("callDecorator", page.callDecorator.get());
  }
View Full Code Here

  {
    WicketTester tester = createTester();

    try
    {
      tester.startPage(LOGIN);
      tester.assertRenderedPage(LOGIN);
      FormTester form = tester.newFormTester("signInPanel:signInForm");
      form.setValue("username", "test");
      form.setValue("password", "test");
      form.submit();
View Full Code Here

    {
      LoginPage page = new LoginPage();
      assertFalse(page.isPageInitialized());
      assertFalse(page.isPanelInitialized());

      tester.startPage(LOGIN);
      tester.assertRenderedPage(LOGIN);
      page = (LoginPage)tester.getLastRenderedPage();
      assertTrue(page.isPageInitialized());
      assertTrue(page.isPanelInitialized());
     
View Full Code Here

   */
  public void test() throws Exception
  {
    WicketTester tester = new WicketTester();

    StringArrayPage page = tester.startPage(StringArrayPage.class);

    tester.submitForm("form");

    assertNotNull(page.array);
    assertEquals(0, page.array.length);
View Full Code Here

        ajaxLazyLoadPanel = ajaxLazyLoadPanel1;
        return (Panel)ajaxLazyLoadPanel;
      }

    });
    wt.startPage(dummyPanelPage);
    wt.assertLabel("panel:content",
      "<img alt=\"Loading...\" src=\"resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/indicator.gif\"/>");
    AjaxLazyLoadPanelTester.executeAjaxLazyLoadPanel(wt, dummyPanelPage);
    wt.debugComponentTrees();
    wt.assertLabel("panel:content", "lazy panel test");
View Full Code Here

   * @throws Exception
   */
  public void test_1() throws Exception
  {
    WicketTester tester = new WicketTester(new RepeaterApplication());
    tester.startPage(DataTablePage.class);
    tester.assertRenderedPage(DataTablePage.class);

    String document = tester.getServletResponse().getDocument();
    int index = document.indexOf("<thead");
    assertTrue("Expected at least on <thead>", index != -1);
View Full Code Here

    };

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

  }

  public void testConfiguration()
  {
    WicketTester tester = new WicketTester();
    tester.startPage(TestPage.class);
    TestPage page = (TestPage)tester.getLastRenderedPage();

    // 1st render
    assertEquals(0, page.getT1().getRequestCount()); // cleaned up by detach
    assertEquals(0, page.getT2().getRequestCount()); // cleaned up by detach
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.