public void testWrite() throws Exception {
StringWriter writer = new StringWriter();
final String content = "Hello, World!";
final int start = 1;
final int end = 4;
DefaultStyledDocument doc = new DefaultStyledDocument();
doc.insertString(0, content, null);
editorKit.write(writer, doc, start, end);
String output = writer.toString();
assertTrue(output.indexOf("<html>") != -1);
if (isHarmony()) {
assertFalse(output.indexOf(content) != -1);
assertTrue(output.indexOf(content.substring(start, end)) != -1);
}
writer = new StringWriter();
doc = (HTMLDocument)editorKit.createDefaultDocument();
doc.insertString(0, content, null);
editorKit.write(writer, doc, start, end);
output = writer.toString();
assertTrue(output.indexOf("<html>") != -1);
assertFalse(output.indexOf(content) != -1);
assertTrue(output.indexOf(content.substring(start, end)) != -1);