jtreg also provides support to run TestNG test cases, which might be a more familiar technique for many developers. There are some steps that need to be performed to make it happen and this recipe will go through them.
This recipe will require the OpenJDK source code and an installed version of jtreg. On a Windows machine, it is also required to have Cygwin installed.
The following procedure should be more familiar to Java developers than writing a native jtreg test, as TestNG is what most developers have heard of and used. Now, let's get to the practical part and create a test. The paths are relative to the OpenJDK source root.
Relative to the OpenJDK root folder, create a folder with the name,
jdk/test/testng/org/demo
. This is the folder where we are going to create our tests.Create the file,
jdk/test/testng/TEST.properties
, relative to the OpenJDK source root. Add the following line there:TestNG.dirs=.
It is not strictly required...