Review request: JDK-7162111 TEST_BUG: change tests run in headless mode [macosx]

Alan Bateman Alan.Bateman at
Thu Nov 15 15:49:19 UTC 2012

On 15/11/2012 15:08, Alexey Utkin wrote:
> :
> Questions:
> 1] That have I do with tests marked as "Easy to fix, but it cuts off 
> test coverage"?
> 2] Should I remove/move the manual tests and tests that essentially 
> depends from AWT or Swing?
> It seems that the switch "-Djava.awt.headless=true" is useless in all 
> CoreLib tests.
> AWT uses the property to force running in headless mode.
> There are two cases:
> - manual or AWT/Swing-action dependent tests. An attempt to run they 
> in headless mode leads to test fail.
> - AWT-class dependent tests. They skip AWT initialization.For these 
> cases the value of the property does not affect the result.
> The only place where the "java.awt.headless" value is essential is the 
> image coding/decoding.
> All mentioned tests (that are marked as "headless - ok") was tested in 
> ssh session from Win to Mac OS without
> additional switches.
> Regards,
> -uta
Just to put some context on Alexey's mail. Alexey is looking at the 
tests in the jdk repository with a view to changing the tests for the 
core area so that they don't have dependencies on AWT/Swing. There are 
several reasons for doing this. If you look at the exclude list 
(jdk/test/ProblemList.txt) then there are 30-40 tests that are excluded 
on Mac because they are problematic for automated testing. We have 
Compact Profiles and eventually modules coming where it will be 
important to run tests on profiles of Java SE or when the desktop module 
is installed. Finally it improves the overall reliability of automated 
tests when they don't require a X11 server or DISPLAY to run.

Alexey - I think -Djava.awt.headless=true is okay to add to some of the 
tests, the jrunscript and javax.script tests in particular. That would 
allow you to remove them from the exclude list.

We don't want any manual tests, all tests should to be automatic.

For the tests that you tagged as "Easy to fix, but it cuts off test 
coverage" then I think it requires looking at the test in further detail 
to understand the original bug. It looks to me that in several cases 
that AWT classes are not required, the test could have been written in 
other ways that don't require these classes.

I think it's okay to do this in steps if you like, no need to address 
all issues at the same time. To that end it would be great if you could 
push the webrev for the changes to the jdk repository to so that we can discuss it.


More information about the core-libs-dev mailing list