8288989: Make tests not depend on the source code

Reviewed-by: mcimadamore
This commit is contained in:
Adam Sotona 2023-12-14 11:36:57 +00:00
parent d2ba3b1ef7
commit 2838a916ab
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 class TestDocletExample extends TestRunner {
public static void main(String... args) throws Exception { public static void main(String... args) throws Exception {
try {
var t = new TestDocletExample(); var t = new TestDocletExample();
t.runTests(m -> new Object[] { Path.of(m.getName()) }); t.runTests(m -> new Object[] { Path.of(m.getName()) });
} catch (SnippetUtils.ConfigurationException e) {
System.err.println("NOTE: " + e.getMessage() + "; test skipped");
}
} }
SnippetUtils snippets; SnippetUtils snippets;

View File

@ -58,7 +58,11 @@ import toolbox.ToolBox;
*/ */
public class TestJavaxToolsSnippets extends TestRunner { public class TestJavaxToolsSnippets extends TestRunner {
public static void main(String... args) throws Exception { public static void main(String... args) throws Exception {
try {
new TestJavaxToolsSnippets().runTests(m -> new Object[] { Path.of(m.getName()) }); 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"); SnippetUtils snippets = new SnippetUtils("java.compiler");