From: Sergey Vladimirov Date: Fri, 22 Jul 2011 19:36:46 +0000 (+0000) Subject: fix notes numbering and update test cases for Word-to-FO converter X-Git-Tag: REL_3_8_BETA4~95 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7aaa047ff615f7eac1789b59d16a5a035398e8e9;p=poi.git fix notes numbering and update test cases for Word-to-FO converter git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1149703 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java index 83badcca9a..d2aa9e5308 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java @@ -139,7 +139,7 @@ public class WordToFoConverter extends AbstractWordConverter protected final FoDocumentFacade foDocumentFacade; - private AtomicInteger internalLinkCounter = new AtomicInteger( 1 ); + private AtomicInteger internalLinkCounter = new AtomicInteger( 0 ); private Set usedIds = new LinkedHashSet(); diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToFoConverter.java b/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToFoConverter.java index 5aa835ada5..f65f301e62 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToFoConverter.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToFoConverter.java @@ -75,18 +75,26 @@ public class TestWordToFoConverter extends TestCase { String result = getFoText( "documentProperties.doc" ); - assertTrue( result - .contains( "This is document title" ) ); - assertTrue( result - .contains( "This is document keywords" ) ); + assertContains( + result, + "This is document title" ); + assertContains( + result, + "This is document keywords" ); } public void testEndnote() throws Exception { String result = getFoText( "endingnote.doc" ); + assertContains( result, + "" ); assertContains( result, "1" ); + assertContains( result, + "" ); + assertContains( result, + "1 " ); assertContains( result, "Ending note text" ); } @@ -95,8 +103,7 @@ public class TestWordToFoConverter extends TestCase final String sampleFileName = "equation.doc"; String result = getFoText( sampleFileName ); - assertTrue( result - .contains( "" ) ); + assertContains( result, "" ); } public void testHyperlink() throws Exception @@ -104,9 +111,9 @@ public class TestWordToFoConverter extends TestCase final String sampleFileName = "hyperlink.doc"; String result = getFoText( sampleFileName ); - assertTrue( result - .contains( "" ) ); - assertTrue( result.contains( "Hyperlink text" ) ); + assertContains( result, + "" ); + assertContains( result, "Hyperlink text" ); } public void testInnerTable() throws Exception @@ -114,8 +121,8 @@ public class TestWordToFoConverter extends TestCase final String sampleFileName = "innertable.doc"; String result = getFoText( sampleFileName ); - assertTrue( result - .contains( "padding-end=\"0.0in\" padding-start=\"0.0in\" width=\"1.0770833in\"" ) ); + assertContains( result, + "padding-end=\"0.0in\" padding-start=\"0.0in\" width=\"1.0770833in\"" ); } public void testPageref() throws Exception @@ -125,8 +132,9 @@ public class TestWordToFoConverter extends TestCase System.out.println( result ); - assertTrue( result - .contains( "" ) ); - assertTrue( result.contains( "1" ) ); + assertContains( result, + "" ); + assertContains( result, "1" ); + assertContains( result, "" ); } }