8288989: Make tests not depend on the source code

Backport-of: 2838a916ab
This commit is contained in:
Goetz Lindenmaier
2024-03-19 13:58:25 +00:00
committed by Vitaly Provodin
parent a0c2ae8ba0
commit 7dbd81e2d0
2 changed files with 11 additions and 3 deletions

View File

@@ -50,8 +50,12 @@ import javax.tools.JavaFileObject;
public class TestDocletExample extends TestRunner {
public static void main(String... args) throws Exception {
var t = new TestDocletExample();
t.runTests(m -> new Object[] { Path.of(m.getName()) });
try {
var t = new TestDocletExample();
t.runTests(m -> new Object[] { Path.of(m.getName()) });
} catch (SnippetUtils.ConfigurationException e) {
System.err.println("NOTE: " + e.getMessage() + "; test skipped");
}
}
SnippetUtils snippets;

View File

@@ -58,7 +58,11 @@ import toolbox.ToolBox;
*/
public class TestJavaxToolsSnippets extends TestRunner {
public static void main(String... args) throws Exception {
new TestJavaxToolsSnippets().runTests(m -> new Object[] { Path.of(m.getName()) });
try {
new TestJavaxToolsSnippets().runTests(m -> new Object[] { Path.of(m.getName()) });
} catch (SnippetUtils.ConfigurationException e) {
System.err.println("NOTE: " + e.getMessage() + "; test skipped");
}
}
SnippetUtils snippets = new SnippetUtils("java.compiler");