About System.exit()

Weijun Wang weijun.wang at oracle.com
Tue May 23 06:12:23 UTC 2017


I know jtreg does not like System.exit(), but I do have a class calling 
System.exit() and I'd like to test on it.

Currently, jtreg throws a simple SecurityException. Is it possible to 
throw an AccessControlException with RuntimePermission("exitVM."+status) 
associated, just like what SecurityManager::checkExit does? This way 
I'll be able to test whether my method is calling System.exit() with an 
expected status code.

Thanks
Max


More information about the jtreg-dev mailing list