public void testProcessValidators() throws Exception {

    result = false;
    ajaxForm.setSubmitted(true);
    child.setSubmittedValue(new String("test0"));
    ajaxForm.processValidators(facesContext);
    assertTrue(result);
  }
  // TODO processUpdates test
  public void testProcessUpdates() throws Exception {

    facesContext.getExternalContext().getRequestParameterMap().put("form", "form");
    child.setSubmittedValue(new String("test1"));
    ajaxForm.processDecodes(facesContext);
    ajaxForm.processValidators(facesContext);
    ajaxForm.processUpdates(facesContext);
  }
  public void testProcessDecodes() throws Exception {

    facesContext.getExternalContext().getRequestParameterMap().put("form", "form");
    ajaxForm.processDecodes(facesContext);
    assertEquals(1, childInvoked);
    // test
  }
  public void testBroadcast() throws Exception {

    AjaxEvent event = new AjaxEvent(ajaxForm);
    try {
      ajaxForm.broadcast(event);
    } catch (Exception e) {
      fail();
    }
  }
  public void setUp() throws Exception {

    super.setUp();
    ajaxForm = (UIAjaxForm) application.createComponent(UIAjaxForm.COMPONENT_TYPE);
    ajaxForm.setId("form");

    child =
        new UIInput() {
          public void processDecodes(FacesContext context) {
            childInvoked++;
            super.processDecodes(context);
          }
        };
    child.setId("input");
    child.getAttributes().put("onchange", "return true;");
    child.addValidator(new TestAjaxFormValidator());
    childInvoked = 0;
    child.setId("child");
    ajaxForm.getChildren().add(child);
    facesContext.getViewRoot().getChildren().add(ajaxForm);
  }