aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/sl
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2018-05-16 21:57:49 +0000
committerAndreas Beeker <kiwiwings@apache.org>2018-05-16 21:57:49 +0000
commit4a3ea104fe275e0d0f8d094f7bd1f6da57562d64 (patch)
treeac85054e14d3e8295d16be4385aa3dafb98a0479 /src/testcases/org/apache/poi/sl
parente371ce46cc2576a3a10f7e8ad0949bd178e95233 (diff)
downloadpoi-4a3ea104fe275e0d0f8d094f7bd1f6da57562d64.tar.gz
poi-4a3ea104fe275e0d0f8d094f7bd1f6da57562d64.zip
#62037 - SlideNames should not be null but have a default as if accessed by VBA
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1831745 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/sl')
-rw-r--r--src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShow.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShow.java b/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShow.java
index 347ea73a6c..c4daa50b3f 100644
--- a/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShow.java
+++ b/src/testcases/org/apache/poi/sl/usermodel/BaseTestSlideShow.java
@@ -159,16 +159,20 @@ public abstract class BaseTestSlideShow {
}
@Test
- public void shapeName() throws IOException {
+ public void shapeAndSlideName() throws IOException {
final String file = "SampleShow.ppt"+(getClass().getSimpleName().contains("XML")?"x":"");
- try (final InputStream is = slTests.openResourceAsStream(file)) {
- try (final SlideShow<? extends Shape, ?> ppt = SlideShowFactory.create(is)) {
- final List<? extends Shape> shapes1 = ppt.getSlides().get(0).getShapes();
- assertEquals("The Title", shapes1.get(0).getShapeName());
- assertEquals("Another Subtitle", shapes1.get(1).getShapeName());
- final List<? extends Shape> shapes2 = ppt.getSlides().get(1).getShapes();
- assertEquals("Title 1", shapes2.get(0).getShapeName());
- assertEquals("Content Placeholder 2", shapes2.get(1).getShapeName());
+ try (final InputStream is = slTests.openResourceAsStream(file);
+ final SlideShow<? extends Shape, ?> ppt = SlideShowFactory.create(is)) {
+ final List<? extends Shape> shapes1 = ppt.getSlides().get(0).getShapes();
+ assertEquals("The Title", shapes1.get(0).getShapeName());
+ assertEquals("Another Subtitle", shapes1.get(1).getShapeName());
+ final List<? extends Shape> shapes2 = ppt.getSlides().get(1).getShapes();
+ assertEquals("Title 1", shapes2.get(0).getShapeName());
+ assertEquals("Content Placeholder 2", shapes2.get(1).getShapeName());
+
+ for (final Slide<?,?> slide : ppt.getSlides()) {
+ final String expected = slide.getSlideNumber()==1 ? "FirstSlide" : "Slide2";
+ assertEquals(expected, slide.getSlideName());
}
}
}