poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1149703 - in /poi/trunk/src/scratchpad: src/org/apache/poi/hwpf/converter/WordToFoConverter.java testcases/org/apache/poi/hwpf/converter/TestWordToFoConverter.java
Date Fri, 22 Jul 2011 19:36:47 GMT
Author: sergey
Date: Fri Jul 22 19:36:46 2011
New Revision: 1149703

URL: http://svn.apache.org/viewvc?rev=1149703&view=rev
Log:
fix notes numbering and update test cases for Word-to-FO converter

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToFoConverter.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java?rev=1149703&r1=1149702&r2=1149703&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java Fri
Jul 22 19:36:46 2011
@@ -139,7 +139,7 @@ public class WordToFoConverter extends A
 
     protected final FoDocumentFacade foDocumentFacade;
 
-    private AtomicInteger internalLinkCounter = new AtomicInteger( 1 );
+    private AtomicInteger internalLinkCounter = new AtomicInteger( 0 );
 
     private Set<String> usedIds = new LinkedHashSet<String>();
 

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToFoConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToFoConverter.java?rev=1149703&r1=1149702&r2=1149703&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToFoConverter.java
(original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToFoConverter.java
Fri Jul 22 19:36:46 2011
@@ -75,10 +75,12 @@ public class TestWordToFoConverter exten
     {
         String result = getFoText( "documentProperties.doc" );
 
-        assertTrue( result
-                .contains( "<dc:title xmlns:dc=\"http://purl.org/dc/elements/1.1/\">This
is document title</dc:title>" ) );
-        assertTrue( result
-                .contains( "<pdf:Keywords xmlns:pdf=\"http://ns.adobe.com/pdf/1.3/\">This
is document keywords</pdf:Keywords>" ) );
+        assertContains(
+                result,
+                "<dc:title xmlns:dc=\"http://purl.org/dc/elements/1.1/\">This is document
title</dc:title>" );
+        assertContains(
+                result,
+                "<pdf:Keywords xmlns:pdf=\"http://ns.adobe.com/pdf/1.3/\">This is document
keywords</pdf:Keywords>" );
     }
 
     public void testEndnote() throws Exception
@@ -86,7 +88,13 @@ public class TestWordToFoConverter exten
         String result = getFoText( "endingnote.doc" );
 
         assertContains( result,
+                "<fo:basic-link id=\"endnote_back_1\" internal-destination=\"endnote_1\">"
);
+        assertContains( result,
                 "<fo:inline baseline-shift=\"super\" font-size=\"smaller\">1</fo:inline>"
);
+        assertContains( result,
+                "<fo:basic-link id=\"endnote_1\" internal-destination=\"endnote_back_1\">"
);
+        assertContains( result,
+                "<fo:inline baseline-shift=\"super\" font-size=\"smaller\">1 </fo:inline>"
);
         assertContains( result, "Ending note text" );
     }
 
@@ -95,8 +103,7 @@ public class TestWordToFoConverter exten
         final String sampleFileName = "equation.doc";
         String result = getFoText( sampleFileName );
 
-        assertTrue( result
-                .contains( "<!--Image link to '0.emf' can be here-->" ) );
+        assertContains( result, "<!--Image link to '0.emf' can be here-->" );
     }
 
     public void testHyperlink() throws Exception
@@ -104,9 +111,9 @@ public class TestWordToFoConverter exten
         final String sampleFileName = "hyperlink.doc";
         String result = getFoText( sampleFileName );
 
-        assertTrue( result
-                .contains( "<fo:basic-link external-destination=\"http://testuri.org/\">"
) );
-        assertTrue( result.contains( "Hyperlink text" ) );
+        assertContains( result,
+                "<fo:basic-link external-destination=\"http://testuri.org/\">" );
+        assertContains( result, "Hyperlink text" );
     }
 
     public void testInnerTable() throws Exception
@@ -114,8 +121,8 @@ public class TestWordToFoConverter exten
         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 exten
 
         System.out.println( result );
 
-        assertTrue( result
-                .contains( "<fo:basic-link internal-destination=\"userref\">" ) );
-        assertTrue( result.contains( "1" ) );
+        assertContains( result,
+                "<fo:basic-link internal-destination=\"bookmark_userref\">" );
+        assertContains( result, "1" );
+        assertContains( result, "<fo:inline id=\"bookmark_userref\">" );
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message