More slide related tests
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@388942 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
446971f3f4
commit
b07df66836
@ -39,8 +39,11 @@ public class TestSlides extends TestCase {
|
||||
public void testAddSlides1() throws Exception {
|
||||
SlideShow ppt = new SlideShow(new HSLFSlideShow( TestSlides.class.getResourceAsStream("/org/apache/poi/hslf/data/empty.ppt") ));
|
||||
assertTrue(ppt.getSlides().length == 0);
|
||||
ppt.createSlide();
|
||||
|
||||
Slide s1 = ppt.createSlide();
|
||||
assertTrue(ppt.getSlides().length == 1);
|
||||
assertEquals(3, s1.getSheetNumber());
|
||||
assertEquals(1, s1.getSlideNumber());
|
||||
|
||||
//serialize and read again
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
@ -61,9 +64,13 @@ public class TestSlides extends TestCase {
|
||||
|
||||
Slide s1 = ppt.createSlide();
|
||||
assertTrue(ppt.getSlides().length == 1);
|
||||
assertEquals(3, s1.getSheetNumber());
|
||||
assertEquals(1, s1.getSlideNumber());
|
||||
|
||||
Slide s2 = ppt.createSlide();
|
||||
assertTrue(ppt.getSlides().length == 2);
|
||||
assertEquals(4, s2.getSheetNumber());
|
||||
assertEquals(2, s2.getSlideNumber());
|
||||
|
||||
//serialize and read again
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
@ -84,12 +91,18 @@ public class TestSlides extends TestCase {
|
||||
|
||||
Slide s1 = ppt.createSlide();
|
||||
assertTrue(ppt.getSlides().length == 1);
|
||||
assertEquals(3, s1.getSheetNumber());
|
||||
assertEquals(1, s1.getSlideNumber());
|
||||
|
||||
Slide s2 = ppt.createSlide();
|
||||
assertTrue(ppt.getSlides().length == 2);
|
||||
assertEquals(4, s2.getSheetNumber());
|
||||
assertEquals(2, s2.getSlideNumber());
|
||||
|
||||
Slide s3 = ppt.createSlide();
|
||||
assertTrue(ppt.getSlides().length == 3);
|
||||
assertEquals(5, s3.getSheetNumber());
|
||||
assertEquals(3, s3.getSlideNumber());
|
||||
|
||||
//serialize and read again
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
|
@ -44,11 +44,30 @@ public class TestCounts extends TestCase {
|
||||
Slide[] slides = ss.getSlides();
|
||||
// Two sheets - master sheet is seperate
|
||||
assertEquals(2, slides.length);
|
||||
|
||||
// They are slides 1+2
|
||||
assertEquals(1, slides[0].getSlideNumber());
|
||||
assertEquals(2, slides[1].getSlideNumber());
|
||||
|
||||
// The internal IDs are 4 and 6
|
||||
assertEquals(4, slides[0].getSheetNumber());
|
||||
assertEquals(6, slides[1].getSheetNumber());
|
||||
}
|
||||
|
||||
public void testNotesCount() throws Exception {
|
||||
Notes[] notes = ss.getNotes();
|
||||
// Two sheets -> two notes, plus the notes on the slide master
|
||||
assertEquals(3, notes.length);
|
||||
|
||||
// First is for master
|
||||
assertEquals(-2147483648, notes[0].getSlideInternalNumber());
|
||||
|
||||
// Next two are for the two slides
|
||||
assertEquals(256, notes[1].getSlideInternalNumber());
|
||||
assertEquals(257, notes[2].getSlideInternalNumber());
|
||||
|
||||
// They go between the slides
|
||||
assertEquals(5, notes[1].getSheetNumber());
|
||||
assertEquals(7, notes[2].getSheetNumber());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user