TestNameRecord.javaAPI DocApache Poi 3.0.12702Mon Jan 01 12:39:46 GMT 2007org.apache.poi.hssf.record


public class TestNameRecord extends TestCase
Tests the NameRecord serializes/deserializes correctly
Danny Mui (dmui at apache dot org)

Fields Summary
Constructors Summary
Methods Summary
public voidtestFillExtras()
Makes sure that additional name information is parsed properly such as menu/description

        byte[] examples = {
            (byte) 0x88, (byte) 0x03, (byte) 0x67, (byte) 0x06,
            (byte) 0x07, (byte) 0x00, (byte) 0x00, (byte) 0x00,
            (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x23,
            (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x4D,
            (byte) 0x61, (byte) 0x63, (byte) 0x72, (byte) 0x6F,
            (byte) 0x31, (byte) 0x3A, (byte) 0x01, (byte) 0x00,
            (byte) 0x00, (byte) 0x00, (byte) 0x11, (byte) 0x00,
            (byte) 0x00, (byte) 0x4D, (byte) 0x61, (byte) 0x63,
            (byte) 0x72, (byte) 0x6F, (byte) 0x20, (byte) 0x72,
            (byte) 0x65, (byte) 0x63, (byte) 0x6F, (byte) 0x72,
            (byte) 0x64, (byte) 0x65, (byte) 0x64, (byte) 0x20,
            (byte) 0x32, (byte) 0x37, (byte) 0x2D, (byte) 0x53,
            (byte) 0x65, (byte) 0x70, (byte) 0x2D, (byte) 0x39,
            (byte) 0x33, (byte) 0x20, (byte) 0x62, (byte) 0x79,
            (byte) 0x20, (byte) 0x41, (byte) 0x4C, (byte) 0x4C,
            (byte) 0x57, (byte) 0x4F, (byte) 0x52

        NameRecord name = new NameRecord(new TestcaseRecordInputStream(NameRecord.sid, (short) examples.length, examples));
        String description = name.getDescriptionText();
        assertNotNull( description );
        assertTrue( "text contains ALLWOR", description.indexOf( "ALLWOR" ) > 0 );