FileDocCategorySizeDatePackage
TestColumnInfoRecordsAggregate.javaAPI DocApache Poi 3.0.12741Mon Jan 01 12:39:46 GMT 2007org.apache.poi.hssf.record.aggregates

TestColumnInfoRecordsAggregate

public class TestColumnInfoRecordsAggregate extends TestCase
author
Glen Stampoultzis

Fields Summary
ColumnInfoRecordsAggregate
columnInfoRecordsAggregate
Constructors Summary
Methods Summary
private org.apache.poi.hssf.record.ColumnInfoRecordcreateColumn(short firstCol, short lastCol)

        ColumnInfoRecord columnInfoRecord = new ColumnInfoRecord( );
        columnInfoRecord.setFirstColumn(firstCol);
        columnInfoRecord.setLastColumn(lastCol);
        return columnInfoRecord;
    
private intserializedSize()

        return columnInfoRecordsAggregate.serialize(0, new byte[columnInfoRecordsAggregate.getRecordSize()]);
    
public voidtestGetRecordSize()

        columnInfoRecordsAggregate = new ColumnInfoRecordsAggregate();
        columnInfoRecordsAggregate.insertColumn( createColumn( (short)1, (short)3 ));
        columnInfoRecordsAggregate.insertColumn( createColumn( (short)4, (short)7 ));
        columnInfoRecordsAggregate.insertColumn( createColumn( (short)8, (short)8 ));
//        columnInfoRecordsAggregate.setColumn( (short)2, new Short( (short)200 ), new Integer( 1 ), new Boolean( true ), null);
        columnInfoRecordsAggregate.groupColumnRange( (short)2, (short)5, true );
        System.out.println( "columnInfoRecordsAggregate = " + columnInfoRecordsAggregate.getNumColumns() );

        assertEquals(columnInfoRecordsAggregate.getRecordSize(), columnInfoRecordsAggregate.serialize().length);

        columnInfoRecordsAggregate = new ColumnInfoRecordsAggregate();
        columnInfoRecordsAggregate.groupColumnRange( (short)3, (short)6, true );

        assertEquals(columnInfoRecordsAggregate.getRecordSize(), serializedSize());