RFR: 8214799: Add package declaration to each JTREG test case in the gc folder

Leo Korinth leo.korinth at oracle.com
Wed Dec 5 13:44:28 UTC 2018


Hi,

I have added package declarations to all jtreg tests in the gc folder 
(and sub folders). Previously most tests were not in a package (though 
some where), making it extremely hard to work with jtreg tests in an IDE.

The main change consists of adding a package declaration that 
corresponds to the directory the test is located in. This also makes it 
necessary to change @run annotations. Some test cases uses "common" code 
that is not located in the test lib. Those test cases now need to have a 
@library annotation that references the jtreg test root.

A few test cases had package visible classes with the same name in the 
same directory. That did work before, but does not work anymore, so I 
have prefixed those package visible classes with the public class name.

class TestVerifySilentlyRunSystemGC
class TestVerifySubSetRunSystemGC
class TestEagerReclaimHumongousRegionsReclaimRegionFast
class TestEagerReclaimHumongousRegionsClearMarkBitsReclaimRegionFast
class TestEagerReclaimHumongousRegionsWithRefsReclaimRegionFast

Where classes have been referenced using string literals, I have tried 
to use a .class.getName() instead (where possible).

I have tried to update copyrights to all files (also adding a missing 
comma after the second year in some files), and I did add missing 
copyright to TestFromCardCacheIndex.

known cons:
- needs a package line in each java file
- needs an extra library line in the test if the test is using other files.
- sometimes needs a run tag

improvements:
+ can use eclipse or other IDEs without creating a workspace per test (I 
guess it will be a significant improvement for users of emacs and vi as 
well)
+ can use test files located in other directories

After this change, I have several big cleanups that are easy to do with 
a working IDE.

Enhancement:
https://bugs.openjdk.java.net/browse/JDK-8214799

Webrev:
http://cr.openjdk.java.net/~lkorinth/8214799/00/

Testing:

passed:
mach5 remote-build-and-test --build-profiles 
linux-x64,linux-x64-debug,macosx-x64,solaris-sparcv9,windows-x64 --test 
open/test/hotspot/jtreg/:hotspot_gc

now running:
mach5 remote-test --build-id 2018-12-05-1132377.leo.korinth.hs 
--build-profiles linux-x64-debug -j tier1,tier2,tier3

Thanks,
Leo



More information about the hotspot-gc-dev mailing list