FileDocCategorySizeDatePackage
TestExObjList.javaAPI DocApache Poi 3.0.12743Sun Mar 11 12:59:30 GMT 2007org.apache.poi.hslf.record

TestExObjList

public class TestExObjList extends TestCase
Tests that ExObjList works properly.
author
Nick Burch (nick at torchbox dot com)

Fields Summary
Constructors Summary
Methods Summary
public voidtestRealFile()

		String dirname = System.getProperty("HSLF.testdata.path");
		HSLFSlideShow hss = new HSLFSlideShow(dirname + File.separator + "WithLinks.ppt");
		SlideShow ss = new SlideShow(hss);
		
		// Get the document
		Document doc = ss.getDocumentRecord();
		// Get the ExObjList
		ExObjList exObjList = doc.getExObjList();
		assertNotNull(exObjList);
		assertEquals(1033l, exObjList.getRecordType());
		
		// Check the atom
		assertNotNull(exObjList.getExObjListAtom());
		assertEquals(4, exObjList.getExObjListAtom().getObjectIDSeed());
		
		// Check the Hyperlinks
		assertEquals(4, exObjList.getExHyperlinks().length);
		
		// Check the contents
		ExHyperlink[] links = exObjList.getExHyperlinks();
		
		// Check they have what we expect in them
		assertEquals(1, links[0].getExHyperlinkAtom().getNumber());
		assertEquals("http://jakarta.apache.org/poi/", links[0].getLinkURL());
		
		assertEquals(2, links[1].getExHyperlinkAtom().getNumber());
		assertEquals("http://slashdot.org/", links[1].getLinkURL());
		
		assertEquals(3, links[2].getExHyperlinkAtom().getNumber());
		assertEquals("http://jakarta.apache.org/poi/hssf/", links[2].getLinkURL());
		
		assertEquals(4, links[3].getExHyperlinkAtom().getNumber());
		assertEquals("http://jakarta.apache.org/hslf/", links[3].getLinkURL());