Search in sources :

Example 6 with HtmlParser

use of org.eclipse.mylyn.wikitext.parser.HtmlParser in project mylyn.docs by eclipse.

the class HtmlParserTest method instance.

@Test
public void instance() {
    HtmlParser instance = HtmlParser.instance();
    assertNotNull(instance);
    assertNotNull(instance.getDelegate());
}
Also used : HtmlParser(org.eclipse.mylyn.wikitext.parser.HtmlParser) Test(org.junit.Test)

Example 7 with HtmlParser

use of org.eclipse.mylyn.wikitext.parser.HtmlParser in project mylyn.docs by eclipse.

the class HtmlParserTest method jsoupNotAvailable.

@Test
public void jsoupNotAvailable() throws Exception {
    HtmlParser parser = new HtmlParser() {

        @Override
        boolean isJsoupAvailable() {
            return false;
        }
    };
    assertCanParseSomething(parser);
}
Also used : HtmlParser(org.eclipse.mylyn.wikitext.parser.HtmlParser) Test(org.junit.Test)

Example 8 with HtmlParser

use of org.eclipse.mylyn.wikitext.parser.HtmlParser in project mylyn.docs by eclipse.

the class HtmlParserTest method instanceWithHtmlCleanupRules.

@Test
public void instanceWithHtmlCleanupRules() {
    HtmlParser instance = HtmlParser.instanceWithHtmlCleanupRules();
    assertNotNull(instance);
    assertNotNull(instance.getDelegate());
    assertTrue(instance.getDelegate() instanceof org.eclipse.mylyn.wikitext.internal.parser.html.HtmlParser);
    org.eclipse.mylyn.wikitext.internal.parser.html.HtmlParser delegate = (org.eclipse.mylyn.wikitext.internal.parser.html.HtmlParser) instance.getDelegate();
    assertFalse(delegate.getProcessors().isEmpty());
}
Also used : HtmlParser(org.eclipse.mylyn.wikitext.parser.HtmlParser) Test(org.junit.Test)

Aggregations

HtmlParser (org.eclipse.mylyn.wikitext.parser.HtmlParser)8 Test (org.junit.Test)5 InputSource (org.xml.sax.InputSource)4 StringReader (java.io.StringReader)3 StringWriter (java.io.StringWriter)2 HtmlDocumentBuilder (org.eclipse.mylyn.wikitext.parser.builder.HtmlDocumentBuilder)2 BufferedInputStream (java.io.BufferedInputStream)1 BufferedOutputStream (java.io.BufferedOutputStream)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 OutputStreamWriter (java.io.OutputStreamWriter)1 Reader (java.io.Reader)1 Writer (java.io.Writer)1 BuildException (org.apache.tools.ant.BuildException)1 DocumentBuilder (org.eclipse.mylyn.wikitext.parser.DocumentBuilder)1 SAXException (org.xml.sax.SAXException)1