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

TestChartRecord

public class TestChartRecord extends TestCase
Tests the serialization and deserialization of the ChartRecord 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 TestChartRecord(String name)


      
    
        super(name);
    
Methods Summary
public voidtestLoad()


        ChartRecord record = new ChartRecord(new TestcaseRecordInputStream((short)0x1002, (short)data.length, data));
        assertEquals( 0, record.getX());
        assertEquals( 0, record.getY());
        assertEquals( 30474216, record.getWidth());
        assertEquals( 15060168, record.getHeight());


        assertEquals( 20, record.getRecordSize() );

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

        ChartRecord record = new ChartRecord();
        record.setX( 0 );
        record.setY( 0 );
        record.setWidth( 30474216 );
        record.setHeight( 15060168 );


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