1 2 17 18 19 20 package org.apache.poi.hssf.record; 21 22 23 import junit.framework.TestCase; 24 25 33 public class TestSeriesIndexRecord 34 extends TestCase 35 { 36 byte[] data = new byte[] { 37 (byte)0x03,(byte)0x00 38 }; 39 40 public TestSeriesIndexRecord(String name) 41 { 42 super(name); 43 } 44 45 public void testLoad() 46 throws Exception 47 { 48 SeriesIndexRecord record = new SeriesIndexRecord((short)0x1065, (short)data.length, data); 49 50 51 assertEquals( (short)3, record.getIndex()); 52 53 54 assertEquals( 6, record.getRecordSize() ); 55 56 record.validateSid((short)0x1065); 57 } 58 59 public void testStore() 60 { 61 SeriesIndexRecord record = new SeriesIndexRecord(); 62 63 64 65 record.setIndex( (short)3 ); 66 67 68 byte [] recordBytes = record.serialize(); 69 assertEquals(recordBytes.length - 4, data.length); 70 for (int i = 0; i < data.length; i++) 71 assertEquals("At offset " + i, data[i], recordBytes[i+4]); 72 } 73 } 74 | Popular Tags |