Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 87553 invoked from network); 12 May 2006 15:50:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 May 2006 15:50:20 -0000 Received: (qmail 36865 invoked by uid 500); 12 May 2006 15:50:14 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 36814 invoked by uid 500); 12 May 2006 15:50:14 -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 36803 invoked by uid 99); 12 May 2006 15:50:14 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 May 2006 08:50:14 -0700 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: 82.138.226.220 is neither permitted nor denied by domain of t.p.ellison@gmail.com) Received: from [82.138.226.220] (HELO dublin.purplecloud.com) (82.138.226.220) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 May 2006 08:50:13 -0700 Received: (qmail 14937 invoked from network); 12 May 2006 16:50:07 +0100 Received: from unknown (HELO ?192.168.0.2?) (85.133.120.161) by smtp-dublin.purplecloud.com with (DHE-RSA-AES256-SHA encrypted) SMTP; 12 May 2006 16:50:07 +0100 Message-ID: <4464AE9B.3020601@gmail.com> Date: Fri, 12 May 2006 16:49:47 +0100 From: Tim Ellison User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [classlib] exception messages References: <445B2A13.3090604@gmail.com> <200605051337.k45DbBYV002681@d06av02.portsmouth.uk.ibm.com> <906dd82e0605052110s569b6307u23fc54bb0a2dcb6c@mail.gmail.com> <44645321.4090402@gmail.com> <906dd82e0605120253t76b755c3q7454808cf746c90d@mail.gmail.com> In-Reply-To: <906dd82e0605120253t76b755c3q7454808cf746c90d@mail.gmail.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Mikhail Loenko wrote: > 2006/5/12, Tim Ellison : >> Tests shouldn't assert the actual message String in an exception. > > I disagree. We need some technique to test exception messages. > As I wrote in the thread "should strings in exceptions match the > reference implementation?" sometimes (e.g. in regex) we do have to > test the messages I just went back to re-read your note (sorry I can't reference it 'cos he archive is down). You cite tests/api/java/util/regex/PatternSyntaxExceptionTest as rationale (which I note has been changed so it doesn't check the actual messages any more ;-) ) The spec for getMessage() [1] says: "Returns a multi-line string containing the description of the syntax error and its index, the erroneous regular-expression pattern, and a visual indication of the error index within the pattern." The only parts of that I can imagine testing with an API test are : - the string has multiple-lines - it contains "the erroneous regular-expression pattern" So let me refine my position to say, "our API tests shouldn't be asserting the value of unspecified parts of an exception message". Does that make sense? Of course, the reason for this is to ensure that we don't end up with lots of exception tests that fail when we translate the message strings. Regards, Tim [1] http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/PatternSyntaxException.html#getMessage() -- Tim Ellison (t.p.ellison@gmail.com) IBM Java technology centre, UK. --------------------------------------------------------------------- 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