Search in sources :

Example 11 with HtmlLanguage

use of org.eclipse.mylyn.wikitext.html.HtmlLanguage in project mylyn.docs by eclipse.

the class HtmlLanguageTest method newDocumentBuilderIsNotFormatting.

@Test
public void newDocumentBuilderIsNotFormatting() {
    Writer out = new StringWriter();
    DocumentBuilder builder = new HtmlLanguage().createDocumentBuilder(out, false);
    builder.beginDocument();
    builder.beginBlock(BlockType.PARAGRAPH, new Attributes());
    builder.characters("test");
    builder.endBlock();
    builder.endDocument();
    assertEquals(loadResourceContent("newDocumentBuilderIsNotFormatting.xml"), out.toString());
}
Also used : StringWriter(java.io.StringWriter) DocumentBuilder(org.eclipse.mylyn.wikitext.parser.DocumentBuilder) HtmlDocumentBuilder(org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) HtmlLanguage(org.eclipse.mylyn.wikitext.html.HtmlLanguage) StringWriter(java.io.StringWriter) Writer(java.io.Writer) Test(org.junit.Test)

Example 12 with HtmlLanguage

use of org.eclipse.mylyn.wikitext.html.HtmlLanguage in project mylyn.docs by eclipse.

the class HtmlLanguageTest method create.

@Test
public void create() {
    HtmlLanguage language = new HtmlLanguage();
    assertEquals("HTML", language.getName());
}
Also used : HtmlLanguage(org.eclipse.mylyn.wikitext.html.HtmlLanguage) Test(org.junit.Test)

Aggregations

HtmlLanguage (org.eclipse.mylyn.wikitext.html.HtmlLanguage)12 Test (org.junit.Test)9 StringWriter (java.io.StringWriter)6 Writer (java.io.Writer)6 DocumentBuilder (org.eclipse.mylyn.wikitext.parser.DocumentBuilder)5 HtmlDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder)4 MarkupParser (org.eclipse.mylyn.wikitext.parser.MarkupParser)3 Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)2 EventDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.EventDocumentBuilder)2 MarkupLanguage (org.eclipse.mylyn.wikitext.parser.markup.MarkupLanguage)1