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

TestPaneRecord

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


      
    
        super(name);
    
Methods Summary
public voidtestLoad()

        PaneRecord record = new PaneRecord(new TestcaseRecordInputStream((short)0x41, (short)data.length, data));
        

        assertEquals( (short)1, record.getX());
        assertEquals( (short)2, record.getY());
        assertEquals( (short)3, record.getTopRow());
        assertEquals( (short)4, record.getLeftColumn());
        assertEquals( PaneRecord.ACTIVE_PANE_LOWER_LEFT, record.getActivePane());

        assertEquals( 14, record.getRecordSize() );

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

        PaneRecord record = new PaneRecord();

        record.setX( (short) 1);
        record.setY( (short) 2);
        record.setTopRow( (short) 3);
        record.setLeftColumn( (short) 4);
        record.setActivePane( PaneRecord.ACTIVE_PANE_LOWER_LEFT);

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