package ; import junit.framework.TestCase; /** * Tests the serialization and deserialization of the SubRecord * class works correctly. Test data taken directly from a real * Excel file. * */ public class TestSubRecord extends TestCase { byte[] data = new byte[] { }; public TestSubRecord(String name) { super(name); } public void testLoad() throws Exception { SubRecord record = new SubRecord((short), (short)data.length, data); assertEquals( "", record.get()); assertEquals( (byte), record.get()); assertEquals( (short), record.get()); assertEquals( (int), record.get()); assertEquals( (double), record.get()); assertEquals( , record.getRecordSize() ); record.validateSid((short)); } public void testStore() { SubRecord record = new SubRecord(); record.set( "" ); record.set( (byte) ); record.set( (short) ); record.set( (int) ); record.set( (double) ); byte [] recordBytes = record.serialize(); assertEquals(recordBytes.length - 4, data.length); for (int i = 0; i < data.length; i++) assertEquals("At offset " + i, data[i], recordBytes[i+4]); } } * @author assertEquals( , record.is() ); record.set( );