TestTextHeaderAtompublic class TestTextHeaderAtom extends TestCase Tests that TextHeaderAtom works properly |
Fields Summary |
---|
private byte[] | notes_data | private byte[] | title_data | private byte[] | body_data |
Methods Summary |
---|
public void | testRecordType()
TextHeaderAtom tha = new TextHeaderAtom(notes_data,0,12);
assertEquals(3999l, tha.getRecordType());
| public void | testTypes()
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 void | testWrite()
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]);
}
|
|