Package org.apache.wicket.util.tester

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


   * @throws Exception
   */
  public void testHelloWorld() throws Exception
  {
    WicketTester tester = new WicketTester(new RepeaterApplication());
    tester.startPage(Index.class);
    tester.assertContains("Wicket Examples - repeater views");

    checkPage(tester, RepeatingPage.class);
    checkPage(tester, RefreshingPage.class);
    checkPage(tester, FormPage.class);
View Full Code Here


   * @throws Exception
   */
  public void testPagedTable() throws Exception
  {
    WicketTester application = new WicketTester();
    application.startPage(PagedTablePage.class);
    PagedTablePage page = (PagedTablePage)application.getLastRenderedPage();
    String document = application.getServletResponse().getDocument();
    assertTrue(validatePage1(document));

    Link link = (Link)page.get("navigation:1:pageLink");
View Full Code Here

    WicketTester tester = new WicketTester(Page1.class);
    tester.setupRequestAndResponse();
// tester.getServletRequest()
// .setURL("?wicket:bookmarkablePage=:" + Page1.class.getName() + "");
// tester.processRequestCycle();
    tester.startPage(Page1.class);
    tester.assertRenderedPage(Page3.class);
    tester.destroy();
  }

  /** first page, redirects to page 2. */
 
View Full Code Here

   */
  @Test
  public void wicket3563()
  {
    WicketTester tester = new WicketTester();
    tester.startPage(TestPage.class);

    tester.assertContains("<form id=\"form1_region\" style=\"display:none\">");
  }

  /**
 
View Full Code Here

   * testConfiguration()
   */
  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

   * @throws Exception
   */
  public void testComponentAttributesNotDoubleEscaped() throws Exception
  {
    WicketTester tester = new WicketTester();
    tester.startPage(ButtonValuePage.class);
    String response = tester.getLastResponseAsString();
    System.out.println(response);
    assertTrue("One of the pound entity representations is missing: &pound; or &#163;",
      response.contains("££"));
    assertTrue("must not be double escaped", response.contains("Watch escaped value: &gt;&gt;"));
View Full Code Here

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

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

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

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

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

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

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

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

    Assert.assertEquals("generatedLabel1", page.generatedLabelMarkupId);
    Assert.assertEquals("generatedLabel1", page.generatedLabel.getMarkupId());
  }
View Full Code Here

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

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

    Assert.assertEquals("generatedPanel2", page.generatedPanelMarkupId);
    Assert.assertEquals("generatedPanel2", page.generatedPanel.getMarkupId());
  }
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.