From dbd10a67c0437cc713727aa1d14c105ca3ec86bd Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Thu, 28 Jul 2011 08:32:13 +0000 Subject: [PATCH] Bug 47286 were fixed, update test case git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1151761 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hwpf/usermodel/TestProblems.java | 39 ++++++------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java index 6fc32c456a..6cb3a03f8f 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java @@ -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 expectedFields = doc1.getFieldsTables() - .getFieldsPLCF( FieldsDocumentPart.MAIN ); - List 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 expectedFields = doc1.getFieldsTables() + .getFieldsPLCF( FieldsDocumentPart.MAIN ); + List 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() ); } /** -- 2.39.5