FileDocCategorySizeDatePackage
TestNoteStructureSubRecord.javaAPI DocApache Poi 3.0.12400Mon Jan 01 18:59:10 GMT 2007org.apache.poi.hssf.record

TestNoteStructureSubRecord

public class TestNoteStructureSubRecord extends TestCase
Tests the serialization and deserialization of the NoteRecord class works correctly. Test data taken directly from a real Excel file.
author
Yegor Kozlov

Fields Summary
private byte[]
data
Constructors Summary
public TestNoteStructureSubRecord(String name)


      
    
        super(name);
    
Methods Summary
public voidtestRead()


        NoteStructureSubRecord record = new NoteStructureSubRecord(new TestcaseRecordInputStream(NoteStructureSubRecord.sid, (short)data.length, data));

        assertEquals(NoteStructureSubRecord.sid, record.getSid());
        record.validateSid(NoteStructureSubRecord.sid);
        assertEquals(data.length + 4, record.getRecordSize());

    
public voidtestWrite()

        NoteStructureSubRecord record = new NoteStructureSubRecord();
        assertEquals(NoteStructureSubRecord.sid, record.getSid());
        record.validateSid(NoteStructureSubRecord.sid);
        assertEquals(data.length + 4, record.getRecordSize());

        byte [] ser = record.serialize();
        assertEquals(ser.length - 4, data.length);