TestEscherClientDataRecordpublic class TestEscherClientDataRecord extends TestCase
Methods Summary |
---|
private org.apache.poi.ddf.EscherClientDataRecord | createRecord()
EscherClientDataRecord r = new EscherClientDataRecord();
r.setOptions( (short) 0x0002 );
r.setRecordId( EscherClientDataRecord.RECORD_ID );
r.setRemainingData( new byte[] {} );
return r;
| public void | testFillFields()
String hexData = "02 00 " +
"11 F0 " +
"00 00 00 00 ";
byte[] data = HexRead.readFromString( hexData );
EscherClientDataRecord r = new EscherClientDataRecord();
int bytesWritten = r.fillFields( data, new DefaultEscherRecordFactory() );
assertEquals( 8, bytesWritten );
assertEquals( (short)0xF011, r.getRecordId() );
assertEquals( "[]", HexDump.toHex(r.getRemainingData()) );
| public void | testSerialize()
EscherClientDataRecord r = createRecord();
byte[] data = new byte[8];
int bytesWritten = r.serialize( 0, data, new NullEscherSerializationListener() );
assertEquals( 8, bytesWritten );
assertEquals( "[02, 00, " +
"11, F0, " +
"00, 00, 00, 00, ]",
HexDump.toHex( data ) );
| public void | testToString()
String nl = System.getProperty("line.separator");
String expected = "org.apache.poi.ddf.EscherClientDataRecord:" + nl +
" RecordId: 0xF011" + nl +
" Options: 0x0002" + nl +
" Extra Data:" + nl +
"No Data" + nl ;
assertEquals( expected, createRecord().toString() );
|
|