* Test adding a slide to an existing slideshow,
* with two slides already
*/
public void testAddSlideToExisting2() throws Exception {
//grab UserEditAtom
UserEditAtom usredit = null;
Record[] _records = hss_two.getRecords();
for (int i = 0; i < _records.length; i++) {
Record record = _records[i];
if(_records[i].getRecordType() == RecordTypes.UserEditAtom.typeID) {
usredit = (UserEditAtom)_records[i];
}
}
assertNotNull(usredit);
// Has two slides
assertEquals(2, ss_two.getSlides().length);
Slide s1 = ss_two.getSlides()[0];
Slide s2 = ss_two.getSlides()[1];
// Check slide 1 is as expected
assertEquals(256, s1._getSheetNumber());
assertEquals(4, s1._getSheetRefId()); // master has notes
assertEquals(1, s1.getSlideNumber());
// Check slide 2 is as expected
assertEquals(257, s2._getSheetNumber());
assertEquals(6, s2._getSheetRefId()); // master and 1 have notes
assertEquals(2, s2.getSlideNumber());
// Add a third one
Slide s3 = ss_two.createSlide();
assertEquals(3, ss_two.getSlides().length);
assertEquals(258, s3._getSheetNumber());
assertEquals(8, s3._getSheetRefId()); // lots of notes before us
assertEquals(3, s3.getSlideNumber());
assertEquals(usredit.getMaxPersistWritten(), s3._getSheetRefId());
// Write out, and read back in
ByteArrayOutputStream baos = new ByteArrayOutputStream();
hss_two.write(baos);
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());