package ;
import junit.framework.TestCase;
/**
* Tests the serialization and deserialization of the Record
* class works correctly. Test data taken directly from a real
* Excel file.
*
*/
public class TestRecord
extends TestCase
{
byte[] data = new byte[] {
};
public TestRecord(String name)
{
super(name);
}
public void testLoad()
throws Exception
{
Record record = new Record((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()
{
Record record = new Record();
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( );