harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang" <zhanghuang...@gmail.com>
Subject Re: should strings in exceptions match the reference implementation?
Date Mon, 17 Apr 2006 08:36:55 GMT
Hi, MIkhail,

Thanks for the information.

I took a quick look
at  tests/api/java/util/regex/PatternSyntaxExceptionTest.
Yes, the exception description is important to developers, however, I can't
find the message defination in java spec.
Am I missing something?
If no,  don't you think test case such as
"assertTrue(e.getDescription().equals("')'
is expected."));" is a bit arbitrary?
Is there anything wrong if the message is sth. like "Expected ")" is not
found" ? Both are meaningful to developers.

As Anton Avtamonov metioned(most of us agreeed) ,we should not regard such
difference as a failure.
Then, How to solve such problems? IMHO, we'd better avoid such cases, or at
most, checking some key information instead of using "equals", e.g, in this
case,
checking whether the message is not null and contains ")" or sth like.

I don't think change to code as following would solve the problem:
if(Util.IsHarmony()){
assertTrue(e.getDescription().equals("')' is expected."));
}
Then who's the rule maker? PatternSyntaxException class developers?
Maybe if there are some spec or documents which define these messages, I'll
support such testing way. :-)

On 4/17/06, Mikhail Loenko <mloenko@gmail.com> wrote:
>
>
>
> Hi Andrew
>
> Look at tests/api/java/util/regex/PatternSyntaxExceptionTest to get some
> ideas. When you parse something and that something is incorrect the
> message does matter.
>
> And you have a test to verify that you do not report ()s mismatch when
> the problem is somewhere else.
>
> Thanks,
> Mikhail
>
> > I think RI should contain similiar information so that we can write some
> > test cases, which both RI and Harmony could pass, by verifying keywords
> > instead.
> > If "isHarmony()" is used, then what's the expected message? I don't
> think
> > there's a "Harmony exception message spec" :-)
> > People may argue which message is best or more meanfuling :)
> >
> > Wishes,
> > > --
> > > Anton Avtamonov,
> > > 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
> > >
> > >
> >
> >
> > --
> > Andrew Zhang
> > China Software 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
>
>


--
Andrew Zhang
China Software Development Lab, IBM

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message