From 74ad4fd2236a498b2fdab1790b433b00037122c8 Mon Sep 17 00:00:00 2001 From: Luis Bernardo Date: Fri, 12 Jul 2013 23:24:40 +0000 Subject: [PATCH] FOP-2271: XSL Infinite loop; test case: patch submitted by Simon Steiner. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1502725 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/BasicDriverTestCase.java | 13 ++++++++++ test/xsl/iloop.xsl | 24 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 test/xsl/iloop.xsl diff --git a/test/java/org/apache/fop/BasicDriverTestCase.java b/test/java/org/apache/fop/BasicDriverTestCase.java index a504821d4..f149b451e 100644 --- a/test/java/org/apache/fop/BasicDriverTestCase.java +++ b/test/java/org/apache/fop/BasicDriverTestCase.java @@ -28,6 +28,7 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.sax.SAXResult; import javax.xml.transform.stream.StreamSource; +import org.apache.fop.apps.FOPException; import org.junit.Test; import org.apache.commons.io.output.ByteArrayOutputStream; @@ -126,4 +127,16 @@ public class BasicDriverTestCase { assertTrue("Generated PDF has zero length", baout.size() > 0); } + @Test + public void testXSLILoop() throws Exception { + FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); + File xmlFile = new File(getBaseDir(), "test/xml/1.xml"); + File xsltFile = new File(getBaseDir(), "test/xsl/iloop.xsl"); + ByteArrayOutputStream baout = new ByteArrayOutputStream(); + InputHandler handler = new InputHandler(xmlFile, xsltFile, null); + try { + handler.renderTo(foUserAgent, MimeConstants.MIME_PDF, baout); + } catch (FOPException e) {} + } + } diff --git a/test/xsl/iloop.xsl b/test/xsl/iloop.xsl new file mode 100644 index 000000000..2efdfb068 --- /dev/null +++ b/test/xsl/iloop.xsl @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- 2.39.5