jtreg does not pass the GNOME_DESKTOP_SESSION_ID system variable to the tested JDK

Jonathan Gibbons jonathan.gibbons at oracle.com
Fri Nov 18 06:25:03 PST 2011


Currently, you can only file issues inside Oracle on Bugtraq under 
jct_tools/jct_tools/regtest.  For non-Oracle folk, report issues here 
and I'll make sure issues get filed for them.

As a workaround there is a command line option to pass env variables 
into a test.   See "jtreg -help -e"

     -e:name[=value][,name[=value]...]
                     Specify additional environment variables to be 
passed to
                     each test. If a value is not given for a name, the 
current
                     value of the environment variable will be used. 
Standard
                     environment variables, like DISPLAY, LANG, windir,
                     SystemRoot, etc, will automatically be given to 
each test,
                     if they are set in the current environment.

-- Jon


On 11/18/2011 12:08 AM, Alexander Scherbatiy wrote:
>
>  Where it is possible to file a jtreg issue?
>
>  Thanks,
>   Alexandr.
>
> On 10/21/2011 1:49 PM, Alexander Scherbatiy wrote:
>> Hi,
>>
>> The  UIManager.getSystemLookAndFeelClassName() runnning in the test 
>> method by jtreg returns different L&Fs than  it is run under JDK on 
>> the Solaris when the GNOME_DESKTOP_SESSION_ID is set.
>> It is because the jtreg does not pass the  GNOME_DESKTOP_SESSION_ID 
>> system variable to the tested JDK and so the JDK does not set the 
>> sun.desktop system variable.
>>
>> To check this set the GNOME_DESKTOP_SESSION_ID system variable on the 
>> Solaris and run the following code under java 1.7  and jtreg:
>> --- TestSunDesktopSystemVariable.java ---
>> /*
>>  * @test
>>  * @summary Check that sun.desktop variable is set in JDK if the 
>> GNOME_DESKTOP_SESSION_ID system variable is set on Solaris OS
>>  * @run main TestSunDesktopSystemVariable
>>  */
>>
>> public class TestSunDesktopSystemVariable {
>>
>>     public static void main(String[] args) {
>>         String sunDesktop = System.getProperty("sun.desktop");
>>         System.out.println("desktop = " + sunDesktop);
>>
>>         if(sunDesktop == null){
>>             throw new RuntimeException("The sun.desktop system 
>> variable is not set");
>>         }
>>     }
>> }
>> ---------------------------------------------------
>> The result is
>> > java
>>   desktop = gnome
>> > jtreg
>>   ----------System.out:(1/15)----------
>>    desktop = null
>>    ----------System.err:(13/814)----------
>>    java.lang.RuntimeException: The sun.desktop system variable is not 
>> set
>>
>>
>> To fix this the GNOME_DESKTOP_SESSION_ID system variable should be 
>> added to the DEFAULT_UNIX_ENV_VARS string array in the 
>> com.sun.javatest.regtest.Main class.
>>
>> Thanks,
>> Alexandr.
>>
>>
>



More information about the jtreg-use mailing list