harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr <g...@pobox.com>
Subject Re: [classlib] Unit and performance testing
Date Tue, 24 Jan 2006 13:02:29 GMT

Mikhail Loenko wrote:
> On 1/24/06, Tim Ellison <t.p.ellison@gmail.com> wrote:
>> Mikhail Loenko wrote:
>>> Hello
>>> We have figured out that one of approcahes that was earlier dicussed and that
>>> I originally opposed would work for us.
>>> That is: get PerformanceTest class out of there and replace log() with calls
>>> to java.util.logging.Logger.
>>> Please let me know what you think.
>> What are you logging?
> Normally any information that would be useful to easily detect
> the reason of failure. A good test explains why it failed, the best test
> submits a bug report and provides a patch, the worst test
> just complains that it failed.

Right - so in the event of failure, write all the information that you 
need out.

In the event of success, don't.

> I would not wish to debug just to figure out that the reason of failures is
> that I've forgot to include something to classpath or there is another
> config problem

Right - you look at the test output, which has the ClassNotFound 
stacktrace. That's how I remember to put junit and bcprov in my classpath.

>> Nobody is going to search log files looking for success/failure messages.
> Agreed
>> If the test passes, then all is fine; if it does not pass then it should
>> inform the framework (i.e. a failing assertion or an explicit call to
>> fail()).  At that point JUnit will give you a cause of failure, and if
> fail() is not always convinient, for example, how would you print
> stack trace to fail()? Meanwhile stacktrace is most often enough
> to find what the problems are and sort them out.

if (condition isn't met) {

> Thanks,
> Mikhail
>> that is not enough you debug it with a debugger not println's.
>> Regards,
>> Tim
>> --
>> Tim Ellison (t.p.ellison@gmail.com)
>> IBM Java technology centre, UK.

View raw message