public void testChecked() throws Exception { TestAction testAction = (TestAction) action; testAction.setFoo("true"); CheckboxTag tag = new CheckboxTag(); tag.setPageContext(pageContext); tag.setId("someId"); tag.setLabel("mylabel"); tag.setName("foo"); tag.setFieldValue("baz"); tag.setOnfocus("test();"); tag.setTitle("mytitle"); tag.doStartTag(); tag.doEndTag(); verify(CheckboxTag.class.getResource("Checkbox-1.txt")); }
public void testCheckedWithError() throws Exception { TestAction testAction = (TestAction) action; testAction.setFoo("true"); testAction.addFieldError("foo", "Some Foo Error"); testAction.addFieldError("foo", "Another Foo Error"); CheckboxTag tag = new CheckboxTag(); tag.setPageContext(pageContext); tag.setLabel("mylabel"); tag.setName("foo"); tag.setFieldValue("baz"); tag.setOndblclick("test();"); tag.setOnclick("test();"); tag.setTitle("mytitle"); tag.doStartTag(); tag.doEndTag(); verify(CheckboxTag.class.getResource("Checkbox-3.txt")); }