import org.apache.poi.xslf.usermodel.XSLFSlide;
public class TestXSLFBugs extends TestCase {
public void test51187() throws Exception {
XMLSlideShow ss = XSLFTestDataSamples.openSampleDocument("51187.pptx");
assertEquals(1, ss.getSlides().length);
XSLFSlide slide = ss.getSlides()[0];
// Check the relations on it
// Note - rId3 is a self reference
PackagePart slidePart = ss._getXSLFSlideShow().getSlidePart(
ss._getXSLFSlideShow().getSlideReferences().getSldIdArray(0)
);
assertEquals("/ppt/slides/slide1.xml", slidePart.getPartName().toString());
assertEquals("/ppt/slideLayouts/slideLayout12.xml", slidePart.getRelationship("rId1").getTargetURI().toString());
assertEquals("/ppt/notesSlides/notesSlide1.xml", slidePart.getRelationship("rId2").getTargetURI().toString());
assertEquals("/ppt/slides/slide1.xml", slidePart.getRelationship("rId3").getTargetURI().toString());
assertEquals("/ppt/media/image1.png", slidePart.getRelationship("rId4").getTargetURI().toString());
// Save and re-load
ss = XSLFTestDataSamples.writeOutAndReadBack(ss);
assertEquals(1, ss.getSlides().length);
slidePart = ss._getXSLFSlideShow().getSlidePart(
ss._getXSLFSlideShow().getSlideReferences().getSldIdArray(0)
);
assertEquals("/ppt/slides/slide1.xml", slidePart.getPartName().toString());
assertEquals("/ppt/slideLayouts/slideLayout12.xml", slidePart.getRelationship("rId1").getTargetURI().toString());
assertEquals("/ppt/notesSlides/notesSlide1.xml", slidePart.getRelationship("rId2").getTargetURI().toString());
// TODO Fix this