Package org.apache.wicket.util.tester

Examples of org.apache.wicket.util.tester.WicketTester


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


  private <T extends Page> void executeCombinedTestPre1_5(final Class<T> pageClass,
    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 ===");
    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

   */
  @Override
  protected void setUp() throws Exception
  {
    application = new RedirectApplication();
    tester = new WicketTester(application);
    tester.startPage(RedirectHomePage.class);
    tester.assertRenderedPage(RedirectHomePage.class);
  }
View Full Code Here

   */
  @Test
  public void wicket2035()
  {

    WicketTester tester = new WicketTester();

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

  private WicketTester tester;

  @Override
  public void setUp()
  {
    tester = new WicketTester();
  }
View Full Code Here

  /** */
  @Before
  public void setup()
  {
    tester = new WicketTester(new TestApplication());

    application = (TestApplication)tester.getApplication();

    session = (TestSession)tester.getSession();
    cycle = (TestRequestCycle)tester.getRequestCycle();
View Full Code Here

   */
  @Test
  public void defaultHomePage()
  {
    final WebApplication dummyApplication = new DummyApplication();
    final WicketTester tester = new WicketTester(dummyApplication);

    requestHomePage(tester);

    tester.assertRenderedPage(dummyApplication.getHomePage());
  }
View Full Code Here

        // the following two lines do identical things
        // getRootRequestMapperAsCompound().add(new HomePageMapper(CustomHomePage.class));
        mountPage("/", CustomHomePage.class);
      }
    };
    final WicketTester tester = new WicketTester(dummyApplication);

    requestHomePage(tester);

    tester.assertRenderedPage(CustomHomePage.class);
  }
View Full Code Here

  private WicketTester tester;

  @Before
  public void setUp() throws Exception
  {
    tester = new WicketTester();
  }
View Full Code Here

   * attribute value
   */
  @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",
      srcAttr.contains("wicket:antiCache"));

    // make an ajax call
    tester.clickLink("link", true);
    page = (AjaxyImagesPage)tester.getLastRenderedPage();
    tagTester = tester.getTagById(page.image.getMarkupId());
    final String imageAjaxComponent = tagTester.getValue();
    assertTrue(
      "Image has not be rendered in Ajax request so it has no wicket:antiCache' parameter",
      imageAjaxComponent.contains("wicket:antiCache"));
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.tester.WicketTester

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.