Author: lehmi
Date: Sun Jul 11 11:15:18 2021
New Revision: 1891444

URL: http://svn.apache.org/viewvc?rev=1891444&view=rev
Log:
PDFBOX-5236: add assertion to test case, sonar fix

Modified:
    
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDPageContentStream.java

Modified: 
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDPageContentStream.java
URL: 
http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDPageContentStream.java?rev=1891444&r1=1891443&r2=1891444&view=diff
==============================================================================
--- 
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDPageContentStream.java
 (original)
+++ 
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDPageContentStream.java
 Sun Jul 11 11:15:18 2021
@@ -191,21 +191,28 @@ public class TestPDPageContentStream ext
         PDPage page = new PDPage();
         doc.addPage(page);
         PDPageContentStream contentStream = new PDPageContentStream(doc, page);
-        contentStream.beginText();
-        // J
-        contentStream.setLineCapStyle(0);
-        // j
-        contentStream.setLineJoinStyle(0);
-        // w
-        contentStream.setLineWidth(10f);
-        // d
-        contentStream.setLineDashPattern(new float[] { 2, 1 }, 0f);
-        // M
-        contentStream.setMiterLimit(1.0f);
-        // gs
-        contentStream.setGraphicsStateParameters(new 
PDExtendedGraphicsState());
-        // ri, i are not supported with a specific setter
-        contentStream.endText();
+        try
+        {
+            contentStream.beginText();
+            // J
+            contentStream.setLineCapStyle(0);
+            // j
+            contentStream.setLineJoinStyle(0);
+            // w
+            contentStream.setLineWidth(10f);
+            // d
+            contentStream.setLineDashPattern(new float[] { 2, 1 }, 0f);
+            // M
+            contentStream.setMiterLimit(1.0f);
+            // gs
+            contentStream.setGraphicsStateParameters(new 
PDExtendedGraphicsState());
+            // ri, i are not supported with a specific setter
+            contentStream.endText();
+        }
+        catch (IllegalArgumentException exception)
+        {
+            fail(exception.getCause().getMessage());
+        }
         contentStream.close();
     }
 


Reply via email to