FileDocCategorySizeDatePackage
TestRecordSetup.javaAPI DocApache Poi 3.0.12465Mon Jan 01 18:55:40 GMT 2007org.apache.poi.hslf.usermodel

TestRecordSetup

public class TestRecordSetup extends TestCase
Tests that the record setup done by SlideShow has worked correctly Note: most recent record stuff has its own test
author
Nick Burch (nick at torchbox dot com)

Fields Summary
private SlideShow
ss
private HSLFSlideShow
hss
Constructors Summary
public TestRecordSetup()

		String dirname = System.getProperty("HSLF.testdata.path");
		String filename = dirname + "/basic_test_ppt_file.ppt";
		hss = new HSLFSlideShow(filename);
		ss = new SlideShow(hss);
    
Methods Summary
private voidensureParentAware(org.apache.poi.hslf.record.Record r, org.apache.poi.hslf.record.RecordContainer parent)

    	if(r instanceof ParentAwareRecord) {
    		ParentAwareRecord pr = (ParentAwareRecord)r;
    		assertEquals(parent, pr.getParentRecord());
    	}
    	if(r instanceof RecordContainer) {
    		RecordContainer rc = (RecordContainer)r;
    		Record[] children = rc.getChildRecords();
    		for(int i=0; i<children.length; i++) {
    			ensureParentAware(children[i], rc);
    		}
    	}
    
public voidtestHandleParentAwareRecords()

    	Record[] records = hss.getRecords();
    	for(int i=0; i<records.length; i++) {
    		ensureParentAware(records[i],null);
    	}