FileDocCategorySizeDatePackage
TestSeriesTextRecord.javaAPI DocApache Poi 3.0.12756Mon Jan 01 12:39:46 GMT 2007org.apache.poi.hssf.record

TestSeriesTextRecord

public class TestSeriesTextRecord extends TestCase
Tests the serialization and deserialization of the SeriesTextRecord class works correctly. Test data taken directly from a real Excel file.
author
Andrew C. Oliver (acoliver at apache.org)

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


      
    
        super(name);
    
Methods Summary
public voidtestLoad()

        SeriesTextRecord record = new SeriesTextRecord(new TestcaseRecordInputStream((short)0x100d, (short)data.length, data));
        

        assertEquals( (short)0, record.getId());

        assertEquals( (byte)0x0C, record.getTextLength());

        assertEquals( (byte)0x01, record.getUndocumented());

        assertEquals( "Value Number", record.getText());


        assertEquals( 32, record.getRecordSize() );

        record.validateSid((short)0x100d);
    
public voidtestStore()

        SeriesTextRecord record = new SeriesTextRecord();



        record.setId( (short)0 );

        record.setTextLength( (byte)0x0C );

        record.setUndocumented( (byte)0x01 );

        record.setText( "Value Number" );


        byte [] recordBytes = record.serialize();
        assertEquals(recordBytes.length - 4, data.length);
        for (int i = 0; i < data.length; i++)
            assertEquals("At offset " + i, data[i], recordBytes[i+4]);