public void testFlattenTableCellWithStylesAndUnnamedUnstyledParent()
throws IOException, SAXException, ParserConfigurationException {
Styles expectedStyles = generateTestColorStyles();
Element newParent = doFlattenTableCell(expectedStyles,
false, true, false, false);
assertNull(newParent.getStyles());
Element child = (Element)newParent.getHead();
assertNotNull(child);
assertNotNull(child.getStyles());
Styles actualStyles = child.getStyles();
checkFlattenedValues(expectedStyles, actualStyles, true);
newParent = doFlattenTableCell(expectedStyles,
true, true, false, false);
assertNull(newParent.getStyles());
child = (Element) newParent.getHead();
assertNotNull(child);
assertNotNull(child.getStyles());
actualStyles = child.getStyles();
checkFlattenedValues(expectedStyles, actualStyles, true);
Element tail = (Element) newParent.getTail();
assertNotNull(tail);
assertEquals("br", tail.getName());
newParent = doFlattenTableCell(expectedStyles,
true, false, false, false);
Element element = ((Element) newParent.getHead());
assertNotNull(element.getStyles());
checkFlattenedValues(expectedStyles, actualStyles, false);
tail = (Element) newParent.getTail();
assertNotNull(tail);
assertEquals("br", tail.getName());
newParent = doFlattenTableCell(expectedStyles,
false, false, false, false);
element = ((Element) newParent.getHead());
assertNotNull(element.getStyles());
checkFlattenedValues(expectedStyles, actualStyles, false);
}