예제 #1
0
 /* (non-Javadoc)
  * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
  */
 public void setUp() throws Exception {
   super.setUp();
   uiMessages = new MockRichMessages();
   uiMessages.setId(MESSAGES_ID);
   List<UIComponent> children = facesContext.getViewRoot().getChildren();
   children.add(uiMessages);
   HtmlInputText inputText = new HtmlInputText();
   inputText.setId(INPUT_ID);
   children.add(inputText);
 }
  /* (non-Javadoc)
   * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
   */
  public void setUp() throws Exception {
    super.setUp();

    form = new HtmlForm();
    form.setId("form");
    form2 = new HtmlForm();
    form2.setId("form2");
    facesContext.getViewRoot().getChildren().add(form);
    facesContext.getViewRoot().getChildren().add(form2);

    stp1 = (UISimpleTogglePanel) application.createComponent("org.richfaces.SimpleTogglePanel");
    stp1.setId("simpleTogglePanel1");
    stp1.setOpened(true);
    stp1.setSwitchType(UISimpleTogglePanel.SERVER_SWITCH_TYPE);

    openMarker1 = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
    openMarker1.setId("openMarker");
    openMarker1.setValue("open");

    closeMarker1 = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
    closeMarker1.setId("closeMarker");
    closeMarker1.setValue("close");

    stp1.getFacets().put(openMarker1.getId(), openMarker1);
    stp1.getFacets().put(closeMarker1.getId(), closeMarker1);
    form.getChildren().add(stp1);

    stp2 = (UISimpleTogglePanel) application.createComponent("org.richfaces.SimpleTogglePanel");
    stp2.setId("simpleTogglePanel2");
    stp2.setOpened(false);
    stp2.setSwitchType(UISimpleTogglePanel.SERVER_SWITCH_TYPE);

    openMarker2 = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
    openMarker2.setId("openMarker");
    openMarker2.setValue("open");

    closeMarker2 = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
    closeMarker2.setId("closeMarker");
    closeMarker2.setValue("close");

    stp2.getFacets().put(openMarker2.getId(), openMarker2);
    stp2.getFacets().put(closeMarker2.getId(), closeMarker2);
    form2.getChildren().add(stp2);

    input = (UIInput) application.createComponent(UIInput.COMPONENT_TYPE);
    input.setValue("");
    input.setId("opened");
    input.getAttributes().put("onchange", "return true;");
    stp1.getChildren().add(input);

    command = new HtmlCommandLink();
    command.setId("command");
    stp1.getChildren().add(command);
  }
 /* (non-Javadoc)
  * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
  */
 public void tearDown() throws Exception {
   super.tearDown();
   stp1 = null;
   stp2 = null;
   form = null;
   form2 = null;
   openMarker1 = null;
   closeMarker1 = null;
   openMarker2 = null;
   closeMarker2 = null;
   command = null;
   input = null;
 }
  public void setUp() throws Exception {
    // TODO Auto-generated method stub
    super.setUp();
    table =
        (UIScrollableDataTable) application.createComponent(UIScrollableDataTable.COMPONENT_TYPE);
    facesContext.getViewRoot().getChildren().add(table);
    table.setId("zzz");

    for (int i = 0; i < 10; i++) {
      UIComponent column = MockColumns.newColumn("zzz" + i);
      UIOutput output = new UIOutput();
      output.setId("h" + i);
      column.getFacets().put("header", output);
      table.getChildren().add(column);
    }
  }
예제 #5
0
  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);
  }
예제 #6
0
  public void setUp() throws Exception {
    super.setUp();

    input =
        new UIRangedNumberInput() {
          private String minValue;
          private String maxValue;
          private boolean disabled;

          public String getMinValue() {
            return minValue;
          }

          public void setMinValue(String minValue) {
            this.minValue = minValue;
          }

          public String getMaxValue() {
            return maxValue;
          }

          public void setMaxValue(String maxValue) {
            this.maxValue = maxValue;
          }

          public boolean isDisabled() {
            return disabled;
          }

          public void setDisabled(boolean disabled) {
            this.disabled = disabled;
          }
        };

    input.setMaxValue("100");
    input.setMinValue("0");
    input.setValid(true);
  }
예제 #7
0
 /* (non-Javadoc)
  * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
  */
 public void tearDown() throws Exception {
   this.uiMessages = null;
   super.tearDown();
 }
예제 #8
0
 public void tearDown() throws Exception {
   super.tearDown();
   ajaxForm = null;
   child = null;
 }
 /* (non-Javadoc)
  * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
  */
 public void tearDown() throws Exception {
   table = null;
   super.tearDown();
 }
예제 #10
0
  public void tearDown() throws Exception {
    super.tearDown();

    this.input = null;
  }