pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1678574 - /pdfbox/branches/1.8/pdfbox/src/test/java/org/apache/pdfbox/util/TestTextStripper.java
Date Sun, 10 May 2015 15:58:23 GMT
Author: tilman
Date: Sun May 10 15:58:23 2015
New Revision: 1678574

URL: http://svn.apache.org/r1678574
Log:
PDFBOX-2792: add test with orphan bookmark

Modified:
    pdfbox/branches/1.8/pdfbox/src/test/java/org/apache/pdfbox/util/TestTextStripper.java

Modified: pdfbox/branches/1.8/pdfbox/src/test/java/org/apache/pdfbox/util/TestTextStripper.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/test/java/org/apache/pdfbox/util/TestTextStripper.java?rev=1678574&r1=1678573&r2=1678574&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/test/java/org/apache/pdfbox/util/TestTextStripper.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/test/java/org/apache/pdfbox/util/TestTextStripper.java
Sun May 10 15:58:23 2015
@@ -416,7 +416,8 @@ public class TestTextStripper extends Te
      * text stripping by outlines pointing to 0-based pages 2 and 3, and also text stripping
of the
      * 0-based page 2. The test makes sure that the output is different to a complete strip,
not
      * empty, different to each other when different bookmark intervals are used, but identical
from
-     * bookmark intervals to strips with page intervals.
+     * bookmark intervals to strips with page intervals. When fed with orphan bookmarks,
stripping
+     * must be empty.
      *
      * @throws IOException
      */
@@ -477,6 +478,13 @@ public class TestTextStripper extends Te
         assertFalse(textp3.equals(textp34));
         assertFalse(textoi23.equals(textFull));
         assertTrue(textoi2.equals(textp3));
+        
+        // Test with orphan bookmark
+        PDOutlineItem oiOrphan = new PDOutlineItem();
+        stripper.setStartBookmark(oiOrphan);
+        stripper.setEndBookmark(oiOrphan);
+        String textOiOrphan = stripper.getText(doc);
+        assertTrue(textOiOrphan.isEmpty());
     }
 
     



Mime
View raw message