pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msahy...@apache.org
Subject svn commit: r1688719 - in /pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form: PDButtonTest.java TestFields.java
Date Wed, 01 Jul 2015 19:48:54 GMT
Author: msahyoun
Date: Wed Jul  1 19:48:54 2015
New Revision: 1688719

URL: http://svn.apache.org/r1688719
Log:
PDFBOX-2849: fix test failure, move test to individual test class

Modified:
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/PDButtonTest.java
    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/PDButtonTest.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/PDButtonTest.java?rev=1688719&r1=1688718&r2=1688719&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/PDButtonTest.java
(original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/interactive/form/PDButtonTest.java
Wed Jul  1 19:48:54 2015
@@ -18,6 +18,7 @@ package org.apache.pdfbox.pdmodel.intera
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import java.io.File;
@@ -94,8 +95,9 @@ public class PDButtonTest
     public void retrieveAcrobatCheckBoxProperties() throws IOException
     {
         PDCheckbox checkbox = (PDCheckbox) acrobatAcroForm.getField("Checkbox");
+        assertNotNull(checkbox);
         assertEquals(checkbox.getOnValue(), "Yes");
-        assertEquals(checkbox.getOnValues().size(),1);
+        assertEquals(checkbox.getOnValues().size(), 1);
         assertEquals(checkbox.getOnValues().get(0), "Yes");
     }
     
@@ -133,9 +135,10 @@ public class PDButtonTest
     public void testAcrobatradioButtonProperties() throws IOException
     {
         PDRadioButton radioButton = (PDRadioButton) acrobatAcroForm.getField("RadioButtonGroup");
-        assertEquals(radioButton.getOnValues().size(),2);
-        assertEquals(radioButton.getOnValues().get(0),"RadioButton01");
-        assertEquals(radioButton.getOnValues().get(1),"RadioButton02");
+        assertNotNull(radioButton);
+        assertEquals(radioButton.getOnValues().size(), 2);
+        assertEquals(radioButton.getOnValues().get(0), "RadioButton01");
+        assertEquals(radioButton.getOnValues().get(1), "RadioButton02");
     }
     
     

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=1688719&r1=1688718&r2=1688719&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
Wed Jul  1 19:48:54 2015
@@ -154,19 +154,6 @@ public class TestFields extends TestCase
             textField.setValue(null);
             assertNull(textField.getCOSObject().getItem(COSName.V));
             
-            // get the RadioButton with a DV entry
-            PDRadioButton radio = (PDRadioButton)form.getField("RadioButtonGroup-DefaultValue");
-            assertNotNull(radio);
-            assertEquals(radio.getDefaultValue(),"RadioButton01");
-            assertEquals(COSName.getPDFName(radio.getDefaultValue()),
-                    radio.getCOSObject().getDictionaryObject(COSName.DV));
-
-            // get the Checkbox with a DV entry
-            PDCheckbox checkBox = (PDCheckbox)form.getField("Checkbox-DefaultValue");
-            assertNotNull(checkBox);
-            assertEquals(Boolean.TRUE, checkBox.getDefaultValue());
-            assertEquals(COSName.YES, checkBox.getCOSObject().getDictionaryObject(COSName.DV));
-            
             // get the TextField with a DV entry
             textField = (PDTextField)form.getField("TextField-DefaultValue");
             assertNotNull(textField);



Mime
View raw message