test/testlibrary/com/oracle/java/testlibrary/JDKToolFinder.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8012447 Cdiff test/testlibrary/com/oracle/java/testlibrary/JDKToolFinder.java

test/testlibrary/com/oracle/java/testlibrary/JDKToolFinder.java

Print this page
rev 5017 : 8012447: Java CTW implementation
Reviewed-by:

*** 29,50 **** private JDKToolFinder() { } /** ! * Returns the full path to an executable in jdk/bin based on System property ! * test.jdk (set by jtreg test suite) * * @return Full path to an executable in jdk/bin */ public static String getJDKTool(String tool) { ! String binPath = System.getProperty("test.jdk"); if (binPath == null) { ! throw new RuntimeException("System property 'test.jdk' not set. This property is normally set by jtreg. " ! + "When running test separately, set this property using '-Dtest.jdk=/path/to/jdk'."); } binPath += File.separatorChar + "bin" + File.separatorChar + tool; return binPath; } } --- 29,69 ---- private JDKToolFinder() { } /** ! * Returns the full path to an executable in jdk/bin based on System ! * property {@code compile.jdk} (set by jtreg test suite) * * @return Full path to an executable in jdk/bin */ public static String getJDKTool(String tool) { ! String binPath = System.getProperty("compile.jdk"); if (binPath == null) { ! throw new RuntimeException("System property 'compile.jdk' not set. " ! + "This property is normally set by jtreg. " ! + "When running test separately, set this property using " ! + "'-Dcompile.jdk=/path/to/jdk'."); } + binPath += File.separatorChar + "bin" + File.separatorChar + tool; + return binPath; + } + /** + * Returns the full path to an executable in <current jdk>/bin based + * on System property {@code test.jdk} (set by jtreg test suite) + * + * @return Full path to an executable in jdk/bin + */ + public static String getCurrentJDKTool(String tool) { + String binPath = System.getProperty("test.jdk"); + if (binPath == null) { + throw new RuntimeException("System property 'test.jdk' not set. " + + "This property is normally set by jtreg. " + + "When running test separately, set this property using " + + "'-Dtest.jdk=/path/to/jdk'."); + } binPath += File.separatorChar + "bin" + File.separatorChar + tool; return binPath; } }
test/testlibrary/com/oracle/java/testlibrary/JDKToolFinder.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File