poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1175870 - in /poi/trunk: src/ooxml/testcases/org/apache/poi/xslf/extractor/ src/scratchpad/testcases/org/apache/poi/hslf/extractor/ test-data/slideshow/
Date Mon, 26 Sep 2011 13:49:00 GMT
Author: nick
Date: Mon Sep 26 13:48:59 2011
New Revision: 1175870

URL: http://svn.apache.org/viewvc?rev=1175870&view=rev
Log:
Tweak the HSLF and XSLF tests for master slide text to cover more (some of which is disabled
for now)

Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java
    poi/trunk/test-data/slideshow/WithMaster.ppt
    poi/trunk/test-data/slideshow/WithMaster.pptx

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java?rev=1175870&r1=1175869&r2=1175870&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java
(original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java
Mon Sep 26 13:48:59 2011
@@ -181,7 +181,21 @@ public class TestXSLFPowerPointExtractor
       assertTrue(text.length() > 0);
 
       // Check master text is there
-      assertTrue("Unable to find expected word in text\n" + text, text.contains("Master footer
is here"));
+      assertTrue("Unable to find expected word in text\n" + text, 
+            text.contains("Footer from the master slide"));
+      
+      // Check the whole text
+      assertEquals(
+            "First page title\n" +
+            "First page subtitle\n" +
+//            "This text comes from the Master Slide\n" + // TODO
+//            "This is the Master Title\n" + // TODO
+            "\n" + // TODO Should be the above
+            "2nd page subtitle\n" +
+//          "This text comes from the Master Slide\n" + // TODO
+            "Footer from the master slide\n"
+            , text
+      );
 	}
 
     public void testTable() throws Exception {

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java?rev=1175870&r1=1175869&r2=1175870&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestExtractor.java Mon
Sep 26 13:48:59 2011
@@ -274,14 +274,17 @@ public final class TestExtractor extends
     }
     
    public void testSlideMasterText() throws Exception {
-      String masterText = "Master footer is here";
+      String masterTitleText = "This is the Master Title";
+      String masterRandomText = "This text comes from the Master Slide";
+      String masterFooterText = "Footer from the master slide";
       HSLFSlideShow hslf = new HSLFSlideShow(slTests.openResourceAsStream("WithMaster.ppt"));
       
       ppe = new PowerPointExtractor(hslf);
       
       String text = ppe.getText();
-      assertContains(text, "Master");
-      assertContains(text, masterText);
+      //assertContains(text, masterTitleText); // TODO Is this available in PPT?
+      //assertContains(text, masterRandomText); // TODO Extract
+      assertContains(text, masterFooterText);
    }
 
     public void testMasterText() throws Exception {
@@ -299,13 +302,13 @@ public final class TestExtractor extends
        
        // Now with another file only containing master text
        // Will always show up
-       String masterText = "Master footer is here";
+       String masterText = "Footer from the master slide";
        HSLFSlideShow hslf = new HSLFSlideShow(slTests.openResourceAsStream("WithMaster.ppt"));
        
        ppe = new PowerPointExtractor(hslf);
        
        text = ppe.getText();
-       assertContains(text, "Master");
+       assertContains(text.toLowerCase(), "master");
        assertContains(text, masterText);
     }
 

Modified: poi/trunk/test-data/slideshow/WithMaster.ppt
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/slideshow/WithMaster.ppt?rev=1175870&r1=1175869&r2=1175870&view=diff
==============================================================================
Binary files - no diff available.

Modified: poi/trunk/test-data/slideshow/WithMaster.pptx
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/slideshow/WithMaster.pptx?rev=1175870&r1=1175869&r2=1175870&view=diff
==============================================================================
Binary files - no diff available.



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


Mime
View raw message