Index: jrst2/src/test/org/codelutin/jrst/JRSTGeneratorTest.java diff -u jrst2/src/test/org/codelutin/jrst/JRSTGeneratorTest.java:1.2 jrst2/src/test/org/codelutin/jrst/JRSTGeneratorTest.java:1.3 --- jrst2/src/test/org/codelutin/jrst/JRSTGeneratorTest.java:1.2 Fri Nov 3 16:20:38 2006 +++ jrst2/src/test/org/codelutin/jrst/JRSTGeneratorTest.java Mon Nov 6 15:08:47 2006 @@ -23,34 +23,16 @@ * Created: 31 oct. 06 11:14:19 * * @author poussin - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * - * Last update: $Date: 2006/11/03 16:20:38 $ + * Last update: $Date: 2006/11/06 15:08:47 $ * by : $Author: bpoussin $ */ package org.codelutin.jrst; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; -import java.io.StringWriter; -import java.net.MalformedURLException; -import java.net.URL; - -import javax.xml.transform.Source; -import javax.xml.transform.TransformerException; -import javax.xml.transform.URIResolver; -import javax.xml.transform.stream.StreamSource; - 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 @@ -59,29 +41,25 @@ public class JRSTGeneratorTest extends TestCase { - String dn2dbkx = "/xslt/dn2dbk.xsl"; - String dbkx2xhtml = "/usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl"; - 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(dn2dbkx); - JRSTGenerator gen = new JRSTGenerator(); - Document dbkx = gen.transform(doc, stylesheet); - - stylesheet = new File(dbkx2xhtml).toURL(); - gen = new JRSTGenerator(); - Document xhtml = gen.transform(dbkx, stylesheet); + long time0 = System.currentTimeMillis(); + JRST.main(new String[]{"src/test/org/codelutin/jrst/text.rst"}); + System.err.println("==================================================================="); + long time1 = System.currentTimeMillis(); + JRST.main(new String[]{"-t", "html", "src/test/org/codelutin/jrst/text.rst"}); + System.err.println("==================================================================="); + long time2 = System.currentTimeMillis(); +// JRST.main(new String[]{"-t", "docbook", "src/test/org/codelutin/jrst/text.rst"}); + System.err.println("==================================================================="); + long time3 = System.currentTimeMillis(); +// JRST.main(new String[]{"-t", "xhtml", "src/test/org/codelutin/jrst/text.rst"}); + System.err.println("==================================================================="); + long time4 = System.currentTimeMillis(); + JRST.main(new String[]{"-t", "xdoc", "src/test/org/codelutin/jrst/text.rst"}); + + long time5 = System.currentTimeMillis(); - HTMLWriter outSystem = new HTMLWriter(System.out, new OutputFormat(" ", true)); - outSystem.write(xhtml); + System.out.println("time generation: " + (time1-time0) + ":" +(time2-time1) + ":"+ (time3-time2) + ":"+ (time4-time3) + ":"+ (time5-time4)); } } Index: jrst2/src/test/org/codelutin/jrst/text.rst diff -u jrst2/src/test/org/codelutin/jrst/text.rst:1.2 jrst2/src/test/org/codelutin/jrst/text.rst:1.3 --- jrst2/src/test/org/codelutin/jrst/text.rst:1.2 Fri Nov 3 14:42:08 2006 +++ jrst2/src/test/org/codelutin/jrst/text.rst Mon Nov 6 15:08:47 2006 @@ -147,3 +147,9 @@ +------------------------+ span rows. | - contain | | body row 4 | | - body elements. | +------------------------+------------+---------------------+ + +The |the big: biohazard| symbol in |date| must be used on containers used to dispose of medical waste. + +.. |the big: biohazard| image:: biohazard.png +.. |date| date:: +