Ejemplo n.º 1
0
  public void testButtonWithLabel() throws Exception {
    TestAction testAction = (TestAction) action;
    testAction.setFoo("bar");

    ResetTag tag = new ResetTag();
    tag.setPageContext(pageContext);
    tag.setLabel("mylabel");
    tag.setType("button");
    tag.setAlign("left");
    tag.setName("myname");
    tag.setValue("%{foo}");

    tag.doStartTag();
    tag.doEndTag();

    verify(TextFieldTag.class.getResource("Reset-4.txt"));
  }
Ejemplo n.º 2
0
  public void testImageWithExpressionSrc() throws Exception {
    TestAction testAction = (TestAction) action;
    testAction.setFoo("bar");

    ResetTag tag = new ResetTag();
    tag.setPageContext(pageContext);
    tag.setType("button");
    tag.setName("myname");
    tag.setLabel("mylabel");
    tag.setValue("%{foo}");
    tag.setSrc("%{getText(\"some.image.from.properties\")}");

    tag.doStartTag();
    tag.doEndTag();

    verify(TextFieldTag.class.getResource("Reset-6.txt"));
  }
Ejemplo n.º 3
0
  public void testDefaultValues() throws Exception {
    TestAction testAction = (TestAction) action;
    testAction.setFoo("bar");

    ResetTag tag = new ResetTag();
    tag.setPageContext(pageContext);
    tag.setLabel("mylabel");
    tag.setName("myname");
    tag.setTitle("mytitle");
    tag.setSrc("/images/test.png");

    tag.doStartTag();
    tag.doEndTag();

    verify(TextFieldTag.class.getResource("Reset-2.txt"));
  }
Ejemplo n.º 4
0
  public void testImageSimple() throws Exception {
    TestAction testAction = (TestAction) action;
    testAction.setFoo("bar");

    ResetTag tag = new ResetTag();
    tag.setPageContext(pageContext);
    tag.setType("button");
    tag.setName("myname");
    tag.setValue("%{foo}");
    tag.setDisabled("true");

    tag.doStartTag();
    tag.doEndTag();

    verify(TextFieldTag.class.getResource("Reset-5.txt"));
  }
Ejemplo n.º 5
0
  public void testSimpleThemeImageUsingMethodOnly() throws Exception {
    TestAction testAction = (TestAction) action;
    testAction.setFoo("bar");

    ResetTag tag = new ResetTag();
    tag.setPageContext(pageContext);
    tag.setTheme("simple");
    tag.setType("button");
    tag.setName("myname");
    tag.setLabel("mylabel");
    tag.setAction(null); // no action
    tag.setMethod("update");
    tag.setAlign("left");

    tag.doStartTag();
    tag.doEndTag();

    verify(TextFieldTag.class.getResource("Reset-9.txt"));
  }