pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msahy...@apache.org
Subject svn commit: r1646088 - /pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/TestFields.java
Date Tue, 16 Dec 2014 21:25:39 GMT
Author: msahyoun
Date: Tue Dec 16 21:25:39 2014
New Revision: 1646088

URL: http://svn.apache.org/r1646088
Log:
PDFBOX-2516 enhance tests for rich text attributes DS, RV

Modified:
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/TestFields.java

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/TestFields.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/TestFields.java?rev=1646088&r1=1646087&r2=1646088&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/TestFields.java
(original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/TestFields.java
Tue Dec 16 21:25:39 2014
@@ -161,6 +161,20 @@ public class TestFields extends TestCase
             assertNotNull(field);
             assertEquals(((COSString) field.getDefaultValue()).getString(),"DefaultValue");
             assertEquals(field.getDefaultValue(),field.getDictionary().getDictionaryObject(COSName.DV));
+            assertEquals(((PDVariableText)field).getDefaultAppearance().getString(),"/Helv
12 Tf 0 g");
+
+            // get a rich text field with a  DV entry
+            field = form.getField("RichTextField-DefaultValue");
+            assertNotNull(field);
+            assertEquals(((COSString) field.getDefaultValue()).getString(),"DefaultValue");
+            assertEquals(field.getDefaultValue(),field.getDictionary().getDictionaryObject(COSName.DV));
+            assertEquals(((COSString)field.getValue()).getString(), "DefaultValue");
+            assertEquals(((PDVariableText)field).getDefaultAppearance().getString(), "/Helv
12 Tf 0 g");
+            assertEquals(((PDVariableText)field).getDefaultStyleString().getString(),
+                    "font: Helvetica,sans-serif 12.0pt; text-align:left; color:#000000 ");
+            // do not test for the full content as this is a rather long xml string
+            assertEquals(((PDVariableText)field).getRichTextValue().length(),338);
+            
             
         }
         finally



Mime
View raw message