Where are the unit tests for “native” Java classes

2019-01-15 18:09发布

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.

1条回答
放我归山
2楼-- · 2019-01-15 19:04

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.

查看更多
登录 后发表回答