From harmony-dev-return-9918-apmail-incubator-harmony-dev-archive=incubator.apache.org@incubator.apache.org Fri Jul 07 15:31:54 2006 Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 96280 invoked from network); 7 Jul 2006 15:31:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Jul 2006 15:31:54 -0000 Received: (qmail 28408 invoked by uid 500); 7 Jul 2006 15:31:52 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 28366 invoked by uid 500); 7 Jul 2006 15:31:51 -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 28340 invoked by uid 99); 7 Jul 2006 15:31:51 -0000 Received-SPF: pass (hermes.apache.org: domain of stepan.mishura@gmail.com designates 66.249.92.169 as permitted sender) Received: from [66.249.92.169] (HELO ug-out-1314.google.com) (66.249.92.169) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jul 2006 08:31:50 -0700 Received: by ug-out-1314.google.com with SMTP id h2so163285ugf for ; Fri, 07 Jul 2006 08:30:28 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=W4CQjP0gNEH7qHnZeB2x9D3RvStsBLlBvAE66MmHRVmBBEGdzOxkui+xpvJ7KyiaIzRiMhXAtN33ipXtiRXjgfxxz7pC3t4b16wGHTSgfDKElCGkMQq2Id5RDYTVprO0y1/Bf2fAEZGjjiKhYSwsIQEBeOo+CKRDPxhyA/coHQo= Received: by 10.78.136.7 with SMTP id j7mr745817hud; Fri, 07 Jul 2006 08:30:28 -0700 (PDT) Received: by 10.78.131.6 with HTTP; Fri, 7 Jul 2006 08:30:28 -0700 (PDT) Message-ID: <6e47b64f0607070830l62ffea1fvf3e4a55dfd80846d@mail.gmail.com> Date: Fri, 7 Jul 2006 22:30:28 +0700 From: "Stepan Mishura" To: harmony-dev@incubator.apache.org Subject: Re: [classlib] trying new framework for testing serialization In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_70901_10753897.1152286228843" References: <6e47b64f0607050107l3c524306j8fe9e643a2fb31d7@mail.gmail.com> <001901c6a0a9$5f046ac0$0e01a8c0@LITTLEGUY> <6e47b64f0607062259l1d3cc3eh6309c394cc913b53@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_70901_10753897.1152286228843 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 ------=_Part_70901_10753897.1152286228843--