public void testOptionTagNotNestedWithinSelectTag() throws Exception { try { tag.setParent(null); tag.setValue("foo"); tag.doStartTag(); fail("Must throw an IllegalStateException when not nested within a <select/> tag."); } catch (IllegalStateException ex) { // expected } }
public void testWithoutContext() throws Exception { this.tag.setParent(null); this.tag.setValue("foo"); this.tag.setLabel("Foo"); try { tag.doStartTag(); fail("Must not be able to use <option> tag without exposed context."); } catch (IllegalStateException ex) { // expected } }