Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying OpenJDK Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
OpenJDK Cookbook

OpenJDK Cookbook

By : Kobylyanskiy, Mironchenko
4 (2)
close
close
OpenJDK Cookbook

OpenJDK Cookbook

4 (2)
By: Kobylyanskiy, Mironchenko

Overview of this book

If you are an experienced Java developer using Java 7 platform and want to get your grips on OpenJDK for Java development, this is the book for you. JDK users who wish to migrate to OpenJDK will find this book very useful.
Table of Contents (15 chapters)
close
close
14
Index

Writing your own test for jtreg


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.

Getting ready

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.

How to do it...

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:

  1. Go to the root folder of OpenJDK and create the jdk/test/demo/SampleTest.java file first:

    /* @test...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
OpenJDK Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon