Browse Source

test that original slide is not modified

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903438 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_5_2_3
PJ Fanning 1 year ago
parent
commit
3a42bc3247

+ 17
- 0
poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFShape.java 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++;
}

}
}
}

Loading…
Cancel
Save