r432 - in trunk: doxia-module-jrst/src/main/java/org/nuiton/jrst doxia-module-jrst/src/test/java/org/nuiton/jrst jrst/src/main/resources/xsl
Author: sletellier Date: 2010-01-19 12:37:38 +0100 (Tue, 19 Jan 2010) New Revision: 432 Modified: trunk/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java trunk/doxia-module-jrst/src/test/java/org/nuiton/jrst/JrstParserTest.java trunk/jrst/src/main/resources/xsl/rst2xdoc.xsl Log: Fix bug 174 : Test of AbstractParserTest failed so JrstParserTest extends now AbstractModuleTest class Modified: trunk/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java =================================================================== --- trunk/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java 2010-01-17 20:14:31 UTC (rev 431) +++ trunk/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java 2010-01-19 11:37:38 UTC (rev 432) @@ -60,7 +60,7 @@ doc = gen.transform(doc, stylesheet); // Give xsl result to XDoc parser - Reader reader = new StringReader(doc.asXML()); + Readerr = new StringReader(doc.asXML()); super.parse(reader, sink); } catch (Exception e) { throw new ParseException("Can't parse rst file", e); Modified: trunk/doxia-module-jrst/src/test/java/org/nuiton/jrst/JrstParserTest.java =================================================================== --- trunk/doxia-module-jrst/src/test/java/org/nuiton/jrst/JrstParserTest.java 2010-01-17 20:14:31 UTC (rev 431) +++ trunk/doxia-module-jrst/src/test/java/org/nuiton/jrst/JrstParserTest.java 2010-01-19 11:37:38 UTC (rev 432) @@ -17,19 +17,23 @@ package org.nuiton.jrst; +import java.io.InputStream; +import java.io.InputStreamReader; import java.io.Reader; import java.io.StringWriter; +import org.apache.maven.doxia.AbstractModuleTest; import org.apache.maven.doxia.module.xdoc.XdocSink; import org.apache.maven.doxia.parser.AbstractParserTest; import org.apache.maven.doxia.parser.Parser; import org.apache.maven.doxia.sink.Sink; +import org.codehaus.plexus.PlexusTestCase; /** * @author chatellier * @version $Revision : 1$ */ -public class JrstParserTest extends AbstractParserTest { +public class JrstParserTest extends AbstractModuleTest { protected JrstParser parser; @@ -40,12 +44,7 @@ parser = (JrstParser) lookup(Parser.ROLE, "jrst"); } - @Override - protected Parser createParser() { - return parser; - } - - public void testParseRst() throws Exception { + public void testParse() throws Exception { StringWriter output = null; Reader reader = null; @@ -53,14 +52,13 @@ output = new StringWriter(); reader = getTestReader("test", "rst"); - Sink sink = new XdocSink(output) {}; - createParser().parse(reader, sink); + Sink sink = new XdocSink(output){}; + parser.parse(reader, sink); - /* FIXME output is null :( assertTrue(output.toString().indexOf("emphasis") != -1); assertTrue(output.toString().indexOf("This is the first item") != -1); assertTrue(output.toString().indexOf("Title") != -1); - assertTrue(output.toString().indexOf("blocks.") != -1);*/ + assertTrue(output.toString().indexOf("blocks.") != -1); } finally { if (output != null) { output.close(); @@ -76,4 +74,9 @@ return "rst"; } + @Override + protected String getOutputDir(){ + return "parser/"; + } + } Modified: trunk/jrst/src/main/resources/xsl/rst2xdoc.xsl =================================================================== --- trunk/jrst/src/main/resources/xsl/rst2xdoc.xsl 2010-01-17 20:14:31 UTC (rev 431) +++ trunk/jrst/src/main/resources/xsl/rst2xdoc.xsl 2010-01-19 11:37:38 UTC (rev 432) @@ -11,10 +11,12 @@ <properties> <title><xsl:value-of select="title"/></title> </properties> - <section> - <xsl:attribute name="name"><xsl:value-of select="title"/></xsl:attribute> - <xsl:apply-templates /> - </section> + <body> + <section> + <xsl:attribute name="name"><xsl:value-of select="title"/></xsl:attribute> + <xsl:apply-templates /> + </section> + </body> </document> </xsl:template>
participants (1)
-
sletellier@users.nuiton.org