harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang" <zhanghuang...@gmail.com>
Subject Re: [classlib] exception messages
Date Sat, 13 May 2006 03:19:48 GMT
Hello,

If we really decide to test exception message, I think we could write test
case as follows:

public void test_f(){
    .....
    catch(SomeException e){
         assertEquals(org.apache.util.Msg.getString("K508C"),e.getMessage
());
    }
}

Does it work?  Because what we want to make sure it that "SomeException" is
really thrown with message K508C. So that's another reason that we should
use Msg.getString  rather than explicit string to fill exception
information.

On 5/13/06, Tim Ellison <t.p.ellison@gmail.com> wrote:
>
> Loenko, Mikhail Y wrote:
> > From: Tim Ellison [mailto:t.p.ellison@gmail.com]
> >> 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?
> >
> > Yes, it does. But we might have impl tests that check for exception
> > messages.
>
> Ok, provided they still pass when I translate the message catalog to
> Klingon ;-)
>
> Regards,
> Tim
>
> --
>
> 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
>
>


-- 
Andrew Zhang
China Software Development Lab, IBM

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