コード例 #1
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"));
  }
コード例 #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"));
  }