test that original slide is not modified

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903438 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2022-08-15 13:19:34 +00:00
parent 0f45464494
commit 3a42bc3247
1 changed files with 17 additions and 0 deletions

View File

@ -220,6 +220,23 @@ class TestXSLFShape {
}
}
}
XSLFSlide ppt2Slide0 = ppt2.getSlides().get(0);
int shapeNumber = 0;
for (XSLFShape shape : ppt2Slide0.getShapes()) {
if (shape instanceof XSLFTextShape) {
XSLFTextShape textShape = (XSLFTextShape) shape;
List<XSLFTextParagraph> textBoxParagraphs = textShape.getTextParagraphs();
List<XSLFTextRun> textBoxParagraphTextRuns = textBoxParagraphs.stream()
.map(XSLFTextParagraph::getTextRuns)
.flatMap(List::stream)
.collect(Collectors.toList());
assertEquals(1, textBoxParagraphTextRuns.size());
String expected = shapeNumber == 0 ? "Learning PPTX" : "Cloud";
assertEquals(expected, textBoxParagraphTextRuns.get(0).getRawText());
}
shapeNumber++;
}
}
}
}