Bug 47286 were fixed, update test case

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1151761 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sergey Vladimirov 2011-07-28 08:32:13 +00:00
parent ee20c9d04a
commit dbd10a67c0
1 changed files with 11 additions and 28 deletions

View File

@ -534,37 +534,20 @@ public final class TestProblems extends HWPFTestCase {
HWPFDocument doc2 = HWPFTestDataSamples.writeOutAndReadBack( doc1 ); HWPFDocument doc2 = HWPFTestDataSamples.writeOutAndReadBack( doc1 );
String text2 = new WordExtractor( doc2 ).getText().trim(); String text2 = new WordExtractor( doc2 ).getText().trim();
try // the text in the saved document has some differences in line
{ // separators but we tolerate that
// the text in the saved document has some differences in line assertEquals( text1.replaceAll( "\n", "" ), text2.replaceAll( "\n", "" ) );
// separators but we tolerate that
assertEquals( text1.replaceAll( "\n", "" ),
text2.replaceAll( "\n", "" ) );
assertEquals( doc1.getCharacterTable().getTextRuns().size(), doc2 assertEquals( doc1.getCharacterTable().getTextRuns().size(), doc2
.getCharacterTable().getTextRuns().size() ); .getCharacterTable().getTextRuns().size() );
List<PlexOfField> expectedFields = doc1.getFieldsTables() List<PlexOfField> expectedFields = doc1.getFieldsTables()
.getFieldsPLCF( FieldsDocumentPart.MAIN ); .getFieldsPLCF( FieldsDocumentPart.MAIN );
List<PlexOfField> actualFields = doc2.getFieldsTables() List<PlexOfField> actualFields = doc2.getFieldsTables().getFieldsPLCF(
.getFieldsPLCF( FieldsDocumentPart.MAIN ); FieldsDocumentPart.MAIN );
assertEquals( expectedFields.size(), actualFields.size() ); assertEquals( expectedFields.size(), actualFields.size() );
assertTableStructures( doc1.getRange(), doc2.getRange() ); assertTableStructures( doc1.getRange(), doc2.getRange() );
// 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();
}
} }
/** /**