Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 19061 invoked from network); 11 Oct 2006 08:28:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Oct 2006 08:28:59 -0000 Received: (qmail 10618 invoked by uid 500); 11 Oct 2006 08:28:54 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 10577 invoked by uid 500); 11 Oct 2006 08:28:54 -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 10566 invoked by uid 99); 11 Oct 2006 08:28:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Oct 2006 01:28:53 -0700 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of roberthurui@gmail.com designates 64.233.162.206 as permitted sender) Received: from [64.233.162.206] (HELO nz-out-0102.google.com) (64.233.162.206) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Oct 2006 01:28:52 -0700 Received: by nz-out-0102.google.com with SMTP id v1so56379nzb for ; Wed, 11 Oct 2006 01:28:32 -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=Yo913cQSzbPySiWiPS1lL1YRD53GOEHw8YXUYCx3WkbTa+GOEeoj5BZBxsSA7ese/H9oQfPgX19bMV3f1/ZQYkvhNntd4arqnCvzTZgV6ODOHy3zIqgtbLTavaqlDDKMILlK1ksWsYszUATNNjQkVIONe/nxWh1RqRmsVifmHms= Received: by 10.65.234.2 with SMTP id l2mr192111qbr; Wed, 11 Oct 2006 01:28:31 -0700 (PDT) Received: by 10.65.153.16 with HTTP; Wed, 11 Oct 2006 01:28:31 -0700 (PDT) Message-ID: Date: Wed, 11 Oct 2006 16:28:31 +0800 From: "Rui Hu" To: harmony-dev@incubator.apache.org Subject: Re: [classlib] [tests] Can anyone explain what these are for? In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_19978_5672183.1160555311793" References: <200610101837.k9AIbU4a018191@d06av02.portsmouth.uk.ibm.com> <3b3f27c60610101938v6ccd89d4i1418c03d2ab97b2d@mail.gmail.com> <3b3f27c60610102109m40778c8bwb4c0a012f20c3d6f@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_19978_5672183.1160555311793 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I've written a script to search all the statements like that: #!/usr/bin/perl -w use File::Find; use DirHandle; use strict; my $dir = $ARGV[0] || die "need input a dir\n"; chomp $dir; processDir($dir); sub processDir { my $folder = $_[0]; my $dh = DirHandle->new($folder) || die "can not open directiony: $!\n"; foreach my $f ($dh->read()) { next if ($f=~/^\.$|^\.\.$|^\..*$/); if (-d "$folder\/$f"){ processDir("$folder\/$f"); } if ($f=~/^.*Test\.java$/){ processFile("$folder\/$f"); } } } sub processFile { my $f = $_[0]; my $lineNum = 1; my $line=""; open (MYFILE,"$f") || die "can not open file: $!\n"; while ($line=){ chomp $line; if ($line=~/^\s*assertTrue.*true\s*\)\s*;\s*$/){ print "$f:$lineNum\n"; } $lineNum = $lineNum +1; } } And found 88 statements like that in current classlib, then record them in [1]. We can check them. [1].http://wiki.apache.org/harmony/Invalid_assertTrue On 10/11/06, Richard Liang wrote: > > On 10/11/06, Nathan Beyer wrote: > > Perhaps, but there are much better ways of determining that. From just > > reading the test code to code coverage tools. > > > > From my analysis, these were part of the large test contribution and > > indicated that there wasn't an explicit test for that method. In most > > cases, there were tests for these methods, either in other classes or > > in other methods of the class. > > Nathan, I agree ;-) > > > > > -Nathan > > > > On 10/10/06, Richard Liang wrote: > > > On 10/11/06, Nathan Beyer wrote: > > > > I've seen a few and I've deleted any that I've come across. I would > > > > say feel free to delete them too. I've also been deleting empty > setup > > > > and teardown methods too. > > > > > > Please do not simply delete them. Maybe that means we are lack of the > > > test for some methods, for example "getInetAddress". > > > > > > > > > > > -Nathan > > > > > > > > On 10/10/06, Alexey Petrenko wrote: > > > > > These could be a result of copy/paste tests creation. > > > > > And I'm curious why it was written for the first time. :) > > > > > > > > > > SY, Alexey > > > > > > > > > > 2006/10/10, Mark Hindess : > > > > > > > > > > > > I've come across a couple of tests with things like: > > > > > > > > > > > > public void test_getInetAddress() { > > > > > > assertTrue("Used to test", true); > > > > > > } > > > > > > > > > > > > Can anyone explain why we have these? > > > > > > > > > > > > Regards, > > > > > > Mark. > > > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Alexey A. Petrenko > > > > > 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 > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > 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 > > > > > > > > > > > > > > > > > -- > > > Richard Liang > > > China Development Lab, IBM > > > > > > --------------------------------------------------------------------- > > > 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 > > > > > > > > > > --------------------------------------------------------------------- > > 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 > > > > > > > -- > Richard Liang > China Development Lab, IBM > > --------------------------------------------------------------------- > 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 > > -- Robert Hu China Software Development Lab, IBM ------=_Part_19978_5672183.1160555311793--