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