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

TestAxisParentRecord

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


      
    
        super(name);
    
Methods Summary
public voidtestLoad()

        AxisParentRecord record = new AxisParentRecord(new TestcaseRecordInputStream((short)0x1041, (short)data.length, data));
        assertEquals( AxisParentRecord.AXIS_TYPE_MAIN, record.getAxisType());
        assertEquals( 0x021d, record.getX());
        assertEquals( 0xdd, record.getY());
        assertEquals( 0x0b31, record.getWidth());
        assertEquals( 0x0b56, record.getHeight());


        assertEquals( 22, record.getRecordSize() );

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

        AxisParentRecord record = new AxisParentRecord();
        record.setAxisType( AxisParentRecord.AXIS_TYPE_MAIN );
        record.setX( 0x021d );
        record.setY( 0xdd );
        record.setWidth( 0x0b31 );
        record.setHeight( 0x0b56 );


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