1 2 17 18 19 package org.apache.poi.hssf.model; 20 21 import junit.framework.TestCase; 22 import org.apache.poi.hssf.usermodel.HSSFSheet; 23 import org.apache.poi.hssf.record.BOFRecord; 24 import org.apache.poi.hssf.record.EOFRecord; 25 import org.apache.poi.hssf.record.DimensionsRecord; 26 import org.apache.poi.hssf.record.aggregates.RowRecordsAggregate; 27 import org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate; 28 import org.apache.poi.hssf.record.aggregates.ColumnInfoRecordsAggregate; 29 30 import java.util.List ; 31 import java.util.ArrayList ; 32 33 38 public class TestSheet extends TestCase 39 { 40 public void testCreateSheet() throws Exception 41 { 42 List records = new ArrayList (); 44 records.add( new BOFRecord() ); 45 records.add( new DimensionsRecord() ); 46 records.add( new EOFRecord() ); 47 Sheet sheet = Sheet.createSheet( records, 0, 0 ); 48 49 int pos = 0; 50 assertTrue( sheet.records.get(pos++) instanceof BOFRecord ); 51 assertTrue( sheet.records.get(pos++) instanceof ColumnInfoRecordsAggregate ); 52 assertTrue( sheet.records.get(pos++) instanceof DimensionsRecord ); 53 assertTrue( sheet.records.get(pos++) instanceof RowRecordsAggregate ); 54 assertTrue( sheet.records.get(pos++) instanceof ValueRecordsAggregate ); 55 assertTrue( sheet.records.get(pos++) instanceof EOFRecord ); 56 } 57 58 } 59 | Popular Tags |