commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject [MATH] Documenting test failures
Date Fri, 04 Sep 2009 17:38:05 GMT
There are quite a lot of assertions that don't give any details if a test fails.

For example, the following currently fails when using Harmony:

	at org.junit.Assert.assertTrue(
	at org.junit.Assert.assertTrue(
	at org.apache.commons.math.ode.nonstiff.AdamsBashforthIntegratorTest.testIncreasingTolerance(

Obviously one can find the code from the line number, but that does
not actually get one much further as there's no indication what the
values are:

            assertTrue(handler.getMaximalValueError() < (36.0 *

Seems to me it might be useful to create some additional assert
methods, for example:

assertLessThan([message,] maximum, actual)

which would report the max and actual values if the check failed.

As far as I can tell, this is not currently supported by JUnit3/4 -
only assertSame/assertEquals report the expected and actual values.


There are also lots of cases of assert() calls without a message;
again this means digging into the test code to find the problem.

I propose to add messages to at least the ones that Harmony triggers. OK?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message