Get TESTVMOPTS value from java test

Jonathan Gibbons jonathan.gibbons at oracle.com
Fri Mar 1 11:37:11 PST 2013


Look for system properties beginning "test."

-- Jon


On 03/01/2013 10:48 AM, Filipp Zhinkin wrote:
> Hi all,
>
> It is possible to get TESTVMOPTS value in shell-test, but are there 
> any ways to get value of that variable in java-test?
> I've tried to get it simply by System.getenv("TESTVMOPTS"), but it 
> doesn't work:
>
>     /*
>      * @test
>      * @run main/othervm Test
>      */
>      public class Test {
>        public static void main(String... args) {
>          String vmOpts = System.getenv("TESTVMOPTS");
>          if (vmOpts == null) {
>            throw new RuntimeException("Can't get TESTVMOPTS");
>          } else {
>            System.out.println("TESTVMOPTS are: " + vmOpts);
>          }
>        }
>      }
>
>
> Thanks,
> Filipp. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/jtreg-use/attachments/20130301/8485dcfc/attachment.html 


More information about the jtreg-use mailing list