You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by se...@apache.org on 2011/07/28 10:32:14 UTC
svn commit: r1151761 -
/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java
Author: sergey
Date: Thu Jul 28 08:32:13 2011
New Revision: 1151761
URL: http://svn.apache.org/viewvc?rev=1151761&view=rev
Log:
Bug 47286 were fixed, update test case
Modified:
poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java
Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java?rev=1151761&r1=1151760&r2=1151761&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestProblems.java Thu Jul 28 08:32:13 2011
@@ -534,37 +534,20 @@ public final class TestProblems extends
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() );
-
- List<PlexOfField> expectedFields = doc1.getFieldsTables()
- .getFieldsPLCF( FieldsDocumentPart.MAIN );
- List<PlexOfField> actualFields = doc2.getFieldsTables()
- .getFieldsPLCF( FieldsDocumentPart.MAIN );
- assertEquals( expectedFields.size(), actualFields.size() );
-
- assertTableStructures( doc1.getRange(), doc2.getRange() );
-
- // FileOutputStream fileOutputStream = new FileOutputStream(
- // "test.doc" );
- // doc1.write( fileOutputStream );
- // fileOutputStream.close();
+ // 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() );
+
+ List<PlexOfField> expectedFields = doc1.getFieldsTables()
+ .getFieldsPLCF( FieldsDocumentPart.MAIN );
+ List<PlexOfField> actualFields = doc2.getFieldsTables().getFieldsPLCF(
+ FieldsDocumentPart.MAIN );
+ assertEquals( expectedFields.size(), actualFields.size() );
- // not fixed yet, but still better
- // fixed( "47286" );
- }
- catch ( AssertionFailedError exc )
- {
- // expected
- exc.toString();
- }
+ assertTableStructures( doc1.getRange(), doc2.getRange() );
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org