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

TestSeriesRecord

public class TestSeriesRecord extends TestCase
Tests the serialization and deserialization of the SeriesRecord class works correctly. Test data taken directly from a real Excel file.
author
Glen Stampoultzis (glens at apache.org)

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


      
    
        super(name);
    
Methods Summary
public voidtestLoad()


        SeriesRecord record = new SeriesRecord(new TestcaseRecordInputStream((short)0x1003, (short)data.length, data));
        assertEquals( SeriesRecord.CATEGORY_DATA_TYPE_NUMERIC, record.getCategoryDataType());
        assertEquals( SeriesRecord.VALUES_DATA_TYPE_NUMERIC, record.getValuesDataType());
        assertEquals( 27, record.getNumCategories());
        assertEquals( 27, record.getNumValues());
        assertEquals( SeriesRecord.BUBBLE_SERIES_TYPE_NUMERIC, record.getBubbleSeriesType());
        assertEquals( 0, record.getNumBubbleValues());


        assertEquals( 16, record.getRecordSize() );

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

        SeriesRecord record = new SeriesRecord();
        record.setCategoryDataType( SeriesRecord.CATEGORY_DATA_TYPE_NUMERIC );
        record.setValuesDataType( SeriesRecord.VALUES_DATA_TYPE_NUMERIC );
        record.setNumCategories( (short)27 );
        record.setNumValues( (short)27 );
        record.setBubbleSeriesType( SeriesRecord.BUBBLE_SERIES_TYPE_NUMERIC );
        record.setNumBubbleValues( (short)0 );

        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]);