Package org.apache.wicket.util.tester

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


    PaletteTestPage testPage = new PaletteTestPage(selected, all);

    tester.startPage(testPage);

    FormTester formTester = tester.newFormTester(testPage.form.getId());
    formTester.submit();

    Collection<String> collection = testPage.palette.getModelCollection();

    assertEquals(0, collection.size());
  }
View Full Code Here


    PaletteTestPage testPage = new PaletteTestPage(selected, all);

    tester.startPage(testPage);

    FormTester formTester = tester.newFormTester(testPage.form.getId());
    formTester.submit();

    Collection<String> collection = testPage.palette.getModelCollection();

    assertEquals(1, collection.size());
    assertEquals("D", collection.iterator().next());
View Full Code Here

  @Test
  public void postOrderSequenceSubmittingRootForm()
  {
    tester.startPage(TestPage.class);
    TestPage testPage = (TestPage)tester.getLastRenderedPage();
    FormTester formTester = tester.newFormTester("outerForm");
    formTester.submit("outerSubmit");
    assertEquals(3, testPage.submitSequence.size());
    assertEquals(0, testPage.submitSequence.indexOf(testPage.outerSubmit));
    assertEquals(1, testPage.submitSequence.indexOf(testPage.innerForm));
    assertEquals(2, testPage.submitSequence.indexOf(testPage.outerForm));
  }
View Full Code Here

  @Test
  public void postOrderSequenceSubmittingInnerForm()
  {
    tester.startPage(TestPage.class);
    TestPage testPage = (TestPage)tester.getLastRenderedPage();
    FormTester formTester = tester.newFormTester("outerForm");
    formTester.submit("innerForm:innerSubmit");
    assertEquals(2, testPage.submitSequence.size());
    assertEquals(0, testPage.submitSequence.indexOf(testPage.innerSubmit));
    assertEquals(1, testPage.submitSequence.indexOf(testPage.innerForm));
  }
View Full Code Here

  @Test
  public void allFormsEnabledSubmitOuterForm()
  {
    assertEnabledState(true, true, true);

    FormTester formTester = tester.newFormTester("outerForm");
    formTester.submit("submit");

    assertOnSubmitCalled(true, true, true);
    assertOnErrorCalled(false, false, false);
  }
View Full Code Here

  @Test
  public void allFormsEnabledSubmitMiddleForm()
  {
    assertEnabledState(true, true, true);

    FormTester formTester = tester.newFormTester("outerForm:middleForm");
    formTester.submit("submit");

    assertOnSubmitCalled(false, true, true);
    assertOnErrorCalled(false, false, false);
  }
View Full Code Here

  @Test
  public void allFormsEnabledSubmitInnerForm()
  {
    assertEnabledState(true, true, true);

    FormTester formTester = tester.newFormTester("outerForm:middleForm:innerForm");
    formTester.submit("submit");

    assertOnSubmitCalled(false, false, true);
    assertOnErrorCalled(false, false, false);
  }
View Full Code Here

    // disable middle form
    middleForm.setEnabled(false);
    assertEnabledState(true, false, true);

    // submit outer form
    FormTester formTester = tester.newFormTester("outerForm");
    formTester.submit("submit");

    assertOnSubmitCalled(true, false, false);
    assertOnErrorCalled(false, false, false);
  }
View Full Code Here

    // disable middle form
    innerForm.setEnabled(false);
    assertEnabledState(true, true, false);

    // submit outer form
    FormTester formTester = tester.newFormTester("outerForm");
    formTester.submit("submit");

    assertOnSubmitCalled(true, true, false);
    assertOnErrorCalled(false, false, false);
  }
View Full Code Here

  public void submitDisabledOuterForm()
  {
    outerForm.setEnabled(false);
    assertEnabledState(false, true, true);

    FormTester formTester = tester.newFormTester("outerForm");
    try
    {
      formTester.submit("submit");
      fail("Executing the listener on disabled component is not allowed.");
    }
    catch (ListenerInvocationNotAllowedException expected)
    {
      ;
View Full Code Here

TOP

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

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.