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 {
}
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 {
// 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);
}