FileDocCategorySizeDatePackage
TestHDGFCore.javaAPI DocApache Poi 3.0.12389Mon Jun 18 23:42:58 BST 2007org.apache.poi.hdgf

TestHDGFCore

public class TestHDGFCore extends TestCase

Fields Summary
POIFSFileSystem
fs
Constructors Summary
Methods Summary
protected voidsetUp()

		String dirname = System.getProperty("HDGF.testdata.path");
		String filename = dirname + "/Test_Visio-Some_Random_Text.vsd";
		fs = new POIFSFileSystem(new FileInputStream(filename));
	
public voidtestCreate()

		new HDGFDiagram(fs);
	
public voidtestTrailer()

		HDGFDiagram hdgf = new HDGFDiagram(fs);
		assertNotNull(hdgf);
		assertNotNull(hdgf.getTrailerStream());
		
		// Check it has what we'd expect
		TrailerStream trailer = hdgf.getTrailerStream();
		assertEquals(0x8a94, trailer.getPointer().getOffset());
		
		assertNotNull(trailer.getPointedToStreams());
		assertEquals(20, trailer.getPointedToStreams().length);
		
		assertEquals(20, hdgf.getTopLevelStreams().length);
		
		// 9th one should have children
		assertNotNull(trailer.getPointedToStreams()[8]);
		assertNotNull(trailer.getPointedToStreams()[8].getPointer());
		PointerContainingStream ps8 = (PointerContainingStream)
			trailer.getPointedToStreams()[8];
		assertNotNull(ps8.getPointedToStreams());
		assertEquals(8, ps8.getPointedToStreams().length);