Anton, You suggestion works only if a test extends SerializationTest but we agree avoid this (i.e. a test should invoke only static utility methods of SerializationTest)
Thanks, Stepan. On 7/7/06, Anton Luht wrote:
Stepan, I think that there's no need in SerializableAssert interface - just put assertDeserialized(Serializable, Serializable) method to SerializationTest class with default implementation based on current code from defineComparator (if there's equals(), use it, if it's instance of Throwable, use some other scheme, etc). If a developer needs his own comparing method, he just redefines this method. If he's happy with equals(), he does nothing. So, verifySelf will look like: ByteArrayOutputStream out = new ByteArrayOutputStream(); putObjectToStream(object, out); ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); assertDeserialized((Serializable) object, (Serializable) getObjectFromStream(in)); This will help us remove methods with SerializableAsset as a third parameter. And a small note: we don't need flush() before close() :) -- Regards, Anton Luht, Intel Middleware Products Division -- Thanks, Stepan Mishura Intel Middleware Products Division ------------------------------------------------------ Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]