From filipp.zhinkin at oracle.com Fri Mar 1 10:48:48 2013 From: filipp.zhinkin at oracle.com (Filipp Zhinkin) Date: Fri, 01 Mar 2013 22:48:48 +0400 Subject: Get TESTVMOPTS value from java test Message-ID: <5130F810.50706@oracle.com> 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/d04bdcbe/attachment.html From jonathan.gibbons at oracle.com Fri Mar 1 11:37:11 2013 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Fri, 01 Mar 2013 11:37:11 -0800 Subject: Get TESTVMOPTS value from java test In-Reply-To: <5130F810.50706@oracle.com> References: <5130F810.50706@oracle.com> Message-ID: <51310367.3090005@oracle.com> 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 From filipp.zhinkin at oracle.com Mon Mar 4 01:13:56 2013 From: filipp.zhinkin at oracle.com (Filipp Zhinkin) Date: Mon, 04 Mar 2013 13:13:56 +0400 Subject: Get TESTVMOPTS value from java test Message-ID: <513465D4.8080101@oracle.com> Jon, thank you! It works fine with test.vm.opts property. Filipp.