harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Loenko, Mikhail Y" <mikhail.y.loe...@intel.com>
Subject RE: [classlib] exception messages
Date Fri, 12 May 2006 16:37:31 GMT
>From: Tim Ellison [mailto:t.p.ellison@gmail.com]
>Sent: Friday, May 12, 2006 10:50 PM
>To: harmony-dev@incubator.apache.org
>Subject: Re: [classlib] exception messages
>Mikhail Loenko wrote:
>> 2006/5/12, Tim Ellison <t.p.ellison@gmail.com>:
>>> 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".
>that make sense?

Yes, it does. But we might have impl tests that check for exception


>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
>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

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

View raw message