JDK 9 RFR of JDK-8023897: Replace/update/rename executeAndCatch in various tests to assertThrows

Daniel Fuchs daniel.fuchs at oracle.com
Tue May 2 16:53:12 UTC 2017


Hi Amy,

Looks good generally - there are a couple of cases where the
description that was passed to the AssertionError in the original
file is dropped (for instance
http://cr.openjdk.java.net/~amlu/8023897/webrev.00/test/java/util/Map/Defaults.java.frames.html)

Is that going to be an issue when analyzing test logs in case of
failure? IIRC testng prints the parameters passed to the test
method (which includes the description - so maybe that's OK).

Is that why you decided to drop the description?

best regards

-- daniel

On 02/05/2017 10:19, Amy Lu wrote:
> Please review this test-only change.
>
> Some java/util tests use a function executeAndCatch which essentially
> asserts that an exception is thrown, while some other tests use
> assertThrows for doing the same work. For both cases, with jtreg
> upgraded to testng 6.9.5 (CODETOOLS-7901639), test can then leverage
> TestNG Assert.assertThrows
>
> Please review the patch to update executeAndCatch and assertThrows to
> Assert.assertThrows for java/util testng tests.
>
> bug: https://bugs.openjdk.java.net/browse/JDK-8023897
> webrev: http://cr.openjdk.java.net/~amlu/8023897/webrev.00/
>
> Thanks,
> Amy
>



More information about the core-libs-dev mailing list