1 16 17 18 package org.apache.poi.hssf.record; 19 20 21 import junit.framework.TestCase; 22 23 29 public class TestSubRecord 30 extends TestCase 31 { 32 47 48 byte[] dataAutoFilter = new byte[]{ 49 (byte) 0x15, (byte) 0x00, (byte) 0x12, (byte) 0x00, (byte) 0x14, (byte) 0x00, (byte) 0x01, (byte) 0x00 51 , (byte) 0x01, (byte) 0x00, (byte) 0x01, (byte) 0x21, (byte) 0x00, (byte) 0x00, (byte) 0x3c, (byte) 0x13 52 , (byte) 0xf4, (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 53 54 , (byte) 0x0c, (byte) 0x00 56 , (byte) 0x14, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 57 , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x08, (byte) 0x00 58 , (byte) 0x00, (byte) 0x00, (byte) 0x10, (byte) 0x00, (byte) 0x00, (byte) 0x00 59 60 , (byte) 0x13, (byte) 0x00 62 , (byte) 0xee, (byte) 0x1f, (byte) 0x00, (byte) 0x00, (byte) 0x08, (byte) 0x00, (byte) 0x08, (byte) 0x00 63 , (byte) 0x01, (byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0x0a, (byte) 0x00, (byte) 0x14, (byte) 0x00 64 , (byte) 0x6c, (byte) 0x00 65 66 , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 68 }; 69 70 public TestSubRecord( String name ) 71 { 72 super( name ); 73 } 74 75 public void testParseCmo() 76 { 77 Record r = SubRecord.createSubRecord( (short) 0x0015, (short) 0x0012, dataAutoFilter, 0x0000 ); 78 assertEquals( "ftCmo is 22 bytes", 22, r.getRecordSize() ); 79 assertEquals( "ftCmo is a CommonObjectDataSubRecord" 80 , "org.apache.poi.hssf.record.CommonObjectDataSubRecord" 81 , r.getClass().getName() ); 82 } 83 84 public void testParseAutoFilterLbsData() 85 { 86 Record r = SubRecord.createSubRecord( (short) 0x0013, (short) 0x1fee, dataAutoFilter, 0x0032 ); 87 assertEquals( "ftLbsData is 20 bytes", 20, r.getRecordSize() ); 88 } 89 90 public void testParseEnd() 91 { 92 Record r = SubRecord.createSubRecord( (short) 0x0000, (short) 0x0000, dataAutoFilter, 0x0046 ); 93 assertEquals( "ftEnd is 4 bytes", 4, r.getRecordSize() ); 94 assertEquals( "ftEnd is a EndSubRecord" 95 , "org.apache.poi.hssf.record.EndSubRecord" 96 , r.getClass().getName() ); 97 } 98 } 99 | Popular Tags |