Index: jrst2/src/test/org/codelutin/jrst/JRSTReaderTest.java diff -u jrst2/src/test/org/codelutin/jrst/JRSTReaderTest.java:1.1.1.1 jrst2/src/test/org/codelutin/jrst/JRSTReaderTest.java:1.2 --- jrst2/src/test/org/codelutin/jrst/JRSTReaderTest.java:1.1.1.1 Mon Oct 30 19:34:05 2006 +++ jrst2/src/test/org/codelutin/jrst/JRSTReaderTest.java Fri Nov 3 14:42:08 2006 @@ -23,9 +23,9 @@ * Created: 27 oct. 06 12:11:44 * * @author poussin - * @version $Revision: 1.1.1.1 $ + * @version $Revision: 1.2 $ * - * Last update: $Date: 2006/10/30 19:34:05 $ + * Last update: $Date: 2006/11/03 14:42:08 $ * by : $Author: bpoussin $ */ @@ -36,12 +36,12 @@ import java.io.StringWriter; import java.net.URL; +import junit.framework.TestCase; + import org.dom4j.Document; import org.dom4j.io.OutputFormat; import org.dom4j.io.XMLWriter; -import junit.framework.TestCase; - /** * @author poussin @@ -62,12 +62,12 @@ out.write(doc); } - { - StringWriter out = new StringWriter(); - JRSTGenerator gen = new JRSTGenerator(out); - gen.generate(doc); - System.out.println(out.toString()); - } +// { +// StringWriter out = new StringWriter(); +// JRSTGenerator gen = new JRSTGenerator(out); +// gen.generate(doc); +// System.out.println(out.toString()); +// } } } Index: jrst2/src/test/org/codelutin/jrst/text.rst diff -u jrst2/src/test/org/codelutin/jrst/text.rst:1.1.1.1 jrst2/src/test/org/codelutin/jrst/text.rst:1.2 --- jrst2/src/test/org/codelutin/jrst/text.rst:1.1.1.1 Mon Oct 30 19:34:05 2006 +++ jrst2/src/test/org/codelutin/jrst/text.rst Fri Nov 3 14:42:08 2006 @@ -56,8 +56,8 @@ - et la suite de la liste - pour finir -1. et meme -2. des enum +3. et meme +4. des enum #. pour voir I) de tout @@ -141,3 +141,9 @@ +------------------------+ span rows. | - contain | | body row 4 | | - body elements. | +------------------------+------------+---------------------+ + ++------------------------+------------+---------------------+ +| body row 3 | Cells may | - Table cells | ++------------------------+ span rows. | - contain | +| body row 4 | | - body elements. | ++------------------------+------------+---------------------+ Index: jrst2/src/test/org/codelutin/jrst/JRSTGeneratorTest.java diff -u /dev/null jrst2/src/test/org/codelutin/jrst/JRSTGeneratorTest.java:1.1 --- /dev/null Fri Nov 3 14:42:13 2006 +++ jrst2/src/test/org/codelutin/jrst/JRSTGeneratorTest.java Fri Nov 3 14:42:08 2006 @@ -0,0 +1,74 @@ +/* *##% + * Copyright (C) 2006 + * Code Lutin, Cédric Pineau, Benjamin Poussin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +/* * + * JRSTGenerator.java + * + * Created: 31 oct. 06 11:14:19 + * + * @author poussin + * @version $Revision: 1.1 $ + * + * Last update: $Date: 2006/11/03 14:42:08 $ + * by : $Author: bpoussin $ + */ + +package org.codelutin.jrst; + +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.StringWriter; +import java.net.URL; + +import junit.framework.TestCase; + +import org.dom4j.Document; +import org.dom4j.io.HTMLWriter; +import org.dom4j.io.OutputFormat; +import org.dom4j.io.XMLWriter; + + +/** + * @author poussin + * + */ + +public class JRSTGeneratorTest extends TestCase { + + public void testRstToHtml() throws Exception { + URL url = JRSTReaderTest.class.getResource("/org/codelutin/jrst/text.rst"); + Reader in = new InputStreamReader(url.openStream()); + + JRSTReader jrst = new JRSTReader(); + Document doc = jrst.read(in); + + XMLWriter out = new XMLWriter(System.out, new OutputFormat(" ", true)); + out.write(doc); + + URL stylesheet = JRSTReaderTest.class.getResource("/xslt/rst2html.xsl"); + JRSTGenerator gen = new JRSTGenerator(); + Document html = gen.transform(doc, stylesheet); + + HTMLWriter outhtml = new HTMLWriter(System.out, new OutputFormat(" ", true)); + outhtml.write(html); + } + +} + +