If you are going to add a new feature to OpenJDK or fix a bug, it is really a good idea to have a test case to cover the change in functionality and to ensure that the implementation change doesn't break anything. This recipe will help you to get some understanding of the process and create a simple test. You will find that writing your own test case for jtreg is not a complicated task, but it can be slightly unusual in some respects.
All that is required for this recipe is an installed jtreg and the OpenJDK sources. The latter is required only because this recipe assumes that the newly created test is for OpenJDK.
Writing tests for jtreg can be a little unusual, but when you get used to the pattern it is actually quite easy. To begin, just follow the steps. Keep in mind that all the paths are given relative to the OpenJDK source root:
Go to the root folder of OpenJDK and create the
jdk/test/demo/SampleTest.java
file first:/* @test...