Hi Andrew
The problem with this test is that it will not catch the change
of the message for the given key.
For example if we throw some message from 3 points in the code
and we do some change in the property file that is acceptable for
two points but not acceptable for the 3rd one, we will not
Another (more preferable for me) way could be set a specific locale and
compare to the message for this locale
Thanks,
Mikhail.
2006/5/13, Andrew Zhang [EMAIL PROTECTED]:
Hello,
If we really decide to test exception message, I think we could write test
case as follows:
public void test_f(){
Hello, Mikhail
org.apache.harmony.luni.util.Msg has already handled locale issue.
So it's not neccessary to get locale inforamtion again in test case, and
then get i18n message.
For example, following code is from java.net.HttpURLConnection.java
method setRequestMethod:
if (connected)
Mikhail Loenko wrote:
2006/5/12, Tim Ellison [EMAIL PROTECTED]:
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?
From: Tim Ellison [mailto:[EMAIL PROTECTED]
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 [EMAIL PROTECTED]:
Tests shouldn't assert the actual message String in an exception.
I