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