pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1678573 - /pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/text/TestTextStripper.java
Date Sun, 10 May 2015 15:58:13 GMT
Author: tilman
Date: Sun May 10 15:58:13 2015
New Revision: 1678573

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

Modified:
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/text/TestTextStripper.java

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/text/TestTextStripper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/text/TestTextStripper.java?rev=1678573&r1=1678572&r2=1678573&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/text/TestTextStripper.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/text/TestTextStripper.java Sun May
10 15:58:13 2015
@@ -355,7 +355,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
      */
@@ -418,6 +419,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