Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 91457 invoked from network); 14 Mar 2006 10:34:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Mar 2006 10:34:14 -0000 Received: (qmail 86511 invoked by uid 500); 14 Mar 2006 10:34:05 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 86039 invoked by uid 500); 14 Mar 2006 10:34:03 -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 86028 invoked by uid 99); 14 Mar 2006 10:34:03 -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 02:34:03 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of stepan.mishura@gmail.com designates 64.233.182.198 as permitted sender) Received: from [64.233.182.198] (HELO nproxy.gmail.com) (64.233.182.198) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Mar 2006 02:34:01 -0800 Received: by nproxy.gmail.com with SMTP id g2so1022922nfe for ; Tue, 14 Mar 2006 02:33:40 -0800 (PST) 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=hZ7JUq1pApE/io5NfpXdb2gNOYOPs8CqlR1YanThk0myEDuPqd2pyhjB6WSclqRpx6UQwoqrjBfA3Y9YOHvcfm2RjKD1GgTydPIFb0MSo7y8uBxvA0QUP4KPtLyPeTZplMHYeik1QxlBhQySJ41q+nptS1gyzlEz9QgkRvPtcWM= Received: by 10.49.40.20 with SMTP id s20mr42611nfj; Tue, 14 Mar 2006 02:33:40 -0800 (PST) Received: by 10.49.9.20 with HTTP; Tue, 14 Mar 2006 02:33:40 -0800 (PST) Message-ID: <6e47b64f0603140233l6119364agecab5d92e1076642@mail.gmail.com> Date: Tue, 14 Mar 2006 16:33:40 +0600 From: "Stepan Mishura" To: harmony-dev@incubator.apache.org Subject: Re: Location of test data files In-Reply-To: <4416966E.5040606@googlemail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2819_26219565.1142332420343" References: <176117377.1141718258821.JavaMail.jira@ajax> <440E91F5.6020406@gmail.com> <44106708.2000406@googlemail.com> <906dd82e0603100109r4f50bae0l@mail.gmail.com> <4411B8E2.1060206@googlemail.com> <4411D168.3060607@googlemail.com> <44126B5C.1020104@gmail.com> <44156FF6.5020109@googlemail.com> <6e47b64f0603132137p68948050w73f8d7bd5c102dcf@mail.gmail.com> <4416966E.5040606@googlemail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_2819_26219565.1142332420343 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi George, > >Yes, that sounds great - with the very minor suggestion that at build >time these test resource files go to their corresponding sub-directories >under the test bin (e.g. bin/test) which is separate from the bin folder >(e.g. bin/main) that the stuff getting tested is compiled to. > Agree. Thanks, Stepan. On 3/14/06, George Harley wrote: > > Stepan Mishura wrote: > > On 3/13/06, George Harley wrote: > > > >> Richard Liang wrote: > >> > >>> George Harley wrote: > >>> > >>>> Hi Mikhail (again), > >>>> > >>>> Just a couple of brief observations about the SerializationTest.java > >>>> code as it stands in SVN today : > >>>> > >>>> 1) The reference/golden .dat files for Serializable classes in a > >>>> given module could be added under the module's src/test/resources > >>>> directory (in sub-folders corresponding to their package names). In > >>>> an Ant build these would be copied under the test bin using a tweake= d > >>>> version of the "copy-test-resources" target (see the proposed change= s > >>>> to make/build-java.xml contained in the HARMONY-57). At runtime this > >>>> would make the .dat files available from the classpath. > >>>> > >>>> > >>> Hello George, > >>> > >>> It's good to put all test data files for one module into one folder, > >>> such as "src/test/resources". However, there may be other options, > >>> personally I'd like to put the test data file into the same directory > >>> of the test case which uses the data file. This may make the > >>> maintenance work easy. :-) > >>> Anyway, I think we shall follow the same style. > >>> > >> Hi Richard, > >> > >> Just to avoid any ambiguity here, what I proposed was to place the > >> reference serialization files *under* a given module's > >> src/test/resources folder in sub-folders that matched the package name > >> of the test class - and not just have them all in one folder. > >> > >> For instance, the LUNI module could have a SimpleTimeZoneTest.dat file > >> located in the folder > >> /src/test/resources/serialization/tests/api/java/util > >> > >> Another alternative would be to use a tree structure that mirrored the > >> package name of the Serializable type under test. > >> e.g. > >> > >> > /src/test/resources/serialization/java/util/SimpleTimeZoneTe= st.dat > >> > > > > > > To make it more clear because we talked only about data files for > testing > > serialization but I'm aware of all resource files. So we have the > following > > proposal: > > /src/test/resources > > img/ <=3D=3D image files > > net/ <=3D=3D net resource files > > other/ <=3D=3D disembodied files, for example, policy f= iles > > serialization/ <=3D=3D data files for serialization > > > > And during the build all resource files will be copied to: > build/resources > > directory. Right? > > > > Thanks, > > Stepan > > > > > > Hi Stepan, > > Yes, that sounds great - with the very minor suggestion that at build > time these test resource files go to their corresponding sub-directories > under the test bin (e.g. bin/test) which is separate from the bin folder > (e.g. bin/main) that the stuff getting tested is compiled to. > > Best regards, > George > > > > I think that separating out all test artefacts from actual source code > > > >> is cleaner and IMHO makes the maintenance easier :-) > >> > >> Using either Ant or it is pretty straightforward to ge= t > >> these resources placed on the classpath when the tests are run. > >> > >> > >> Best regards, > >> George > >> > >> > >>>> 2) The need for the "TEST_SRC_DIR" system property goes away if > >>>> method getDataFile() were updated to use java.net.URI. > >>>> e.g, > >>>> > >>>> protected File getDataFile(int index) { > >>>> String name =3D "/" + this.getClass().getName().replace('.', '/')= + > >>>> > >> "." > >> > >>>> + index + ".dat"; > >>>> return new > >>>> File(URI.create(this.getClass().getResource(name).toString())); > >>>> > >>>> > >>>> It seems to me that the src/test/resources directory would be an > >>>> ideal place to keep a module's reference .dat files. > >>>> > >>>> Best regards, > >>>> George > >>>> > >>>> > >>>> George Harley wrote: > >>>> > >>>>> 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/Serial= izationTest.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? > >>>>>> > >>>>>> > >>>>> Hi Mikhail ! > >>>>> > >>>>> I've spent a little bit of time running this (with a couple of my > own > >>>>> little concrete subclasses of SerializationTest) and I really like > it. > >>>>> It was pretty straightforward to create a JUnit error for the case > of > >>>>> java.util.TimeZone after my overridden version of getData() used > >>>>> TimeZone.getDefault() to generate a couple of TimeZone instances > from > >>>>> the RI. > >>>>> > >>>>> I can definitely see a case for broadening this approach outside > just > >>>>> the security classes. Really impressive stuff ! > >>>>> > >>>>> Best regards, > >>>>> George > >>>>> > >>>>> > >>>>>> Thanks, > >>>>>> Mikhail > >>>>>> > >>>>>> > >>>>>> > >>>>> > >>>>> > >>>>> > >>>> > >>> > >> > > > > > > -- > > Thanks, > > Stepan Mishura > > Intel Middleware Products Division > > > > > > -- Thanks, Stepan Mishura Intel Middleware Products Division ------=_Part_2819_26219565.1142332420343--