harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Luht" <anton.l...@gmail.com>
Subject Re: [classlib] trying new framework for testing serialization
Date Fri, 07 Jul 2006 13:02:10 GMT

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)

This will help us remove methods with SerializableAsset as a third parameter.

And a small note: we don't need flush() before close() :)

Anton Luht,
Intel Middleware Products Division

Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

View raw message