Skip to main content
This revision made April 10, 2013 23:50, by neomatrix369

Install JTReg

NOTE $SOURCE_CODE is where you installed the source code to. If you are using the Pre packaged VM then this is /home/openjdk/sources If you are using YourOwnEnvironment then it's likely to be something like /home/<your username>/sources

NOTE: the last letter in jdk8_tl refers to the small letter 'l' and not the digit 1 - and applicable to all references to this term throughout the wiki.

Download and install jtreg

  1. Go to http://openjdk.java.net/jtreg/ and have a scan through the details there
  2. Go to http://download.java.net/openjdk/jtreg/ and download the latest binary zip file
  3. Unzip the contents to $JTREG_INSTALL
    1. If you are using the AdoptOpenJDKVMBuild this should be the /home/openjdk/jtreg directory

Configure jtreg

Debian/Ubuntu

Execute the following:

 vi ~/.bashrc

And append (replacing $JTREG_INSTALL and $SOURCE_CODE as appropriate):

 export JT_HOME=$JTREG_INSTALL
 export PRODUCT_HOME=$SOURCE_CODE/jdk8_tl/build/linux-x64-normal-server-release/images/j2sdk-image 
 export JPRT_JTREG_HOME=${JT_HOME}
 export JPRT_JAVA_HOME=${PRODUCT_HOME}
 export JTREG_TIMEOUT_FACTOR=5
 export CONCURRENCY=auto

Note: the name of the sub-folder under $SOURCE_CODE/jdk8_tl/build/ folder can have other variants i.e. linux-x86_64-normal-server-release, so please check for this in your build environment before applying the above env settings.

Then source the new default environment settings (important)

 source ~/.bashrc ;

Check if the above command has had an effect by echoing one of the above variables, at the CLI.

OLD_BUILD

If you are using the Old_Build then the PRODUCT_HOME will be slightly different

 export PRODUCT_HOME=$SOURCE_CODE/jdk8_tl/build/linux-amd64_backup/j2sdk-image

MS Windows

  • TBA

Mac OS X

Execute the following:

 vi ~/.bashrc

And append (replacing $JTREG_INSTALL and $SOURCE_CODE as appropriate):

 export JT_HOME=$JTREG_INSTALL
 export PRODUCT_HOME=$SOURCE_CODE/jdk8_tl/build/macosx-x64-normal-server-release/images/j2sdk-image

Note: the name of the sub-folder under $SOURCE_CODE/jdk8_tl/build/ folder can have other variants i.e. macosx-x86_64-normal-server-release, so please check for this in your build environment before applying the above env settings.

Then source the new default env settings

 source ~/.bashrc ;

Sanity check jtreg

Execute the following

 cd $SOURCE_CODE ;
 cd jdk8_tl/test ;
 make jdk_util &> test.log ;

This should take some time to execute if it is working correctly. If it executes too quickly you may want to check the output using a command such as:

 less test.log

Running tests via the CLI

In the new build system tests can be run from the $SOURCE_CODE/jdk8_tl/test folder by performing the below actions:

 make TEST=[test], where [test] is one or more components to test

for e.g.,

 
 make TEST="jdk_lang jdk_net"
 

or to run a single test package / sub-package:

 
 make jdk_io 
 

or to run all test packages:

 
 make jdk_all
 

or to run a single unit test, when jtreg is installed (see How to build JTReg in Eclipse (for Ubuntu 12.04 LTS) before running the below):

 [path/to]/jtreg [options] [ -jdk:<java.home> ] [unit test name and location]
 (use the -jdk:<java.home> option, if JAVA_HOME points to JDK version lower than 1.7)

for e.g.

 cd $HOME/sources/jdk8_tl/jdk/test
 $HOME/jtreg/linux/bin/jtreg -verbose:fail java/lang/invoke/AccessControlTest.java


Here are some more components that can be used:

 
 jdk_all 
 jdk_default
 jdk_core
 
 langtools_jtreg
 
 jdk_beans1 
 jdk_io 
 jdk_lang   
 jdk_math   
 jdk_other   
 jdk_net   
 jdk_nio  
 jdk_security1  
 jdk_text   
 jdk_util   
 jdk_time  
 jdk_awt  
 jdk_beans2  
 jdk_beans3   
 jdk_management  
 jdk_jmx  
 jdk_security2 
 jdk_security3   
 jdk_rmi  
 jdk_sound  
 jdk_swing  
 jdk_tools  
 jdk_jdi  
 jdk_jfr  

The below rules might be present in the $SOURCE_CODE/jdk8_tl//test/Makefile file but were only put there for Oracle's internal use and experimental purposes only and hence should not be used:

 jck7devtools 
 jck7compiler 
 jck7runtime

Also additional access is required to work with these, as they do not directly form part of the OpenJDK project.

Install runJtregTests.sh script

To aid in running jtreg you can install the runJtregTests.sh script

 cd $SOURCE_CODE ;
 cd jdk8_tl/test ;
 wget https://raw.github.com/AdoptOpenJDK/BuildHelpers/master/runJtregTests.sh ;
 chmod u+x runJtregTests.sh ;

Install IDE Support

IDE / OSWindows LinuxMac OS X
Eclipse TBA Yes TBA
Netbeans TBA Pending TBA
IntelliJ TBA TBA TBA

How to build JTReg in Eclipse (for Ubuntu 12.04 LTS)

See How to build JTReg in Eclipse (for Ubuntu 12.04 LTS)

Next Step

OR

Difference compared to previous revision
__TOC__ = Install JTReg = '''NOTE''' ''$SOURCE_CODE'' is where you installed the source code to. If you are using the [[Pre packaged VM]] then this is ''/home/openjdk/sources'' If you are using [[YourOwnEnvironment]] then it's likely to be something like ''/home//sources'' '''NOTE: the last letter in jdk8_tl refers to the small letter 'l' and not the digit 1 - and applicable to all references to this term throughout the wiki. == Download and install jtreg == # Go to http://openjdk.java.net/jtreg/ and have a scan through the details there
 
 
Close
loading
Please Confirm
Close