use of org.terasology.engine.rendering.nui.widgets.browser.data.DocumentData in project Terasology by MovingBlocks.
the class HTMLParserTest method testParseEmptyDocument.
@Test
public void testParseEmptyDocument() throws IOException, SAXException, ParserConfigurationException {
DocumentData documentData = htmlParser.parseHTMLDocument("<body></body>");
assertEquals(0, documentData.getParagraphs().size());
}
use of org.terasology.engine.rendering.nui.widgets.browser.data.DocumentData in project Terasology by MovingBlocks.
the class HTMLParserTest method testParseSimpleParagraph.
@Test
public void testParseSimpleParagraph() throws IOException, SAXException, ParserConfigurationException {
DocumentData documentData = htmlParser.parseHTMLDocument("<body><p>Text</p></body>");
assertEquals(1, documentData.getParagraphs().size());
ParagraphData paragraph = documentData.getParagraphs().iterator().next();
assertTrue(paragraph instanceof FlowParagraphData);
}
use of org.terasology.engine.rendering.nui.widgets.browser.data.DocumentData in project Terasology by MovingBlocks.
the class HTMLParserTest method testParseTwoParagraphs.
@Test
public void testParseTwoParagraphs() throws IOException, SAXException, ParserConfigurationException {
DocumentData documentData = htmlParser.parseHTMLDocument("<body><p>Text</p><p>Second</p></body>");
assertEquals(2, documentData.getParagraphs().size());
}
Aggregations