1 2 17 18 19 20 package org.apache.poi.hssf.record; 21 22 23 import junit.framework.TestCase; 24 25 33 public class TestSeriesToChartGroupRecord 34 extends TestCase 35 { 36 byte[] data = new byte[] { 37 (byte)0x0, (byte)0x0 38 }; 39 40 public TestSeriesToChartGroupRecord(String name) 41 { 42 super(name); 43 } 44 45 public void testLoad() 46 throws Exception 47 { 48 SeriesToChartGroupRecord record = new SeriesToChartGroupRecord((short)0x1045, (short)data.length, data); 49 assertEquals( 0x0, record.getChartGroupIndex()); 50 51 52 assertEquals( 0x6, record.getRecordSize() ); 53 54 record.validateSid((short)0x1045); 55 } 56 57 public void testStore() 58 { 59 SeriesToChartGroupRecord record = new SeriesToChartGroupRecord(); 60 record.setChartGroupIndex( (short)0x0 ); 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 |