pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1810020 - /pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java
Date Thu, 28 Sep 2017 17:57:11 GMT
Author: tilman
Date: Thu Sep 28 17:57:11 2017
New Revision: 1810020

URL: http://svn.apache.org/viewvc?rev=1810020&view=rev
Log:
PDFBOX-3934: add parse test of genko file because it's been susceptible to regression for
years

Modified:
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java?rev=1810020&r1=1810019&r2=1810020&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java Thu Sep
28 17:57:11 2017
@@ -197,6 +197,31 @@ public class TestPDFParser
         }
     }
 
+    /**
+     * Test parsing the "genko_oc_shiryo1.pdf" file, which is susceptible to regression.
+     * 
+     * @throws Exception 
+     */
+    @Test
+    public void testParseGenko() throws Exception
+    {
+        byte[] byteArray;
+        try
+        {
+            try (InputStream is = new URL("https://issues.apache.org/jira/secure/attachment/12867433/genko_oc_shiryo1.pdf").openStream())
+            {
+                byteArray = IOUtils.toByteArray(is);
+            }
+        }
+        catch (IOException ex)
+        {
+            System.err.println("URL loading failed, testParseGenko will be skipped");
+            return;
+        }
+
+        PDDocument.load(byteArray).close();
+    }
+
     private void executeParserTest(RandomAccessRead source, MemoryUsageSetting memUsageSetting)
throws IOException
     {
         ScratchFile scratchFile = new ScratchFile(memUsageSetting);



Mime
View raw message