diff --git a/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java b/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java index be712a0045..e63762d290 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/extractor/TestXSLFPowerPointExtractor.java @@ -33,6 +33,8 @@ import org.apache.poi.ooxml.extractor.ExtractorFactory; import org.apache.poi.openxml4j.exceptions.OpenXML4JException; import org.apache.poi.sl.extractor.SlideShowExtractor; import org.apache.poi.xslf.usermodel.XMLSlideShow; +import org.apache.poi.xslf.usermodel.XSLFShape; +import org.apache.poi.xslf.usermodel.XSLFTextParagraph; import org.apache.xmlbeans.XmlException; import org.junit.Test; @@ -48,7 +50,7 @@ public class TestXSLFPowerPointExtractor { @Test public void testGetSimpleText() throws IOException { try (XMLSlideShow xmlA = openPPTX("sample.pptx"); - SlideShowExtractor extractor = new SlideShowExtractor(xmlA)) { + SlideShowExtractor extractor = new SlideShowExtractor<>(xmlA)) { extractor.getText(); @@ -160,7 +162,7 @@ public class TestXSLFPowerPointExtractor { @Test public void testGetComments() throws IOException { try (XMLSlideShow xml = openPPTX("45545_Comment.pptx"); - SlideShowExtractor extractor = new SlideShowExtractor(xml)) { + SlideShowExtractor extractor = new SlideShowExtractor<>(xml)) { extractor.setCommentsByDefault(true); String text = extractor.getText(); @@ -178,7 +180,7 @@ public class TestXSLFPowerPointExtractor { @Test public void testGetMasterText() throws Exception { try (XMLSlideShow xml = openPPTX("WithMaster.pptx"); - SlideShowExtractor extractor = new SlideShowExtractor(xml)) { + SlideShowExtractor extractor = new SlideShowExtractor<>(xml)) { extractor.setSlidesByDefault(true); extractor.setNotesByDefault(false); extractor.setMasterByDefault(true); @@ -215,7 +217,7 @@ public class TestXSLFPowerPointExtractor { @Test public void testTable() throws Exception { try (XMLSlideShow xml = openPPTX("present1.pptx"); - SlideShowExtractor extractor = new SlideShowExtractor(xml)) { + SlideShowExtractor extractor = new SlideShowExtractor<>(xml)) { String text = extractor.getText(); assertTrue(text.length() > 0); @@ -240,7 +242,7 @@ public class TestXSLFPowerPointExtractor { String filename = "testPPT." + extension; try (XMLSlideShow xml = openPPTX(filename); - SlideShowExtractor extractor = new SlideShowExtractor(xml)) { + SlideShowExtractor extractor = new SlideShowExtractor<>(xml)) { String text = extractor.getText(); if (extension.equals("thmx")) { @@ -299,7 +301,7 @@ public class TestXSLFPowerPointExtractor { @Test public void bug54570() throws IOException { try (XMLSlideShow xml = openPPTX("bug54570.pptx"); - SlideShowExtractor extractor = new SlideShowExtractor(xml)) { + SlideShowExtractor extractor = new SlideShowExtractor<>(xml)) { String text = extractor.getText(); assertNotNull(text); } @@ -310,4 +312,17 @@ public class TestXSLFPowerPointExtractor { return new XMLSlideShow(is); } } + + @Test + public void setSlTests() throws IOException { + try (XMLSlideShow xml = openPPTX("aascu.org_hbcu_leadershipsummit_cooper_.pptx")) { + SlideShowExtractor extractor = new SlideShowExtractor<>(xml); + assertNotNull(extractor); + extractor.setSlidesByDefault(true); + extractor.setNotesByDefault(true); + extractor.setMasterByDefault(true); + + assertNotNull(extractor.getText()); + } + } } diff --git a/test-data/slideshow/aascu.org_hbcu_leadershipsummit_cooper_.pptx b/test-data/slideshow/aascu.org_hbcu_leadershipsummit_cooper_.pptx new file mode 100755 index 0000000000..14b71bcbc8 Binary files /dev/null and b/test-data/slideshow/aascu.org_hbcu_leadershipsummit_cooper_.pptx differ