]> source.dussan.org Git - poi.git/commitdiff
fix test for 47286
authorSergey Vladimirov <sergey@apache.org>
Fri, 8 Jul 2011 10:04:03 +0000 (10:04 +0000)
committerSergey Vladimirov <sergey@apache.org>
Fri, 8 Jul 2011 10:04:03 +0000 (10:04 +0000)
now it will fail if bug is fixed

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1144235 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java

index c5206901d93b9791cafa1d32926954d9a09df3e5..107949acf7be111fa1dbac594bdc73072a53ef0a 100644 (file)
@@ -17,8 +17,6 @@
 
 package org.apache.poi.hwpf.usermodel;
 
-import java.io.File;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.List;
@@ -33,6 +31,8 @@ import org.apache.poi.hwpf.HWPFTestCase;
 import org.apache.poi.hwpf.HWPFTestDataSamples;
 import org.apache.poi.hwpf.extractor.Word6Extractor;
 import org.apache.poi.hwpf.extractor.WordExtractor;
+import org.apache.poi.hwpf.model.FieldsTables;
+import org.apache.poi.hwpf.model.PlexOfField;
 import org.apache.poi.hwpf.model.StyleSheet;
 import org.apache.poi.util.IOUtils;
 
@@ -548,8 +548,14 @@ public final class TestProblems extends HWPFTestCase {
             assertEquals( text1.replaceAll( "\n", "" ),
                     text2.replaceAll( "\n", "" ) );
 
-            // no, it is not fixed yet :(
-            // text is the same, but field information is not preserved
+            List<PlexOfField> expectedFields = doc1.getFieldsTables()
+                    .getFieldsPLCF( FieldsTables.PLCFFLDMOM );
+            List<PlexOfField> actualFields = doc2.getFieldsTables()
+                    .getFieldsPLCF( FieldsTables.PLCFFLDMOM );
+
+            assertEquals( expectedFields.size(), actualFields.size() );
+
+            fixed("47286");
         }
         catch ( AssertionFailedError exc )
         {