attr.addAttribute(HTML.Attribute.SELECTED, "true");
attr.addAttribute(HTML.Attribute.LABEL, label);
action.start(Tag.OPTGROUP, attr);
assertEquals(1, model.getSize());
assertNotNull(model.getElementAt(0));
FormOption option = (FormOption)model.getElementAt(0);
assertFalse(option.isSelected());
assertEquals(label, option.getLabel());
assertNull(option.getValue());
reader.handleText(text.toCharArray(), 0);
assertEquals(1, model.getSize());
assertNotNull(model.getElementAt(0));
option = (FormOption)model.getElementAt(0);
assertFalse(option.isSelected());
assertEquals(label, option.getLabel());
assertNull(option.getValue());
assertEquals(0, option.getDepth());
attr.addAttribute(HTML.Attribute.SELECTED, "true");
attr.addAttribute(HTML.Attribute.VALUE, value);
attr.addAttribute(HTML.Attribute.LABEL, label);
action.start(Tag.OPTGROUP, attr);
assertEquals(2, model.getSize());
assertNotNull(model.getElementAt(1));
option = (FormOption)model.getElementAt(1);
assertFalse(option.isSelected());
assertEquals(label, option.getLabel());
assertNull(option.getValue());
reader.handleText(text.toCharArray(), 0);
assertEquals(2, model.getSize());
assertNotNull(model.getElementAt(1));
option = (FormOption)model.getElementAt(1);
assertFalse(option.isSelected());
assertEquals(label, option.getLabel());
assertNull(option.getValue());
assertEquals(1, option.getDepth());
action.end(Tag.OPTGROUP);
action.end(Tag.OPTGROUP);
action.end(Tag.SELECT);
assertEquals(3, specAttr.getAttributeCount());
}