public void testErrors() throws Exception { TestAction testAction = (TestAction) action; testAction.setFoo("bar"); TextFieldTag tag = new TextFieldTag(); tag.setPageContext(pageContext); tag.setId("myId"); tag.setLabel("mylabel"); tag.setName("foo"); tag.setValue("bar"); tag.setTitle("mytitle"); testAction.addFieldError("foo", "bar error message"); tag.doStartTag(); tag.doEndTag(); verify(TextFieldTag.class.getResource("Textfield-2.txt")); }