]> source.dussan.org Git - poi.git/commitdiff
Bug 47286 were fixed, update test case
authorSergey Vladimirov <sergey@apache.org>
Thu, 28 Jul 2011 08:32:13 +0000 (08:32 +0000)
committerSergey Vladimirov <sergey@apache.org>
Thu, 28 Jul 2011 08:32:13 +0000 (08:32 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1151761 13f79535-47bb-0310-9956-ffa450edef68

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

index 6fc32c456a485eb21f67ee969958f4e103845137..6cb3a03f8f02f150f1458f31f4519aa5445a7af5 100644 (file)
@@ -534,37 +534,20 @@ public final class TestProblems extends HWPFTestCase {
         HWPFDocument doc2 = HWPFTestDataSamples.writeOutAndReadBack( doc1 );
         String text2 = new WordExtractor( doc2 ).getText().trim();
 
-        try
-        {
-            // the text in the saved document has some differences in line
-            // separators but we tolerate that
-            assertEquals( text1.replaceAll( "\n", "" ),
-                    text2.replaceAll( "\n", "" ) );
-
-            assertEquals( doc1.getCharacterTable().getTextRuns().size(), doc2
-                    .getCharacterTable().getTextRuns().size() );
+        // the text in the saved document has some differences in line
+        // separators but we tolerate that
+        assertEquals( text1.replaceAll( "\n", "" ), text2.replaceAll( "\n", "" ) );
 
-            List<PlexOfField> expectedFields = doc1.getFieldsTables()
-                    .getFieldsPLCF( FieldsDocumentPart.MAIN );
-            List<PlexOfField> actualFields = doc2.getFieldsTables()
-                    .getFieldsPLCF( FieldsDocumentPart.MAIN );
-            assertEquals( expectedFields.size(), actualFields.size() );
+        assertEquals( doc1.getCharacterTable().getTextRuns().size(), doc2
+                .getCharacterTable().getTextRuns().size() );
 
-            assertTableStructures( doc1.getRange(), doc2.getRange() );
+        List<PlexOfField> expectedFields = doc1.getFieldsTables()
+                .getFieldsPLCF( FieldsDocumentPart.MAIN );
+        List<PlexOfField> actualFields = doc2.getFieldsTables().getFieldsPLCF(
+                FieldsDocumentPart.MAIN );
+        assertEquals( expectedFields.size(), actualFields.size() );
 
-            // FileOutputStream fileOutputStream = new FileOutputStream(
-            // "test.doc" );
-            // doc1.write( fileOutputStream );
-            // fileOutputStream.close();
-
-            // not fixed yet, but still better
-            // fixed( "47286" );
-        }
-        catch ( AssertionFailedError exc )
-        {
-            // expected
-            exc.toString();
-        }
+        assertTableStructures( doc1.getRange(), doc2.getRange() );
     }
 
     /**