1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.nuiton.jrst;
24
25 import java.io.Reader;
26 import java.io.StringWriter;
27
28 import org.apache.maven.doxia.AbstractModuleTest;
29 import org.apache.maven.doxia.module.xdoc.XdocSink;
30 import org.apache.maven.doxia.parser.Parser;
31 import org.apache.maven.doxia.sink.Sink;
32 import org.junit.Ignore;
33
34
35
36
37
38
39
40 @Ignore
41 public class JrstParserTest extends AbstractModuleTest {
42
43 protected JrstParser parser;
44
45 @Override
46 protected void setUp() throws Exception {
47 super.setUp();
48
49 parser = (JrstParser) lookup(Parser.ROLE, "jrst");
50 }
51
52 public void testParse() throws Exception {
53 StringWriter output = null;
54 Reader reader = null;
55
56 try {
57 output = new StringWriter();
58 reader = getTestReader("test", "rst");
59
60 Sink sink = new XdocSink(output){};
61 parser.parse(reader, sink);
62
63 assertTrue(output.toString().contains("emphasis"));
64 assertTrue(output.toString().contains("This is the first item"));
65 assertTrue(output.toString().contains("Title"));
66 assertTrue(output.toString().contains("blocks."));
67 } finally {
68 if (output != null) {
69 output.close();
70 }
71 if (reader != null) {
72 reader.close();
73 }
74 }
75 }
76
77 @Override
78 protected String outputExtension() {
79 return "rst";
80 }
81
82 @Override
83 protected String getOutputDir(){
84 return "parser/";
85 }
86
87 }