RFR: 8374051: Incorrect parameterized testing of exceptions in AbstractDateTimeTest.java

Naoto Sato naoto at openjdk.org
Tue Jan 6 23:22:29 UTC 2026


On Tue, 6 Jan 2026 21:29:31 GMT, Justin Lu <jlu at openjdk.org> wrote:

> Discovered in https://github.com/openjdk/jdk/pull/28911, two test methods in the base test class _AbstractDateTimeTest.java_ were not testing all the `TemporalAccessor`s from `samples()` correctly. This PR updates the test methods to become parametrized so that their assertions do not exit early.

By taking the opportunity, I think it is better to make valid tests that for-loop `samples()` values parameterized too.

test/jdk/java/time/tck/java/time/AbstractDateTimeTest.java line 73:

> 71: import org.junit.jupiter.api.Assertions;
> 72: import org.junit.jupiter.api.Test;
> 73: 

cosmetic: the blank line may better fit after junit imports

-------------

PR Review: https://git.openjdk.org/jdk/pull/29071#pullrequestreview-3632823367
PR Review Comment: https://git.openjdk.org/jdk/pull/29071#discussion_r2666574371


More information about the core-libs-dev mailing list