harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stepan Mishura" <stepan.mish...@gmail.com>
Subject Re: [classlib] trying new framework for testing serialization
Date Fri, 07 Jul 2006 15:30:28 GMT
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: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message