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

TestDocumentAtom

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

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

		DocumentAtom da = new DocumentAtom(data_a, 0, data_a.length);
		assertEquals(false, da.getSaveWithFonts());
		assertEquals(false, da.getOmitTitlePlace());
		assertEquals(false, da.getRightToLeft());
		assertEquals(true, da.getShowComments());
	
public voidtestMasterPersist()

		DocumentAtom da = new DocumentAtom(data_a, 0, data_a.length);
		assertEquals(2l, da.getNotesMasterPersist());
		assertEquals(0l, da.getHandoutMasterPersist());
	
public voidtestRecordType()


         
		DocumentAtom da = new DocumentAtom(data_a, 0, data_a.length);
		assertEquals(1001l, da.getRecordType());
	
public voidtestSizeAndZoom()

		DocumentAtom da = new DocumentAtom(data_a, 0, data_a.length);
		assertEquals(5760l, da.getSlideSizeX());
		assertEquals(4320l, da.getSlideSizeY());
		assertEquals(4320l, da.getNotesSizeX());
		assertEquals(5760l, da.getNotesSizeY());

		assertEquals(5l, da.getServerZoomFrom());
		assertEquals(10l, da.getServerZoomTo());
	
public voidtestSlideDetails()

		DocumentAtom da = new DocumentAtom(data_a, 0, data_a.length);
		assertEquals(1, da.getFirstSlideNum());
		assertEquals(0, da.getSlideSizeType());
	
public voidtestWrite()

		DocumentAtom da = new DocumentAtom(data_a, 0, data_a.length);
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		da.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]);
		}