Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are the unit tests for "native" Java classes?

For "fun" I'm loosely porting a few Java classes to PHP (e.g. java.util.regex.Matcher), so I'd like to be able to run/port the unit tests for these:

  • java.lang.StringBuilder
  • java.util.regex.Pattern
  • java.util.regex.Matcher

Where can I find them? Tests from any semi-recent version would be helpful.

like image 966
Steve Clay Avatar asked Dec 13 '11 15:12

Steve Clay


1 Answers

The OpenJDK project offers its source online. The test directory for e.g. StringBuilder can be found at http://hg.openjdk.java.net/jdk7u/jdk7u2/jdk/file/58ad18490a50/test/java/lang/StringBuilder/. Replace the version number with the version you are interested in, and adjust the path accordingly to find the tests for all other classes.

like image 169
Bombe Avatar answered Sep 30 '22 02:09

Bombe