Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 9739 invoked from network); 14 Mar 2006 11:21:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Mar 2006 11:21:16 -0000 Received: (qmail 36535 invoked by uid 500); 14 Mar 2006 11:21:13 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 35977 invoked by uid 500); 14 Mar 2006 11:21:11 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 35965 invoked by uid 99); 14 Mar 2006 11:21:11 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Mar 2006 03:21:11 -0800 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 202.81.18.152 is neither permitted nor denied by domain of paulex.yang@gmail.com) Received: from [202.81.18.152] (HELO ausmtp04.au.ibm.com) (202.81.18.152) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Mar 2006 03:21:09 -0800 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp04.au.ibm.com (8.12.10/8.13.5) with ESMTP id k2EBSVQt249246 for ; Tue, 14 Mar 2006 22:28:33 +1100 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.250.244]) by sd0208e0.au.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k2EBNlix044682 for ; Tue, 14 Mar 2006 22:24:00 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.12.11/8.13.3) with ESMTP id k2EBKSQq019493 for ; Tue, 14 Mar 2006 22:20:29 +1100 Received: from d23m0011.cn.ibm.com (d23m0011.cn.ibm.com [9.181.32.74]) by d23av03.au.ibm.com (8.12.11/8.12.11) with ESMTP id k2EBKSf4019477 for ; Tue, 14 Mar 2006 22:20:28 +1100 Received: from [127.0.0.1] ([9.181.106.208]) by d23m0011.cn.ibm.com (Lotus Domino Release 6.53HF294) with ESMTP id 2006031419202675-11096 ; Tue, 14 Mar 2006 19:20:26 +0800 Message-ID: <4416A6AB.9090201@gmail.com> Date: Tue, 14 Mar 2006 19:19:07 +0800 From: Paulex Yang User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: How to deal with this kind of serialization compatibility issue? References: <176117377.1141718258821.JavaMail.jira@ajax> <440D3FD9.3060000@gmail.com> <440D6A11.20106@googlemail.com> <906dd82e0603070337r45239913h@mail.gmail.com> <440D743B.6010306@googlemail.com> <906dd82e0603070426i5c23890di@mail.gmail.com> <440D8CF2.4030304@pobox.com> <906dd82e0603070628n7578952dh@mail.gmail.com> <440E91F5.6020406@gmail.com> <44106708.2000406@googlemail.com> <906dd82e0603100109r4f50bae0l@mail.gmail.com> In-Reply-To: <906dd82e0603100109r4f50bae0l@mail.gmail.com> X-MIMETrack: Itemize by SMTP Server on D23M0011/23/M/IBM(Release 6.53HF294 | January 28, 2005) at 14/03/2006 19:20:26, Serialize by Router on D23M0011/23/M/IBM(Release 6.53HF294 | January 28, 2005) at 14/03/2006 19:20:28, Serialize complete at 14/03/2006 19:20:28 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Mikhail I spent a little time on the framework, and I must say that this framework is very easy to use. Impressive! But I still have some thoughts on it: 1. Sometime assertEquals() is not enough for the deserialized objects, i.e., if the predefined constants is serialized first by JRE instance A and deserialized later on JRE instance B, it should has same object identity with the existing constants in B, for example, the Locale.CHINA should be unique in any JRE instance. So it will be perfect if some helper method like assertSame() is provided. It is also worth mentioning that some other time assertEquals() is too strict, because some serializable class may not override j.l.Object's equals(), so that the assertEquals() is equivalent to assertSame(), and it may not necessary. 2. I have some concerns on the abstract-class mode of SerializationTest, i.e., if some test want to leverage it, it must subclass this abstract class at first. What to do if it needs to inherited other abstract test cases, say, PerformanceTest? So personally I prefer the less "intrusive" way like utility class. Another option is make the test case implements an interface with getData(), say ISerializationTest, and pass an instance of this interface to the utility class(similar with command pattern). btw, I noticed there is also a serialization test utility class in the Harmony-57 contribution. The class is located in Harmon_Tests/src.helper/tests/util with name SerializationTester.java. It is a helper class which only providing some handy utility methods. But seems it lacks of adaptability to generate "GoldenFile" by reading configuration and not well documented. What I suggest is to merge the two classes in some way, so that the whole class library test suites can leverage the benefits of unified serialization test framework/utility/anything. thoughts? Mikhail Loenko wrote: > 2006/3/9, George Harley : > ... > >> Such a testing effort still sounds pretty daunting though. >> > > BTW, there is a framework for serialization testing which is currently > in the security module: > > modules/security/test/common/unit/org/apache/harmony/security/test/SerializationTest.java > > It serves to simplify serialization testing and has the docs inside. Actually > almost all serializable security-related classes are tested with this framework. > > Does it make sense to move the framework to a common place? > > Thanks, > Mikhail > > -- Paulex Yang China Software Development Lab IBM