Pass environment variables to a Java test

Brent Christian brent.christian at oracle.com
Fri Apr 26 23:57:27 PDT 2013


Hmm, indeed.  I misread your message.

I don't know of anything in jtreg itself.  There are utility classes 
around to help get a ProcessBuilder setup.  I've had good luck with:

   test/tools/launcher/TestHelper.java

-Brent

On 4/26/13 11:44 PM, Weijun Wang wrote:
> This is a system property.
>
> On 4/27/13 2:43 PM, Brent Christian wrote:
>> You can just set it on the @run line, yes?  I'm pretty sure something
>> like this has worked for me:
>>
>> @run main/othervm -Dyour.property.name=value NameOfTestClass
>>
>> -Brent
>>
>> On 4/26/13 6:31 PM, Weijun Wang wrote:
>>> I might have asked this before but cannot find any mail on it.
>>>
>>> It seems there is no way to pass environment variables to a Java test,
>>> and the only way to do that is to write a script or use a
>>> ProcessBuilder. Is that correct?
>>>
>>> Thanks
>>> Max


More information about the jtreg-use mailing list