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

Paul Sandoz paul.sandoz at oracle.com
Tue May 2 19:15:04 UTC 2017


Looks good. Preserving the messages where possible would be good as raised by Roger and Daniel.


As a follow on it would be nice to avoid the duplication of the assertThrowsNPE etc. I wish by default for TestNG jtreg would include an additional general helper library in scope that we control. (We should not have to update tests to use such a library.)


> On 2 May 2017, at 02:19, Amy Lu <amy.lu at oracle.com> 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