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

TestTextHeaderAtom

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

Fields Summary
private byte[]
notes_data
private byte[]
title_data
private byte[]
body_data
Constructors Summary
Methods Summary
public voidtestRecordType()


         
		TextHeaderAtom tha = new TextHeaderAtom(notes_data,0,12);
		assertEquals(3999l, tha.getRecordType());
	
public voidtestTypes()

		TextHeaderAtom n_tha = new TextHeaderAtom(notes_data,0,12);
		TextHeaderAtom t_tha = new TextHeaderAtom(title_data,0,12);
		TextHeaderAtom b_tha = new TextHeaderAtom(body_data,0,12);
		assertEquals(TextHeaderAtom.NOTES_TYPE, n_tha.getTextType());
		assertEquals(TextHeaderAtom.TITLE_TYPE, t_tha.getTextType());
		assertEquals(TextHeaderAtom.BODY_TYPE, b_tha.getTextType());
	
public voidtestWrite()

		TextHeaderAtom tha = new TextHeaderAtom(notes_data,0,12);
		ByteArrayOutputStream baos = new ByteArrayOutputStream();
		tha.writeOut(baos);
		byte[] b = baos.toByteArray();

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