Thor
Thor

Reputation: 10058

tests for java.time API

I'm currently studying java.time API by watching a video by Stephen Colebourne. In the video, the lecturer mentioned that there were close to 25,000 tests written for java.time API to make sure everything works correctly.

My question is, is it possible to locate those test, because I want to learn a bit about how tests for java.time is written.

Edit:

I followed EmptyArsenal's instruction and opened up the "jdk" folder, but there doesn't seem to be a "test" folder inside. Is "test" folder located somewhere else?

enter image description here

Upvotes: 3

Views: 80

Answers (2)

EmptyArsenal
EmptyArsenal

Reputation: 7464

If you want to look at the tests for java.time, you're going to need to take a look at the source code of the OpenJDK project.

If download the OpenJDK source and dig into the JDK test directory (jdk/test/java/time/test/java/time), you'll see the test files.

Upvotes: 2

Mustafa Can Tekir
Mustafa Can Tekir

Reputation: 107

As far as i know, You won't get the testing code for Oracle's Java. But You can use OpenJDK. It follows same behaviour. JDK8 time tests live in here .

Upvotes: 2

Related Questions