1 2 17 18 package org.apache.poi.ddf; 19 20 import junit.framework.TestCase; 21 22 import java.util.List ; 23 24 import org.apache.poi.util.HexRead; 25 import org.apache.poi.util.HexDump; 26 27 30 public class TestEscherPropertyFactory extends TestCase 31 { 32 public void testCreateProperties() throws Exception 33 { 34 String dataStr = "41 C1 " + "03 00 00 00 " + "01 00 " + "00 00 00 00 " + "41 C1 " + "03 00 00 00 " + "01 02 03 " + 41 "01 02 03 " 42 ; 43 byte[] data = HexRead.readFromString( dataStr ); 44 EscherPropertyFactory f = new EscherPropertyFactory(); 45 List props = f.createProperties( data, 0, (short)3 ); 46 EscherComplexProperty p1 = (EscherComplexProperty) props.get( 0 ); 47 assertEquals( (short)0xC141, p1.getId() ); 48 assertEquals( "[01, 02, 03, ]", HexDump.toHex( p1.getComplexData() ) ); 49 50 EscherComplexProperty p3 = (EscherComplexProperty) props.get( 2 ); 51 assertEquals( (short)0xC141, p3.getId() ); 52 assertEquals( "[01, 02, 03, ]", HexDump.toHex( p3.getComplexData() ) ); 53 54 55 } 56 57 58 59 } 60 | Popular Tags |