String part1 = "span ";
String part2 = "content";
String styleName = "testStyle";
String spanStyleName = "spanStyle";
OdfTextParagraph instance = new OdfTextParagraph(dom);
OdfTextSpan subElement;
Element element;
Node node;
Assert.assertNotNull(instance);
instance.addStyledContent(styleName, content).addStyledSpanWhitespace(
spanStyleName, spanContent);
// first item should be text
node = instance.getFirstChild();
Assert.assertNotNull(node);
Assert.assertEquals(Node.TEXT_NODE, node.getNodeType());
Assert.assertEquals(content, node.getTextContent());
Assert.assertEquals(styleName, instance.getStyleName());
// followed by a span
node = node.getNextSibling();
Assert.assertNotNull(node);
Assert.assertEquals(Node.ELEMENT_NODE, node.getNodeType());
Assert.assertTrue(node instanceof OdfTextSpan);
subElement = (OdfTextSpan) node;
// with correct style and content
Assert.assertEquals(subElement.getStyleName(), spanStyleName);
node = node.getFirstChild();
Assert.assertEquals(Node.TEXT_NODE, node.getNodeType());
Assert.assertEquals(part1, node.getTextContent());
node = node.getNextSibling();