Package org.apache.wicket.util.tester

Examples of org.apache.wicket.util.tester.FormTester$ChoiceSelector$SearchOptionByIndexVisitor


    tester.startPage(HomePage.class);

    // assert rendered page class
    tester.assertRenderedPage(HomePage.class);

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

    tester.assertErrorMessages("Name is required");
  }
View Full Code Here


   */
  @Test
  public void interfaceValidator()
  {
    tester.startPage(new ValidatorLoaderPage(new InterfaceValidator()));
    FormTester formTester = tester.newFormTester("form");
    formTester.setValue("passwd", "anything");
    formTester.submit();

    tester.assertErrorMessages("Interface error loaded OK");
  }
View Full Code Here

   */
  @Test
  public void classValidator()
  {
    tester.startPage(new ValidatorLoaderPage(new ClassValidator()));
    FormTester formTester = tester.newFormTester("form");
    formTester.setValue("passwd", "anything");
    formTester.submit();

    tester.assertErrorMessages("Class error loaded OK");
  }
View Full Code Here

 
  @Test
  public void formValidator()
  {
    tester.startPage(new FormValidatorPage());
    FormTester formTester = tester.newFormTester("form");
    formTester.setValue("field1", "value1");
    formTester.setValue("field2", "value2");
    formTester.submit();
    tester.assertErrorMessages("Form Validator loaded OK");
  }
View Full Code Here

  {
    TestPage testPage = new TestPage();
    testPage.textField.setType(String.class);
    testPage.textField.setConvertEmptyInputStringToNull(true);
    tester.startPage(testPage);
    FormTester formTester = tester.newFormTester(testPage.form.getId());
    formTester.setValue(testPage.textField.getId(), "");
    formTester.submit();
    assertEquals(null, testPage.textField.getDefaultModelObject());
  }
View Full Code Here

    TestPage testPage = new TestPage();
    testPage.textField.setType(String.class);
    testPage.textField.setRequired(false);
    testPage.textField.add(StringValidator.minimumLength(2));
    tester.startPage(testPage);
    FormTester formTester = tester.newFormTester(testPage.form.getId());
    formTester.setValue(testPage.textField.getId(), "");
    formTester.submit();
    assertEquals(null, testPage.textField.getDefaultModelObject());
    assertTrue(testPage.textField.isValid());
  }
View Full Code Here

    executePage(new EnclosurePage_9(), "EnclosurePageExpectedResult_9.html");
    EnclosurePage_9 page = (EnclosurePage_9)tester.getLastRenderedPage();

    page.reset();
    FormTester formTester = tester.newFormTester("form");
    tester.getRequest()
      .getPostParameters()
      .setParameterValue(((CheckBox)page.get("form:input")).getInputName(), "true");
    page.get("form:label").setVisible(true);
    formTester.submit();
    tester.assertRenderedPage(clazz);
    assertResultPage("EnclosurePageExpectedResult_9-4.html");
    assertTrue(page.inputOnBeforeRender);
    assertTrue(page.inputValidate);
    assertTrue(page.labelOnBeforeRender);
View Full Code Here

    File tmp = null;
    try
    {
      tmp = FileUploadFieldTest.writeTestFile(1);
      FormTester formtester = tester.newFormTester("form");
      formtester.setFile("upload", tmp, "text/plain");
      formtester.submit();

      TestPage page = (TestPage)tester.getLastRenderedPage();
      assertNotNull(page.testFile);
    }
    finally
View Full Code Here

    FormPage page = (FormPage)tester.getLastRenderedPage();

    Assert.assertFalse(page.isSubmitLinkSubmitted());
    Assert.assertFalse(page.isFormSubmitted());

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

    page = (FormPage)tester.getLastRenderedPage();

    Assert.assertTrue(page.isFormSubmitted());
    Assert.assertFalse(page.isSubmitLinkSubmitted());
View Full Code Here

    FormPage page = (FormPage)tester.getLastRenderedPage();

    Assert.assertFalse(page.isSubmitLinkSubmitted());
    Assert.assertFalse(page.isFormSubmitted());

    FormTester formTester = tester.newFormTester("form");
    formTester.submitLink("link", true);

    page = (FormPage)tester.getLastRenderedPage();

    Assert.assertTrue(page.isFormSubmitted());
    Assert.assertTrue(page.isSubmitLinkSubmitted());
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.tester.FormTester$ChoiceSelector$SearchOptionByIndexVisitor

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.