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