FileDocCategorySizeDatePackage
TestSlideAtom.javaAPI DocApache Poi 3.0.12654Mon Jan 01 18:56:12 GMT 2007org.apache.poi.hslf.record

TestSlideAtom

public class TestSlideAtom extends TestCase
Tests that SlideAtom works properly
author
Nick Burch (nick at torchbox dot com)

Fields Summary
private byte[]
data_a
Constructors Summary
Methods Summary
public voidtestFlags()

		SlideAtom sa = new SlideAtom(data_a, 0, data_a.length);

		// First 12 bytes are a SSlideLayoutAtom, checked elsewhere

		// Check the IDs
		assertEquals(0x80000000, sa.getMasterID());
		assertEquals(256, sa.getNotesID());

		// Check the flags
		assertEquals(true, sa.getFollowMasterObjects());
		assertEquals(true, sa.getFollowMasterScheme());
		assertEquals(true, sa.getFollowMasterBackground());
	
public voidtestRecordType()


         
		SlideAtom sa = new SlideAtom(data_a, 0, data_a.length);
		assertEquals(1007l, sa.getRecordType());
	
public voidtestSSlideLayoutAtom()

		SlideAtom sa = new SlideAtom(data_a, 0, data_a.length);
		SSlideLayoutAtom ssla = sa.getSSlideLayoutAtom();

		assertEquals(0, ssla.getGeometryType());

		// Should also check the placehold IDs at some point
	
public voidtestWrite()

		SlideAtom sa = new SlideAtom(data_a, 0, data_a.length);
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		sa.writeOut(baos);
		byte[] b = baos.toByteArray();

		assertEquals(data_a.length, b.length);
		for(int i=0; i<data_a.length; i++) {
			assertEquals(data_a[i],b[i]);
		}