Jrst-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
November 2011
- 2 participants
- 5 discussions
r630 - in trunk/jrst/src/test: java/org/nuiton/jrst java/org/nuiton/jrst/bugs resources/bugs
by sletellier@users.nuiton.org 29 Nov '11
by sletellier@users.nuiton.org 29 Nov '11
29 Nov '11
Author: sletellier
Date: 2011-11-29 18:40:40 +0100 (Tue, 29 Nov 2011)
New Revision: 630
Url: http://nuiton.org/repositories/revision/jrst/630
Log:
Clean and refactor all tests
Added:
trunk/jrst/src/test/java/org/nuiton/jrst/JRSTAbstractTest.java
Modified:
trunk/jrst/src/test/java/org/nuiton/jrst/AdvancedReaderTest.java
trunk/jrst/src/test/java/org/nuiton/jrst/JRSTCompareDocutils.java
trunk/jrst/src/test/java/org/nuiton/jrst/JRSTGeneratorTest.java
trunk/jrst/src/test/java/org/nuiton/jrst/JRSTReaderTest.java
trunk/jrst/src/test/java/org/nuiton/jrst/JRSTTest.java
trunk/jrst/src/test/java/org/nuiton/jrst/bugs/AdmonitionTest.java
trunk/jrst/src/test/java/org/nuiton/jrst/bugs/DirectiveTest.java
trunk/jrst/src/test/java/org/nuiton/jrst/bugs/InfiniteLoopTest.java
trunk/jrst/src/test/java/org/nuiton/jrst/bugs/OptionTest.java
trunk/jrst/src/test/java/org/nuiton/jrst/bugs/TableTest.java
trunk/jrst/src/test/java/org/nuiton/jrst/bugs/TextTest.java
trunk/jrst/src/test/java/org/nuiton/jrst/bugs/TitlesTest.java
trunk/jrst/src/test/resources/bugs/testAdminitionInList1787.rst
trunk/jrst/src/test/resources/bugs/testOptionArgumentSize1788.rst
Modified: trunk/jrst/src/test/java/org/nuiton/jrst/AdvancedReaderTest.java
===================================================================
--- trunk/jrst/src/test/java/org/nuiton/jrst/AdvancedReaderTest.java 2011-11-29 17:40:02 UTC (rev 629)
+++ trunk/jrst/src/test/java/org/nuiton/jrst/AdvancedReaderTest.java 2011-11-29 17:40:40 UTC (rev 630)
@@ -33,7 +33,6 @@
import java.io.StringReader;
import java.io.Writer;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -49,7 +48,7 @@
* Last update: $Date$
* by : $Author$
*/
-public class AdvancedReaderTest {
+public class AdvancedReaderTest extends JRSTAbstractTest {
protected String text = "\t\t\n" + "1 toto tata tutu\n" + "2 toto tata tutu\n"
+ "3 toto tata tutu\n" + "4 toto tata tutu\n"
@@ -74,9 +73,8 @@
*/
@Before
public void setUp() throws IOException {
- file = File.createTempFile("test-AdvancedReader", ".txt");
- file.deleteOnExit();
-
+ file = getOutputTestFile("test-AdvancedReader.txt");
+
Writer out = new BufferedWriter(new FileWriter(file));
out.write(text);
out.close();
@@ -89,14 +87,14 @@
@Test
public void testEof() throws IOException {
AdvancedReader in = new AdvancedReader(new FileReader(file));
- Assert.assertFalse(in.eof());
+ assertFalse(in.eof());
in.readAll();
- Assert.assertTrue(in.eof());
+ assertTrue(in.eof());
in = new AdvancedReader(new StringReader(text));
- Assert.assertFalse(in.eof());
+ assertFalse(in.eof());
in.readAll();
- Assert.assertTrue(in.eof());
+ assertTrue(in.eof());
}
/**
@@ -110,14 +108,14 @@
AdvancedReader in = new AdvancedReader(new FileReader(file));
in.skipBlankLines();
String line = in.readLine();
- Assert.assertEquals("1 toto tata tutu", line);
+ assertEquals("1 toto tata tutu", line);
}
{
AdvancedReader in = new AdvancedReader(new StringReader(text));
in.skipBlankLines();
String line = in.readLine();
- Assert.assertEquals("1 toto tata tutu", line);
+ assertEquals("1 toto tata tutu", line);
}
}
@@ -130,19 +128,19 @@
{
AdvancedReader in = new AdvancedReader(new FileReader(file));
String[] lines = in.readAll();
- Assert.assertEquals(10, lines.length);
- Assert.assertEquals("\t\t", lines[0]);
- Assert.assertEquals("1 toto tata tutu", lines[1]);
- Assert.assertEquals("9 toto tata tutu", lines[9]);
+ assertEquals(10, lines.length);
+ assertEquals("\t\t", lines[0]);
+ assertEquals("1 toto tata tutu", lines[1]);
+ assertEquals("9 toto tata tutu", lines[9]);
}
{
AdvancedReader in = new AdvancedReader(new StringReader(text));
String[] lines = in.readAll();
- Assert.assertEquals(10, lines.length);
- Assert.assertEquals("\t\t", lines[0]);
- Assert.assertEquals("1 toto tata tutu", lines[1]);
- Assert.assertEquals("9 toto tata tutu", lines[9]);
+ assertEquals(10, lines.length);
+ assertEquals("\t\t", lines[0]);
+ assertEquals("1 toto tata tutu", lines[1]);
+ assertEquals("9 toto tata tutu", lines[9]);
}
}
@@ -155,19 +153,19 @@
{
AdvancedReader in = new AdvancedReader(new FileReader(file));
String[] lines = in.readLines(3);
- Assert.assertEquals(3, lines.length);
- Assert.assertEquals("\t\t", lines[0]);
- Assert.assertEquals("1 toto tata tutu", lines[1]);
- Assert.assertEquals("2 toto tata tutu", lines[2]);
+ assertEquals(3, lines.length);
+ assertEquals("\t\t", lines[0]);
+ assertEquals("1 toto tata tutu", lines[1]);
+ assertEquals("2 toto tata tutu", lines[2]);
}
{
AdvancedReader in = new AdvancedReader(new StringReader(text));
String[] lines = in.readLines(3);
- Assert.assertEquals(3, lines.length);
- Assert.assertEquals("\t\t", lines[0]);
- Assert.assertEquals("1 toto tata tutu", lines[1]);
- Assert.assertEquals("2 toto tata tutu", lines[2]);
+ assertEquals(3, lines.length);
+ assertEquals("\t\t", lines[0]);
+ assertEquals("1 toto tata tutu", lines[1]);
+ assertEquals("2 toto tata tutu", lines[2]);
}
}
@@ -181,25 +179,25 @@
{
AdvancedReader in = new AdvancedReader(new FileReader(file));
String[] lines = in.readUntil("^3.*$");
- Assert.assertEquals(3, lines.length);
- Assert.assertEquals("\t\t", lines[0]);
- Assert.assertEquals("1 toto tata tutu", lines[1]);
- Assert.assertEquals("2 toto tata tutu", lines[2]);
+ assertEquals(3, lines.length);
+ assertEquals("\t\t", lines[0]);
+ assertEquals("1 toto tata tutu", lines[1]);
+ assertEquals("2 toto tata tutu", lines[2]);
String line = in.readLine();
- Assert.assertEquals("3 toto tata tutu", line);
+ assertEquals("3 toto tata tutu", line);
}
{
AdvancedReader in = new AdvancedReader(new StringReader(text));
String[] lines = in.readUntil("^3.*$");
- Assert.assertEquals(3, lines.length);
- Assert.assertEquals("\t\t", lines[0]);
- Assert.assertEquals("1 toto tata tutu", lines[1]);
- Assert.assertEquals("2 toto tata tutu", lines[2]);
+ assertEquals(3, lines.length);
+ assertEquals("\t\t", lines[0]);
+ assertEquals("1 toto tata tutu", lines[1]);
+ assertEquals("2 toto tata tutu", lines[2]);
String line = in.readLine();
- Assert.assertEquals("3 toto tata tutu", line);
+ assertEquals("3 toto tata tutu", line);
}
}
@@ -214,26 +212,26 @@
AdvancedReader in = new AdvancedReader(new FileReader(file));
in.skipBlankLines();
String[] lines = in.readWhile("^[123].*$");
- Assert.assertEquals(3, lines.length);
- Assert.assertEquals("1 toto tata tutu", lines[0]);
- Assert.assertEquals("2 toto tata tutu", lines[1]);
- Assert.assertEquals("3 toto tata tutu", lines[2]);
+ assertEquals(3, lines.length);
+ assertEquals("1 toto tata tutu", lines[0]);
+ assertEquals("2 toto tata tutu", lines[1]);
+ assertEquals("3 toto tata tutu", lines[2]);
String line = in.readLine();
- Assert.assertEquals("4 toto tata tutu", line);
+ assertEquals("4 toto tata tutu", line);
}
{
AdvancedReader in = new AdvancedReader(new StringReader(text));
in.skipBlankLines();
String[] lines = in.readWhile("^[123].*$");
- Assert.assertEquals(3, lines.length);
- Assert.assertEquals("1 toto tata tutu", lines[0]);
- Assert.assertEquals("2 toto tata tutu", lines[1]);
- Assert.assertEquals("3 toto tata tutu", lines[2]);
+ assertEquals(3, lines.length);
+ assertEquals("1 toto tata tutu", lines[0]);
+ assertEquals("2 toto tata tutu", lines[1]);
+ assertEquals("3 toto tata tutu", lines[2]);
String line = in.readLine();
- Assert.assertEquals("4 toto tata tutu", line);
+ assertEquals("4 toto tata tutu", line);
}
}
@@ -246,21 +244,21 @@
{
AdvancedReader in = new AdvancedReader(new FileReader(file));
String line = in.readLine();
- Assert.assertEquals("\t\t", line);
+ assertEquals("\t\t", line);
line = in.readLine();
- Assert.assertEquals("1 toto tata tutu", line);
+ assertEquals("1 toto tata tutu", line);
line = in.readLine();
- Assert.assertEquals("2 toto tata tutu", line);
+ assertEquals("2 toto tata tutu", line);
}
{
AdvancedReader in = new AdvancedReader(new StringReader(text));
String line = in.readLine();
- Assert.assertEquals("\t\t", line);
+ assertEquals("\t\t", line);
line = in.readLine();
- Assert.assertEquals("1 toto tata tutu", line);
+ assertEquals("1 toto tata tutu", line);
line = in.readLine();
- Assert.assertEquals("2 toto tata tutu", line);
+ assertEquals("2 toto tata tutu", line);
}
}
@@ -270,31 +268,31 @@
String line = in.readLine();
in.mark();
line = in.readLine();
- Assert.assertEquals("1 toto tata tutu", line);
+ assertEquals("1 toto tata tutu", line);
in.reset();
line = in.readLine();
- Assert.assertEquals("1 toto tata tutu", line);
+ assertEquals("1 toto tata tutu", line);
}
@Test
public void testUnread() throws IOException {
AdvancedReader in = new AdvancedReader(new StringReader(text));
- Assert.assertEquals(0, in.getCharNumber());
- Assert.assertEquals(0, in.getLineNumber());
+ assertEquals(0, in.getCharNumber());
+ assertEquals(0, in.getLineNumber());
String line = in.readLine();
- Assert.assertEquals(3, in.getCharNumber());
- Assert.assertEquals(1, in.getLineNumber());
+ assertEquals(3, in.getCharNumber());
+ assertEquals(1, in.getLineNumber());
line = in.readLine();
- Assert.assertEquals(4 + "1 toto tata tutu".length(), in.getCharNumber());
- Assert.assertEquals(2, in.getLineNumber());
- Assert.assertEquals("1 toto tata tutu", line);
+ assertEquals(4 + "1 toto tata tutu".length(), in.getCharNumber());
+ assertEquals(2, in.getLineNumber());
+ assertEquals("1 toto tata tutu", line);
in.unread(line.length() + 1);
- Assert.assertEquals(3, in.getCharNumber());
- Assert.assertEquals(1, in.getLineNumber());
+ assertEquals(3, in.getCharNumber());
+ assertEquals(1, in.getLineNumber());
line = in.readLine();
- Assert.assertEquals(4 + "1 toto tata tutu".length(), in.getCharNumber());
- Assert.assertEquals(2, in.getLineNumber());
- Assert.assertEquals("1 toto tata tutu", line);
+ assertEquals(4 + "1 toto tata tutu".length(), in.getCharNumber());
+ assertEquals(2, in.getLineNumber());
+ assertEquals("1 toto tata tutu", line);
}
@Test
@@ -302,10 +300,10 @@
AdvancedReader in = new AdvancedReader(new StringReader(text));
in.skip(3);
String line = in.readLine();
- Assert.assertEquals("1 toto tata tutu", line);
+ assertEquals("1 toto tata tutu", line);
in.skip(text.length());
line = in.readLine();
- Assert.assertNull(line);
+ assertNull(line);
}
/**
@@ -324,7 +322,7 @@
tmp = tmp.replaceAll("\r", "\r\n");
in = new AdvancedReader(new StringReader(tmp));
String[] linesRN = in.readAll();
- Assert.assertArrayEquals(linesN, linesR);
- Assert.assertArrayEquals(linesN, linesRN);
+ assertArrayEquals(linesN, linesR);
+ assertArrayEquals(linesN, linesRN);
}
}
Added: trunk/jrst/src/test/java/org/nuiton/jrst/JRSTAbstractTest.java
===================================================================
--- trunk/jrst/src/test/java/org/nuiton/jrst/JRSTAbstractTest.java (rev 0)
+++ trunk/jrst/src/test/java/org/nuiton/jrst/JRSTAbstractTest.java 2011-11-29 17:40:40 UTC (rev 630)
@@ -0,0 +1,67 @@
+package org.nuiton.jrst;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * @author sletellier <letellier(a)codelutin.com>
+ */
+public class JRSTAbstractTest extends Assert {
+
+ protected static File testWorkDir;
+ protected static File testResourcesDir;
+
+ @BeforeClass
+ public static void initTest() throws IOException {
+ // get maven env basedir
+ String basedir = System.getenv("basedir");
+ if (basedir == null) {
+
+ // says basedir is where we start tests.
+ basedir = new File("").getAbsolutePath();
+ }
+ File basedirFile = new File(basedir);
+ testWorkDir = new File(basedirFile,
+ "target" + File.separator +
+ "surefire-workdir");
+
+ boolean b = testWorkDir.exists() || testWorkDir.mkdirs();
+ if (!b) {
+ throw new IOException(
+ "Could not create workdir directory " + testWorkDir);
+ }
+
+ testResourcesDir = new File(basedirFile,
+ "src" + File.separator +
+ "test" + File.separator +
+ "resources" + File.separator);
+ }
+
+ public static File getOutputTestFile(String fileName) throws IOException {
+ File file = new File(testWorkDir, fileName);
+ file.createNewFile();
+ file.deleteOnExit();
+ return file;
+ }
+
+ public static String getOutputTestPath(String fileName) throws IOException {
+ File file = getOutputTestFile(fileName);
+ return file.getPath();
+ }
+
+ public static File getTestFile(String testName) {
+ return new File(testResourcesDir, testName);
+ }
+
+ public static File getBugTestFile(String testName) {
+ return new File(testResourcesDir, File.separator + "bugs" + File.separator + testName);
+ }
+
+ public static InputStream getTestStream(String testName) {
+ return JRSTAbstractTest.class.getResourceAsStream("/" + testName);
+ }
+}
Modified: trunk/jrst/src/test/java/org/nuiton/jrst/JRSTCompareDocutils.java
===================================================================
--- trunk/jrst/src/test/java/org/nuiton/jrst/JRSTCompareDocutils.java 2011-11-29 17:40:02 UTC (rev 629)
+++ trunk/jrst/src/test/java/org/nuiton/jrst/JRSTCompareDocutils.java 2011-11-29 17:40:40 UTC (rev 630)
@@ -53,10 +53,6 @@
import java.util.List;
import java.util.Locale;
-
-
-
-
public class JRSTCompareDocutils {
/** to use log facility, just put in your code: log.info(\"...\"); */
Modified: trunk/jrst/src/test/java/org/nuiton/jrst/JRSTGeneratorTest.java
===================================================================
--- trunk/jrst/src/test/java/org/nuiton/jrst/JRSTGeneratorTest.java 2011-11-29 17:40:02 UTC (rev 629)
+++ trunk/jrst/src/test/java/org/nuiton/jrst/JRSTGeneratorTest.java 2011-11-29 17:40:40 UTC (rev 630)
@@ -25,14 +25,13 @@
package org.nuiton.jrst;
-import java.io.File;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
+import java.io.File;
+
/**
* JRSTGeneratorTest.
*
@@ -44,21 +43,27 @@
* Last update: $Date$
* by : $Author$
*/
-public class JRSTGeneratorTest {
+public class JRSTGeneratorTest extends JRSTAbstractTest {
/** to use log facility, just put in your code: log.info("..."); */
protected static Log log = LogFactory.getLog(JRSTGeneratorTest.class);
-
+
+ public static String getResourcesTestPath() {
+ File file = getTestFile("test.rst");
+ return file.getPath();
+ }
+
+ // Not implemented
+ @Ignore
@Test
public void testRstToRst() throws Exception {
-// if (log.isInfoEnabled()) {
-// log.info("Testing RST to RST (test.rst)...");
-// }
-//
-// File test1 = File.createTempFile("jrst-RstToRst", ".rst");
-// JRST.main(new String[] { "-t", "rst", "--force", "-o", test1.getAbsolutePath(), "src/test/resources/test.rst", });
-// test1.delete();
+ if (log.isInfoEnabled()) {
+ log.info("Testing RST to RST (test.rst)...");
+ }
+
+ String test1 = getOutputTestPath("jrst-RstToRst.rst");
+ JRST.main(new String[]{"-t", "rst", "--force", "-o", test1, getResourcesTestPath()});
}
@Test
@@ -67,11 +72,9 @@
if (log.isInfoEnabled()) {
log.info("Testing RST to HTML (test.rst)...");
}
-
- File test1 = File.createTempFile("jrst-RstToHtml2", ".html");
- JRST.main(new String[] { "-t", "html", "--force", "-o", test1.getAbsolutePath(), "src/test/resources/text.rst" });
- Assert.assertTrue(test1.length() > 0);
- test1.delete();
+
+ String test1 = getOutputTestPath("jrst-RstToHtml2.html");
+ JRST.main(new String[]{"-t", "html", "--force", "-o", test1, getResourcesTestPath()});
}
@Test
@@ -80,12 +83,9 @@
if (log.isInfoEnabled()) {
log.info("Testing RST to Docbook (test.rst)...");
}
-
- File test1 = File.createTempFile("jrst-RstToDocbook", ".dbk");
- JRST.main(new String[]{"-t", "docbook", "--force","-o", test1.getAbsolutePath(),
- "src/test/resources/test.rst"});
- Assert.assertTrue(test1.length() > 0);
- test1.delete();
+
+ String test1 = getOutputTestPath("jrst-RstToDocbook.dbk");
+ JRST.main(new String[]{"-t", "docbook", "--force", "-o", test1, getResourcesTestPath()});
}
@Test
@@ -95,11 +95,8 @@
log.info("Testing RST to Xdoc (test.rst)...");
}
- File test1 = File.createTempFile("jrst-RstToXdoc", ".xdoc");
- JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(),
- "src/test/resources/test.rst" });
- Assert.assertTrue(test1.length() > 0);
- test1.delete();
+ String test1 = getOutputTestPath("jrst-RstToXdoc.xdoc");
+ JRST.main(new String[]{"-t", "xdoc", "--force", "-o", test1, getResourcesTestPath()});
}
/**
@@ -114,11 +111,8 @@
log.info("Testing RST to Xdoc (test2.rst)...");
}
- File test1 = File.createTempFile("jrst-RstToXdoc2", ".xdoc");
- JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(),
- "src/test/resources/test2.rst" });
- Assert.assertTrue(test1.length() > 0);
- test1.delete();
+ String test1 = getOutputTestPath("jrst-RstToXdoc2.xdoc");
+ JRST.main(new String[]{"-t", "xdoc", "--force", "-o", test1, getResourcesTestPath()});
}
@Test
@@ -128,11 +122,8 @@
log.info("Testing RST to Xdoc (test3.rst) ...");
}
- File test1 = File.createTempFile("jrst-RstToXdoc3", ".xdoc");
- JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(),
- "src/test/resources/test3.rst" });
- Assert.assertTrue(test1.length() > 0);
- test1.delete();
+ String test1 = getOutputTestPath("jrst-RstToXdoc3.xdoc");
+ JRST.main(new String[]{"-t", "xdoc", "--force", "-o", test1, getResourcesTestPath()});
}
@Test
@@ -142,11 +133,8 @@
log.info("Testing RST to Xdoc (test4.rst) ...");
}
- File test1 = File.createTempFile("jrst-RstToXdoc4", ".xdoc");
- JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(),
- "src/test/resources/test4.rst" });
- Assert.assertTrue(test1.length() > 0);
- test1.delete();
+ String test1 = getOutputTestPath("jrst-RstToXdoc4.xdoc");
+ JRST.main(new String[]{"-t", "xdoc", "--force", "-o", test1, getResourcesTestPath()});
}
@Test
@@ -156,11 +144,8 @@
log.info("Testing RST to Xdoc (frEntier.rst) ...");
}
- File test1 = File.createTempFile("jrst-RstToXdocJrstSite", ".xdoc");
- JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(),
- "src/test/resources/frEntier.rst" });
- Assert.assertTrue(test1.length() > 0);
- test1.delete();
+ String test1 = getOutputTestPath("jrst-RstToXdocJrstSite.xdoc");
+ JRST.main(new String[]{"-t", "xdoc", "--force", "-o", test1, getResourcesTestPath()});
}
@Test
@@ -170,10 +155,7 @@
log.info("Testing RST to PDF (frEntier.rst) ...");
}
- File test1 = File.createTempFile("jrst-RstToPDF", ".pdf");
- JRST.main(new String[] { "-t", "pdf", "--force","-o", test1.getAbsolutePath(),
- "src/test/resources/test.rst" });
- Assert.assertTrue(test1.length() > 0);
- test1.delete();
+ String test1 = getOutputTestPath("jrst-RstToPDF.pdf");
+ JRST.main(new String[]{"-t", "pdf", "--force", "-o", test1, getResourcesTestPath()});
}
}
Modified: trunk/jrst/src/test/java/org/nuiton/jrst/JRSTReaderTest.java
===================================================================
--- trunk/jrst/src/test/java/org/nuiton/jrst/JRSTReaderTest.java 2011-11-29 17:40:02 UTC (rev 629)
+++ trunk/jrst/src/test/java/org/nuiton/jrst/JRSTReaderTest.java 2011-11-29 17:40:40 UTC (rev 630)
@@ -28,12 +28,11 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dom4j.Document;
-import org.dom4j.io.XMLWriter;
import java.io.BufferedReader;
+import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
-import java.io.StringWriter;
import java.net.URL;
import java.util.Locale;
@@ -54,7 +53,7 @@
* Last update: $Date$
* by : $Author$
*/
-public class JRSTReaderTest {
+public class JRSTReaderTest extends JRSTAbstractTest {
/** to use log facility, just put in your code: log.info("..."); */
protected static Log log = LogFactory.getLog(JRSTReaderTest.class);
@@ -73,8 +72,9 @@
@Test
public void testEmptyTableContents() throws Exception {
- URL url = JRSTReaderTest.class.getResource("/testEmptyTableContents.rst");
- Reader in = new InputStreamReader(url.openStream());
+ String fileName = "testEmptyTableContents.rst";
+ InputStream testStream = getTestStream(fileName);
+ Reader in = new InputStreamReader(testStream);
JRSTReader jrst = new JRSTReader();
Document doc = jrst.read(in);
String xmlexpected = "<topic class=\"contents\" ids=\"table des matières\" names=\"table des matières\">" +
@@ -83,17 +83,15 @@
"<paragraph>Texte</paragraph>" +
"</document>";
String actualXml = doc.asXML();
- log.info("Test file : " + url);
- log.info("Result :\n" + actualXml);
- log.info("Expected :\n" + xmlexpected);
- Assert.assertTrue(actualXml.contains(xmlexpected));
+ assertXmlContain(fileName, actualXml, xmlexpected);
}
@Test
public void testExternalLink() throws Exception {
- URL url = JRSTReaderTest.class.getResource("/testExternalLink.rst");
- Reader in = new InputStreamReader(url.openStream());
+ String fileName = "testExternalLink.rst";
+ InputStream testStream = getTestStream(fileName);
+ Reader in = new InputStreamReader(testStream);
JRSTReader jrst = new JRSTReader();
Document doc = jrst.read(in);
String xmlexpected = "<paragraph>External hyperlinks, like <reference name=\"Python\" refuri=\"http://www.python.org/\">Python</reference></paragraph>" +
@@ -101,17 +99,15 @@
"</document>";
String actualXml = doc.asXML();
- log.info("Test file : " + url);
- log.info("Result :\n" + actualXml);
- log.info("Expected :\n" + xmlexpected);
- Assert.assertTrue(actualXml.contains(xmlexpected));
+ assertXmlContain(fileName, actualXml, xmlexpected);
}
@Test
public void testHyperlinkTarget() throws Exception {
- URL url = JRSTReaderTest.class.getResource("/testHyperlinkTarget.rst");
- Reader in = new InputStreamReader(url.openStream());
+ String fileName = "testHyperlinkTarget.rst";
+ InputStream testStream = getTestStream(fileName);
+ Reader in = new InputStreamReader(testStream);
JRSTReader jrst = new JRSTReader();
Document doc = jrst.read(in);
String actualXml = doc.asXML();
@@ -130,80 +126,88 @@
String xmlexpected = buffer.toString();
index = xmlexpected.indexOf("<paragraph");
xmlexpected = xmlexpected.substring(index).trim();
- log.info("Test file : " + url);
- log.info("Result :\n" + actualXml);
- log.info("Expected :\n" + xmlexpected);
- Assert.assertEquals(xmlexpected, actualXml);
+ assertXmlEqual(fileName, actualXml, xmlexpected);
}
-
-
+
@Test
public void testAnonymous() throws Exception {
- URL url = JRSTReaderTest.class.getResource("/testAnonymous.rst");
- Reader in = new InputStreamReader(url.openStream());
+ String fileName = "testAnonymous.rst";
+ InputStream testStream = getTestStream(fileName);
+ Reader in = new InputStreamReader(testStream);
I18n.init(new ClassPathI18nInitializer(), Locale.UK);
-
+
JRSTReader jrst = new JRSTReader();
Document doc = jrst.read(in);
-
-
+
+
String xmlexpected ="<target anonymous=\"1\" ids=\"id1\" refuri=\"http://www.python.org\"/>"
+"<target anonymous=\"1\" ids=\"id2\" refuri=\"http://www.python.org\"/>";
-
+
String actualXml = doc.asXML();
- log.info("Result :\n" + actualXml);
- log.info("Expected :\n" + xmlexpected);
- Assert.assertTrue(actualXml.contains(xmlexpected));
+ assertXmlContain(fileName, actualXml, xmlexpected);
}
-
+
@Test
public void testLiteral() throws Exception {
- URL url = JRSTReaderTest.class.getResource("/testLiteral.rst");
- Reader in = new InputStreamReader(url.openStream());
+ String fileName = "testLiteral.rst";
+ InputStream testStream = getTestStream(fileName);
+ Reader in = new InputStreamReader(testStream);
I18n.init(new ClassPathI18nInitializer(), Locale.UK);
-
+
JRSTReader jrst = new JRSTReader();
Document doc = jrst.read(in);
-
-
+
+
String xmlexpected =
"<literal_block> refcomp.admin.email=l'email des administrateurs. Example : admin(a)refcomp.com\n" +
"\n" +
"</literal_block></list_item></enumerated_list><paragraph>Paragraphe test</paragraph></document>";
-
String actualXml = doc.asXML();
- log.warn("Result :\n" + actualXml);
- log.warn("Expected :\n" + xmlexpected);
- Assert.assertTrue(actualXml.contains(xmlexpected));
+ assertXmlContain(fileName, actualXml, xmlexpected);
}
-
-
+
@Test
public void testFootnote() throws Exception {
- URL url = JRSTReaderTest.class.getResource("/testFootnote.rst");
- Reader in = new InputStreamReader(url.openStream());
+ String fileName = "testFootnote.rst";
+ Reader in = new InputStreamReader(getTestStream(fileName));
I18n.init(new ClassPathI18nInitializer(), Locale.UK);
-
+
JRSTReader jrst = new JRSTReader();
Document doc = jrst.read(in);
-
-
+
+
String xmlexpected =
"<footnote_reference ids=\"id1\" refid=\"id2\">1</footnote_reference>" +
"</paragraph><footnote backrefs=\"id1\" ids=\"id2\" name=\"1\"><label>1</label>";
-
String actualXml = doc.asXML();
- log.warn("Result :\n" + actualXml);
- log.warn("Expected :\n" + xmlexpected);
+ assertXmlContain(fileName, actualXml, xmlexpected);
+ }
+
+ protected void assertXmlEqual(String fileName, String actualXml, String xmlexpected) {
+ log(fileName, actualXml, xmlexpected);
+
+ Assert.assertEquals(xmlexpected, actualXml);
+ }
+
+ protected void assertXmlContain(String fileName, String actualXml, String xmlexpected) {
+ log(fileName, actualXml, xmlexpected);
+
Assert.assertTrue(actualXml.contains(xmlexpected));
}
-
+ protected void log(String fileName, String actualXml, String xmlexpected) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Test file : " + fileName);
+ log.debug("Result :\n" + actualXml);
+ log.debug("Expected :\n" + xmlexpected);
+ }
+ }
}
Modified: trunk/jrst/src/test/java/org/nuiton/jrst/JRSTTest.java
===================================================================
--- trunk/jrst/src/test/java/org/nuiton/jrst/JRSTTest.java 2011-11-29 17:40:02 UTC (rev 629)
+++ trunk/jrst/src/test/java/org/nuiton/jrst/JRSTTest.java 2011-11-29 17:40:40 UTC (rev 630)
@@ -41,31 +41,11 @@
*
* @author chemit
*/
-public class JRSTTest {
+public class JRSTTest extends JRSTGeneratorTest {
/** to use log facility, just put in your code: log.info("..."); */
protected static Log log = LogFactory.getLog(JRSTTest.class);
- static File basedir;
-
- static File testBasedir;
-
- @BeforeClass
- public static void beforeClass() {
- String tmp = System.getProperty("basedir");
- if (tmp == null || tmp.isEmpty()) {
- tmp = new File("").getAbsolutePath();
- }
- basedir = new File(tmp);
- testBasedir = new File(basedir,
- "target" + File.separator +
- "tests" + File.separator +
- // "tests-" + System.nanoTime() + File.separator +
- JRSTTest.class.getName());
- testBasedir.mkdirs();
- log.info("test basedir : " + testBasedir);
- }
-
/**
* Test que les ressources sont bien dans le classpath.
*
@@ -86,7 +66,7 @@
@Test
public void generateRst() throws Exception {
- File in = new File(testBasedir, "toRst1-in.rst");
+ File in = new File(testWorkDir, "toRst1-in.rst");
List<String> IN_LINES = Arrays.asList(new String[]{
"=====",
@@ -120,7 +100,7 @@
FileUtils.writeLines(in, IN_LINES);
- File out = new File(testBasedir, "toRst1-out.rst");
+ File out = new File(testWorkDir, "toRst1-out.rst");
JRST.generate(JRST.TYPE_RST, in, out, JRST.Overwrite.ALLTIME);
@@ -139,9 +119,9 @@
@Test
public void generateHtml() throws Exception {
- File in = new File(basedir, "src/test/resources/text.rst");
+ File in = getTestFile("text.rst");
- File out = new File(testBasedir, "jrst-RstToHtml2.html");
+ File out = getOutputTestFile("jrst-RstToHtml2.html");
JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
Modified: trunk/jrst/src/test/java/org/nuiton/jrst/bugs/AdmonitionTest.java
===================================================================
--- trunk/jrst/src/test/java/org/nuiton/jrst/bugs/AdmonitionTest.java 2011-11-29 17:40:02 UTC (rev 629)
+++ trunk/jrst/src/test/java/org/nuiton/jrst/bugs/AdmonitionTest.java 2011-11-29 17:40:40 UTC (rev 630)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * JRst :: Api
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2004 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.jrst.bugs;
import org.apache.commons.io.FileUtils;
@@ -7,7 +31,9 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.nuiton.jrst.JRST;
+import org.nuiton.jrst.JRSTAbstractTest;
import org.nuiton.jrst.JRSTCompareDocutils;
+import org.nuiton.util.Resource;
import java.io.File;
import java.io.IOException;
@@ -17,16 +43,11 @@
*
* @author sletellier
*/
-public class AdmonitionTest {
+public class AdmonitionTest extends JRSTAbstractTest {
/** to use log facility, just put in your code: log.info(\"...\"); */
private static Log log = LogFactory.getLog(AdmonitionTest.class);
- @BeforeClass
- public static void beforeClass () throws IOException {
- JRSTCompareDocutils.prepareTmpDir();
- }
-
/**
* Test que les options des admonitions dans des listes sont bien parsée
* parsées.
@@ -35,15 +56,15 @@
*/
@Test
public void testAdmonitionInList() throws Exception {
- File in = new File("src/test/resources/bugs/testAdminitionInList1787.rst");
- File out = File.createTempFile("jrst-testAdminitionInList1787", ".html");
+ File in = getBugTestFile("testAdminitionInList1787.rst");
+ File out = getOutputTestFile("jrst-testAdminitionInList1787.html");
// out.deleteOnExit();
JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out);
// Must contains <div class="note">
- Assert.assertTrue(content.contains("<div class=\"note\">"));
+ assertTrue(content.contains("<div class=\"note\">"));
}
}
Modified: trunk/jrst/src/test/java/org/nuiton/jrst/bugs/DirectiveTest.java
===================================================================
--- trunk/jrst/src/test/java/org/nuiton/jrst/bugs/DirectiveTest.java 2011-11-29 17:40:02 UTC (rev 629)
+++ trunk/jrst/src/test/java/org/nuiton/jrst/bugs/DirectiveTest.java 2011-11-29 17:40:40 UTC (rev 630)
@@ -26,14 +26,11 @@
package org.nuiton.jrst.bugs;
import org.apache.commons.io.FileUtils;
-import org.junit.Assert;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.nuiton.jrst.JRST;
-import org.nuiton.jrst.JRSTCompareDocutils;
+import org.nuiton.jrst.JRSTAbstractTest;
import java.io.File;
-import java.io.IOException;
/**
* Test concernant les directives.
@@ -44,13 +41,8 @@
* Last update : $Date$
* By : $Author$
*/
-public class DirectiveTest {
+public class DirectiveTest extends JRSTAbstractTest {
- @BeforeClass
- public static void beforeClass () throws IOException {
- JRSTCompareDocutils.prepareTmpDir();
- }
-
/**
* Test que les options des directives images sont correctement
* parsées.
@@ -59,19 +51,19 @@
*/
@Test
public void testImageDirectiveOption() throws Exception {
- File in = new File("src/test/resources/bugs/testImages21.rst");
- File out = File.createTempFile("jrst-testImages", ".html");
+ File in = getBugTestFile("testImages21.rst");
+ File out = getOutputTestFile("jrst-testImages.html");
// out.deleteOnExit();
JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out);
- Assert.assertTrue(content.indexOf("alt=\"alternate text\"") > 0);
- Assert.assertTrue(content.indexOf("width=\"200 px\"") > 0);
- Assert.assertTrue(content.indexOf("align=\"center\"") > 0);
- Assert.assertTrue(content.indexOf("alt=\"tab alternate text\"") > 0);
+ assertTrue(content.indexOf("alt=\"alternate text\"") > 0);
+ assertTrue(content.indexOf("width=\"200 px\"") > 0);
+ assertTrue(content.indexOf("align=\"center\"") > 0);
+ assertTrue(content.indexOf("alt=\"tab alternate text\"") > 0);
// scale
- Assert.assertTrue(content.indexOf("alt=\"tab alternate text\"") > 0);
- Assert.assertTrue(content.indexOf("width=\"49%\" height=\"49%\"") > 0);
+ assertTrue(content.indexOf("alt=\"tab alternate text\"") > 0);
+ assertTrue(content.indexOf("width=\"49%\" height=\"49%\"") > 0);
}
/**
@@ -81,12 +73,12 @@
*/
@Test
public void testContentDirective() throws Exception {
- File in = new File("src/test/resources/bugs/testContent877.rst");
- File out = File.createTempFile("jrst-testContent", ".html");
+ File in = getBugTestFile("testContent877.rst");
+ File out = getOutputTestFile("jrst-testContent.html");
// out.deleteOnExit();
JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out);
- Assert.assertTrue(content.indexOf("Table des matières") > 0);
+ assertTrue(content.indexOf("Table des matières") > 0);
}
}
Modified: trunk/jrst/src/test/java/org/nuiton/jrst/bugs/InfiniteLoopTest.java
===================================================================
--- trunk/jrst/src/test/java/org/nuiton/jrst/bugs/InfiniteLoopTest.java 2011-11-29 17:40:02 UTC (rev 629)
+++ trunk/jrst/src/test/java/org/nuiton/jrst/bugs/InfiniteLoopTest.java 2011-11-29 17:40:40 UTC (rev 630)
@@ -29,6 +29,7 @@
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.nuiton.jrst.JRSTAbstractTest;
import org.nuiton.jrst.JRSTCompareDocutils;
import org.nuiton.jrst.JRSTReader;
import org.nuiton.jrst.JRSTReaderTest;
@@ -47,7 +48,7 @@
* Last update : $Date$
* By : $Author$
*/
-public class InfiniteLoopTest {
+public class InfiniteLoopTest extends JRSTAbstractTest {
@BeforeClass
public static void beforeClass () throws IOException {
Modified: trunk/jrst/src/test/java/org/nuiton/jrst/bugs/OptionTest.java
===================================================================
--- trunk/jrst/src/test/java/org/nuiton/jrst/bugs/OptionTest.java 2011-11-29 17:40:02 UTC (rev 629)
+++ trunk/jrst/src/test/java/org/nuiton/jrst/bugs/OptionTest.java 2011-11-29 17:40:40 UTC (rev 630)
@@ -1,3 +1,27 @@
+/*
+ * #%L
+ * JRst :: Api
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2004 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
package org.nuiton.jrst.bugs;
import org.apache.commons.io.FileUtils;
@@ -7,6 +31,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.nuiton.jrst.JRST;
+import org.nuiton.jrst.JRSTAbstractTest;
import org.nuiton.jrst.JRSTCompareDocutils;
import java.io.File;
@@ -17,16 +42,11 @@
*
* @author sletellier
*/
-public class OptionTest {
+public class OptionTest extends JRSTAbstractTest {
/** to use log facility, just put in your code: log.info(\"...\"); */
private static Log log = LogFactory.getLog(AdmonitionTest.class);
- @BeforeClass
- public static void beforeClass () throws IOException {
- JRSTCompareDocutils.prepareTmpDir();
- }
-
/**
* Test que les options des options dans des listes sont bien parsée
* parsées.
@@ -35,8 +55,8 @@
*/
@Test
public void testOptionArgumentSizeInList() throws Exception {
- File in = new File("src/test/resources/bugs/testOptionArgumentSize1788.rst");
- File out = File.createTempFile("jrst-testOptionArgumentSize1788", ".html");
+ File in = getBugTestFile("testOptionArgumentSize1788.rst");
+ File out = getOutputTestFile("jrst-testOptionArgumentSize1788.html");
JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
}
Modified: trunk/jrst/src/test/java/org/nuiton/jrst/bugs/TableTest.java
===================================================================
--- trunk/jrst/src/test/java/org/nuiton/jrst/bugs/TableTest.java 2011-11-29 17:40:02 UTC (rev 629)
+++ trunk/jrst/src/test/java/org/nuiton/jrst/bugs/TableTest.java 2011-11-29 17:40:40 UTC (rev 630)
@@ -30,6 +30,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.nuiton.jrst.JRST;
+import org.nuiton.jrst.JRSTAbstractTest;
import org.nuiton.jrst.JRSTCompareDocutils;
import java.io.File;
@@ -44,12 +45,7 @@
* Last update : $Date$
* By : $Author$
*/
-public class TableTest {
-
- @BeforeClass
- public static void beforeClass () throws IOException {
- JRSTCompareDocutils.prepareTmpDir();
- }
+public class TableTest extends JRSTAbstractTest {
/**
* Test que la présence d'un caractères | ne fait pas planter
@@ -59,14 +55,14 @@
*/
@Test
public void testTableSpecialChar() throws Exception {
- File in = new File("src/test/resources/bugs/testTable1290.rst");
- File out = File.createTempFile("jrst-tables", ".html");
+ File in = getBugTestFile("testTable1290.rst");
+ File out = getOutputTestFile("jrst-tables.html");
// out.deleteOnExit();
JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out);
- Assert.assertTrue(content.indexOf("Annee|Trait|Espece") > 0);
- Assert.assertTrue(content.indexOf("<p>Fatal</p>") > 0);
+ assertTrue(content.indexOf("Annee|Trait|Espece") > 0);
+ assertTrue(content.indexOf("<p>Fatal</p>") > 0);
}
/**
@@ -76,12 +72,12 @@
*/
@Test
public void testTableIndentation() throws Exception {
- File in = new File("src/test/resources/bugs/testTable1375.rst");
- File out = File.createTempFile("jrst-tables", ".html");
+ File in = getBugTestFile("testTable1375.rst");
+ File out = getOutputTestFile("jrst-tables.html");
// out.deleteOnExit();
JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out);
- Assert.assertTrue(content.indexOf("<em>légérs</em>") > 0);
+ assertTrue(content.indexOf("<em>légérs</em>") > 0);
}
}
Modified: trunk/jrst/src/test/java/org/nuiton/jrst/bugs/TextTest.java
===================================================================
--- trunk/jrst/src/test/java/org/nuiton/jrst/bugs/TextTest.java 2011-11-29 17:40:02 UTC (rev 629)
+++ trunk/jrst/src/test/java/org/nuiton/jrst/bugs/TextTest.java 2011-11-29 17:40:40 UTC (rev 630)
@@ -25,16 +25,13 @@
package org.nuiton.jrst.bugs;
-import junit.framework.Assert;
import org.apache.commons.io.FileUtils;
-import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.nuiton.jrst.JRST;
-import org.nuiton.jrst.JRSTCompareDocutils;
+import org.nuiton.jrst.JRSTAbstractTest;
import java.io.File;
-import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -47,13 +44,8 @@
* Last update : $Date$
* By : $Author$
*/
-public class TextTest {
+public class TextTest extends JRSTAbstractTest {
- @BeforeClass
- public static void beforeClass () throws IOException {
- JRSTCompareDocutils.prepareTmpDir();
- }
-
/**
* Test que les liens avec parametres sont correctement parsés.
*
@@ -61,15 +53,15 @@
*/
@Test
public void testLinksParameters() throws Exception {
- File in = new File("src/test/resources/bugs/testLinks.rst");
- File out = File.createTempFile("jrst-testLinks", ".html");
-// out.deleteOnExit();
+ File in = getBugTestFile("testLinks.rst");
+ File out = getOutputTestFile("jrst-testLinks.html");
+
JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out);
- Assert.assertTrue(content.indexOf("href=\"http://labs.libre-entreprise.org/tracker/?atid=113&group_id=8&func=…"") > 0);
- Assert.assertTrue(content.indexOf("href=\"http://www.docbook.org/\"") > 0);
- Assert.assertTrue(content.indexOf("href=\"http://www.docbook2.org/\"") > 0);
+ assertTrue(content.indexOf("href=\"http://labs.libre-entreprise.org/tracker/?atid=113&group_id=8&func=…"") > 0);
+ assertTrue(content.indexOf("href=\"http://www.docbook.org/\"") > 0);
+ assertTrue(content.indexOf("href=\"http://www.docbook2.org/\"") > 0);
}
/**
@@ -80,14 +72,14 @@
*/
@Test
public void testLinksSpecialCharacters() throws Exception {
- File in = new File("src/test/resources/bugs/testLinks1380.rst");
- File out = File.createTempFile("jrst-testLinks", ".html");
-// out.deleteOnExit();
+ File in = getBugTestFile("testLinks1380.rst");
+ File out = getOutputTestFile("jrst-testLinks.html");
+
JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out);
- Assert.assertTrue(content.indexOf("nuiton's forge") > 0);
- Assert.assertTrue(content.indexOf("build.xml") > 0);
+ assertTrue(content.indexOf("nuiton's forge") > 0);
+ assertTrue(content.indexOf("build.xml") > 0);
}
/**
@@ -98,15 +90,15 @@
*/
@Test
public void testTabCharacter() throws Exception {
- File in = new File("src/test/resources/bugs/testTab1378.rst");
- File out = File.createTempFile("jrst-testTab1378", ".html");
-// out.deleteOnExit();
+ File in = getBugTestFile("testTab1378.rst");
+ File out = getOutputTestFile("jrst-testTab1378.html");
+
JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out);
Pattern pattern = Pattern.compile(".*<blockquote>.*du bla bla \u00E9l\u00E9mentaire.*</blockquote>.*", Pattern.DOTALL);
Matcher matcher = pattern.matcher(content);
- Assert.assertTrue(matcher.find());
+ assertTrue(matcher.find());
}
/**
@@ -116,18 +108,18 @@
*/
@Test
public void testOptionLists() throws Exception {
- File in = new File("src/test/resources/bugs/testOptionsList644.rst");
- File out = File.createTempFile("jrst-testOptionList644", ".html");
-// out.deleteOnExit();
+ File in = getBugTestFile("testOptionsList644.rst");
+ File out = getOutputTestFile("jrst-testOptionList644.html");
+
JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out);
- Assert.assertTrue(content.indexOf("<span class=\"option\">-a</span>") > 0);
- Assert.assertTrue(content.indexOf("<p>options can have arguments and long descriptions</p>") > 0);
- Assert.assertTrue(content.indexOf("<v3region.zip|v2region.xml|v2region.xml.gz>") > 0);
- Assert.assertTrue(content.indexOf("<span class=\"option\">--importRegion") > 0);
- Assert.assertTrue(content.indexOf("<span class=\"option\">/V</span>") > 0);
- Assert.assertTrue(content.indexOf("<p>DOS/VMS-style options too</p>") > 0);
+ assertTrue(content.indexOf("<span class=\"option\">-a</span>") > 0);
+ assertTrue(content.indexOf("<p>options can have arguments and long descriptions</p>") > 0);
+ assertTrue(content.indexOf("<v3region.zip|v2region.xml|v2region.xml.gz>") > 0);
+ assertTrue(content.indexOf("<span class=\"option\">--importRegion") > 0);
+ assertTrue(content.indexOf("<span class=\"option\">/V</span>") > 0);
+ assertTrue(content.indexOf("<p>DOS/VMS-style options too</p>") > 0);
}
/**
@@ -140,13 +132,13 @@
@Test
@Ignore
public void testLinkEscape() throws Exception {
- File in = new File("src/test/resources/bugs/testLinks.rst");
- File out = File.createTempFile("jrst-testLinks", ".html");
-// out.deleteOnExit();
+ File in = getBugTestFile("testLinks.rst");
+ File out = getOutputTestFile("jrst-testLinks.html");
+
JRST.generate(JRST.TYPE_HTML, in, out, JRST.Overwrite.ALLTIME);
String content = FileUtils.readFileToString(out);
- Assert.assertTrue(content.indexOf("echapement de lien1_") > 0);
- Assert.assertTrue(content.indexOf("echapement de *.txt") > 0);
+ assertTrue(content.indexOf("echapement de lien1_") > 0);
+ assertTrue(content.indexOf("echapement de *.txt") > 0);
}
}
Modified: trunk/jrst/src/test/java/org/nuiton/jrst/bugs/TitlesTest.java
===================================================================
--- trunk/jrst/src/test/java/org/nuiton/jrst/bugs/TitlesTest.java 2011-11-29 17:40:02 UTC (rev 629)
+++ trunk/jrst/src/test/java/org/nuiton/jrst/bugs/TitlesTest.java 2011-11-29 17:40:40 UTC (rev 630)
@@ -30,6 +30,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.nuiton.jrst.JRST;
+import org.nuiton.jrst.JRSTAbstractTest;
import org.nuiton.jrst.JRSTCompareDocutils;
import java.io.File;
@@ -44,7 +45,7 @@
* Last update : $Date$
* By : $Author$
*/
-public class TitlesTest {
+public class TitlesTest extends JRSTAbstractTest {
@BeforeClass
public static void beforeClass () throws IOException {
Modified: trunk/jrst/src/test/resources/bugs/testAdminitionInList1787.rst
===================================================================
--- trunk/jrst/src/test/resources/bugs/testAdminitionInList1787.rst 2011-11-29 17:40:02 UTC (rev 629)
+++ trunk/jrst/src/test/resources/bugs/testAdminitionInList1787.rst 2011-11-29 17:40:40 UTC (rev 630)
@@ -1,3 +1,27 @@
+.. -
+.. * #%L
+.. * JRst :: Api
+.. *
+.. * $Id$
+.. * $HeadURL$
+.. * %%
+.. * Copyright (C) 2004 - 2011 CodeLutin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 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 Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
* item
.. Note:: note
Modified: trunk/jrst/src/test/resources/bugs/testOptionArgumentSize1788.rst
===================================================================
--- trunk/jrst/src/test/resources/bugs/testOptionArgumentSize1788.rst 2011-11-29 17:40:02 UTC (rev 629)
+++ trunk/jrst/src/test/resources/bugs/testOptionArgumentSize1788.rst 2011-11-29 17:40:40 UTC (rev 630)
@@ -1,2 +1,26 @@
+.. -
+.. * #%L
+.. * JRst :: Api
+.. *
+.. * $Id$
+.. * $HeadURL$
+.. * %%
+.. * Copyright (C) 2004 - 2011 CodeLutin
+.. * %%
+.. * This program is free software: you can redistribute it and/or modify
+.. * it under the terms of the GNU Lesser General Public License as
+.. * published by the Free Software Foundation, either version 3 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 Lesser Public License for more details.
+.. *
+.. * You should have received a copy of the GNU General Lesser Public
+.. * License along with this program. If not, see
+.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+.. * #L%
+.. -
--import <file.zip>
1
0
r629 - trunk/doxia-module-jrst/src/main/java/org/nuiton/jrst
by sletellier@users.nuiton.org 29 Nov '11
by sletellier@users.nuiton.org 29 Nov '11
29 Nov '11
Author: sletellier
Date: 2011-11-29 18:40:02 +0100 (Tue, 29 Nov 2011)
New Revision: 629
Url: http://nuiton.org/repositories/revision/jrst/629
Log:
Use JRSTResourceResolver to transform to xdoc
Modified:
trunk/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java
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 2011-11-29 17:38:54 UTC (rev 628)
+++ trunk/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java 2011-11-29 17:40:02 UTC (rev 629)
@@ -25,13 +25,16 @@
package org.nuiton.jrst;
+import java.io.FileNotFoundException;
import java.io.Reader;
import java.io.StringReader;
+import java.net.URL;
import org.apache.maven.doxia.module.xdoc.XdocParser;
import org.apache.maven.doxia.parser.ParseException;
import org.apache.maven.doxia.sink.Sink;
import org.dom4j.Document;
+import org.nuiton.util.Resource;
/**
* Parse an RST model, transform it into xdoc model and emit events into the
@@ -54,8 +57,20 @@
Document doc = jrst.read(source);
// Apply xsl on rst RST Document
- doc = JRST.applyXsls(doc, JRST.rst2xdoc);
+ JRSTGenerator gen = new JRSTGenerator();
+ String xsl = JRST.rst2xdoc;
+ URL stylesheet = Resource.getURL(xsl);
+ if (stylesheet == null) {
+ throw new FileNotFoundException("Can't find stylesheet: "
+ + xsl);
+ }
+ // add entity resolver
+ gen.setUriResolver(new JRSTResourceResolver(xsl));
+
+ // do transformation
+ doc = gen.transform(doc, stylesheet);
+
// Give xsl result to XDoc parser
Reader reader = new StringReader(doc.asXML());
super.parse(reader, sink);
1
0
29 Nov '11
Author: sletellier
Date: 2011-11-29 18:38:54 +0100 (Tue, 29 Nov 2011)
New Revision: 628
Url: http://nuiton.org/repositories/revision/jrst/628
Log:
Introduce JRSTResourceResolver extends FasterCachedResourceResolver and if not found, resolve in xsl
Added:
trunk/jrst/src/main/java/org/nuiton/jrst/JRSTResourceResolver.java
Modified:
trunk/jrst/src/main/java/org/nuiton/jrst/JRST.java
trunk/jrst/src/main/java/org/nuiton/jrst/JRSTGenerator.java
Modified: trunk/jrst/src/main/java/org/nuiton/jrst/JRST.java
===================================================================
--- trunk/jrst/src/main/java/org/nuiton/jrst/JRST.java 2011-11-29 09:13:20 UTC (rev 627)
+++ trunk/jrst/src/main/java/org/nuiton/jrst/JRST.java 2011-11-29 17:38:54 UTC (rev 628)
@@ -22,7 +22,6 @@
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
*/
-
package org.nuiton.jrst;
import java.awt.GraphicsDevice;
@@ -34,20 +33,14 @@
import java.util.Locale;
import java.util.Map;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.URIResolver;
import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamSource;
-import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -64,10 +57,6 @@
import org.nuiton.util.FileUtil;
import org.nuiton.util.Resource;
import org.nuiton.util.StringUtil;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
/**
* FIXME: 'JRST --help' doesn't work, but 'JRST --help toto' work :( FIXME:
@@ -397,7 +386,7 @@
return doc.asXML();
}
- protected static Document applyXsls(Document doc, String xslListOrOutType) throws IOException, FileNotFoundException, TransformerException {
+ private static Document applyXsls(Document doc, String xslListOrOutType) throws IOException, TransformerException {
// search xsl file list to apply
String xslList = stylesheets.get(xslListOrOutType);
@@ -422,74 +411,10 @@
+ xsl);
}
- final String finalXsl = xsl;
-
// add entity resolver
- gen.setUriResolver(new URIResolver() {
- public Source resolve(String href, String base) {
- if (log.isDebugEnabled()) {
- log.debug("RESOLVING: href: "+href+" base: "+base);
- }
- String xslDir = finalXsl.substring(0, finalXsl.lastIndexOf('/') + 1);
- String resouceFullName = xslDir + href;
+ gen.setUriResolver(new JRSTResourceResolver(xsl));
- if (log.isDebugEnabled()) {
- log.debug("RESOLVING: resouceFullName: "+resouceFullName);
- }
-
- try {
- InputStream stream = null;
- File file = new File(resouceFullName);
- if (file.exists()) {
- stream = new FileInputStream(file);
- } else {
- try {
- stream = Resource.getURL(resouceFullName).openStream();
- }
- catch (Exception e) {
- stream = Resource.getURL("/docbook/common/" + href).openStream();
- }
- }
-
- SAXParserFactory parserFactory = SAXParserFactory.newInstance();
- SAXParser saxParser = parserFactory.newSAXParser();
- XMLReader xmlReader = saxParser.getXMLReader();
- xmlReader.setEntityResolver(new EntityResolver() {
- @Override
- public InputSource resolveEntity(String publicId, String systemId)
- throws SAXException, IOException {
-
- InputSource source = null;
-
- String smallSystemId = systemId.substring(systemId.lastIndexOf("/") + 1);
- URL url = Resource.getURL("/docbook/common/" + smallSystemId);
- if (url != null) {
- if (log.isDebugEnabled()) {
- log.debug("Resolved entity url : " + url);
- }
- InputStream stream = url.openStream();
- source = new InputSource(stream);
- }
-
- return source;
- }
- });
- InputSource inSrc = new InputSource(stream);
- SAXSource saxs = new SAXSource(xmlReader, inSrc);
- return saxs;
- } catch (IOException e) {
- e.printStackTrace();
- return null;
- } catch (ParserConfigurationException e) {
- e.printStackTrace();
- return null;
- } catch (SAXException e) {
- e.printStackTrace();
- return null;
- }
- }
- });
-
+ // do transformation
doc = gen.transform(doc, stylesheet);
}
return doc;
Modified: trunk/jrst/src/main/java/org/nuiton/jrst/JRSTGenerator.java
===================================================================
--- trunk/jrst/src/main/java/org/nuiton/jrst/JRSTGenerator.java 2011-11-29 09:13:20 UTC (rev 627)
+++ trunk/jrst/src/main/java/org/nuiton/jrst/JRSTGenerator.java 2011-11-29 17:38:54 UTC (rev 628)
@@ -57,14 +57,11 @@
import static org.nuiton.jrst.ReStructuredText.TRANSITION;
import static org.nuiton.jrst.ReStructuredText.VERSION;
-import java.io.File;
import java.io.IOException;
import java.io.Writer;
-import java.net.MalformedURLException;
import java.net.URL;
import java.util.LinkedList;
-import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
@@ -83,9 +80,6 @@
import org.dom4j.io.DocumentSource;
import org.nuiton.util.FasterCachedResourceResolver;
import org.xml.sax.ContentHandler;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
/**
* Cette classe contient plusieurs methodes pour générer, soit en utilisant une
Added: trunk/jrst/src/main/java/org/nuiton/jrst/JRSTResourceResolver.java
===================================================================
--- trunk/jrst/src/main/java/org/nuiton/jrst/JRSTResourceResolver.java (rev 0)
+++ trunk/jrst/src/main/java/org/nuiton/jrst/JRSTResourceResolver.java 2011-11-29 17:38:54 UTC (rev 628)
@@ -0,0 +1,108 @@
+package org.nuiton.jrst;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.FasterCachedResourceResolver;
+import org.nuiton.util.Resource;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.Source;
+import javax.xml.transform.sax.SAXSource;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+/**
+ * @author sletellier <letellier(a)codelutin.com>
+ * @since 1.5
+ */
+public class JRSTResourceResolver extends FasterCachedResourceResolver {
+
+ static private Log log = LogFactory.getLog(JRSTResourceResolver.class);
+
+ protected String xsl;
+
+ public JRSTResourceResolver(String xsl) {
+ this.xsl = xsl;
+ }
+
+ @Override
+ public Source resolve(String href, String base) {
+
+ // Try first with faster resource resolver
+ Source resolved = super.resolve(href, base);
+ if (resolved != null) {
+ return resolved;
+ }
+
+ // If not found, try to find in xsl
+ if (log.isDebugEnabled()) {
+ log.debug("RESOLVING: href: "+href+" base: "+base);
+ }
+ String xslDir = xsl.substring(0, xsl.lastIndexOf('/') + 1);
+ String resouceFullName = xslDir + href;
+
+ if (log.isDebugEnabled()) {
+ log.debug("RESOLVING: resouceFullName: "+resouceFullName);
+ }
+
+ try {
+ InputStream stream = null;
+ File file = new File(resouceFullName);
+ if (file.exists()) {
+ stream = new FileInputStream(file);
+ } else {
+ try {
+ stream = Resource.getURL(resouceFullName).openStream();
+ }
+ catch (Exception e) {
+ stream = Resource.getURL("/docbook/common/" + href).openStream();
+ }
+ }
+
+ SAXParserFactory parserFactory = SAXParserFactory.newInstance();
+ SAXParser saxParser = parserFactory.newSAXParser();
+ XMLReader xmlReader = saxParser.getXMLReader();
+ xmlReader.setEntityResolver(new EntityResolver() {
+ @Override
+ public InputSource resolveEntity(String publicId, String systemId)
+ throws SAXException, IOException {
+
+ InputSource source = null;
+
+ String smallSystemId = systemId.substring(systemId.lastIndexOf("/") + 1);
+ URL url = Resource.getURL("/docbook/common/" + smallSystemId);
+ if (url != null) {
+ if (log.isDebugEnabled()) {
+ log.debug("Resolved entity url : " + url);
+ }
+ InputStream stream = url.openStream();
+ source = new InputSource(stream);
+ }
+
+ return source;
+ }
+ });
+ InputSource inSrc = new InputSource(stream);
+ SAXSource saxs = new SAXSource(xmlReader, inSrc);
+ return saxs;
+ } catch (IOException e) {
+ e.printStackTrace();
+ return null;
+ } catch (ParserConfigurationException e) {
+ e.printStackTrace();
+ return null;
+ } catch (SAXException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+}
1
0
r627 - in trunk: doxia-module-jrst doxia-module-jrst/src/main/java/org/nuiton/jrst jrst/src/main/java/org/nuiton/jrst
by sletellier@users.nuiton.org 29 Nov '11
by sletellier@users.nuiton.org 29 Nov '11
29 Nov '11
Author: sletellier
Date: 2011-11-29 10:13:20 +0100 (Tue, 29 Nov 2011)
New Revision: 627
Url: http://nuiton.org/repositories/revision/jrst/627
Log:
Fix test in fail
Modified:
trunk/doxia-module-jrst/pom.xml
trunk/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java
trunk/jrst/src/main/java/org/nuiton/jrst/JRST.java
Modified: trunk/doxia-module-jrst/pom.xml
===================================================================
--- trunk/doxia-module-jrst/pom.xml 2011-11-28 22:21:16 UTC (rev 626)
+++ trunk/doxia-module-jrst/pom.xml 2011-11-29 09:13:20 UTC (rev 627)
@@ -88,7 +88,7 @@
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
- <scope>runtime</scope>
+ <!--<scope>runtime</scope>-->
</dependency>
<dependency>
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 2011-11-28 22:21:16 UTC (rev 626)
+++ trunk/doxia-module-jrst/src/main/java/org/nuiton/jrst/JrstParser.java 2011-11-29 09:13:20 UTC (rev 627)
@@ -25,10 +25,8 @@
package org.nuiton.jrst;
-import java.io.FileNotFoundException;
import java.io.Reader;
import java.io.StringReader;
-import java.net.URL;
import org.apache.maven.doxia.module.xdoc.XdocParser;
import org.apache.maven.doxia.parser.ParseException;
@@ -46,8 +44,6 @@
*/
public class JrstParser extends XdocParser {
- protected final static String RST2XDOC = "/xsl/rst2xdoc.xsl";
-
@Override
public void parse(Reader source, Sink sink) throws ParseException {
@@ -58,13 +54,7 @@
Document doc = jrst.read(source);
// Apply xsl on rst RST Document
- JRSTGenerator gen = new JRSTGenerator();
- URL stylesheet = JrstParser.class.getResource(RST2XDOC);
- if (stylesheet == null) {
- throw new FileNotFoundException("Can't find stylesheet: "
- + RST2XDOC);
- }
- doc = gen.transform(doc, stylesheet);
+ doc = JRST.applyXsls(doc, JRST.rst2xdoc);
// Give xsl result to XDoc parser
Reader reader = new StringReader(doc.asXML());
Modified: trunk/jrst/src/main/java/org/nuiton/jrst/JRST.java
===================================================================
--- trunk/jrst/src/main/java/org/nuiton/jrst/JRST.java 2011-11-28 22:21:16 UTC (rev 626)
+++ trunk/jrst/src/main/java/org/nuiton/jrst/JRST.java 2011-11-29 09:13:20 UTC (rev 627)
@@ -396,13 +396,9 @@
}
return doc.asXML();
}
-
-
-
+ protected static Document applyXsls(Document doc, String xslListOrOutType) throws IOException, FileNotFoundException, TransformerException {
- private static Document applyXsls(Document doc, String xslListOrOutType) throws IOException, FileNotFoundException, TransformerException {
-
// search xsl file list to apply
String xslList = stylesheets.get(xslListOrOutType);
if (xslListOrOutType == null) {
1
0
Author: maven-release
Date: 2011-11-28 23:21:16 +0100 (Mon, 28 Nov 2011)
New Revision: 626
Url: http://nuiton.org/repositories/revision/jrst/626
Log:
Update mavenpom4redmineAndCentral to 3.0.6.
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-10-28 21:25:19 UTC (rev 625)
+++ trunk/pom.xml 2011-11-28 22:21:16 UTC (rev 626)
@@ -33,7 +33,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmineAndCentral</artifactId>
- <version>3.0.5</version>
+ <version>3.0.6</version>
</parent>
<artifactId>jrst</artifactId>
1
0