Book Image

OpenJDK Cookbook

Book Image

OpenJDK Cookbook

Overview of this book

Table of Contents (20 chapters)
OpenJDK Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Writing TestNG tests for jtreg


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.

Getting ready

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.

How to do it...

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.

  1. 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.

  2. 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...