Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

24 changes: 24 additions & 0 deletions test/langtools/tools/javac/launcher/SourceLauncherTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
/*
* @test
* @bug 8192920 8204588 8246774 8248843 8268869 8235876 8328339 8335896 8344706
* 8362237
* @summary Test source launcher
* @library /tools/lib
* @modules jdk.compiler/com.sun.tools.javac.api
Expand Down Expand Up @@ -714,6 +715,29 @@ public void testTargetException1(Path base) throws IOException {
"at Thrower.main(Thrower.java:4)");
}

/*
* Tests in which main throws a traceless exception.
*/
@Test
public void testTracelessTargetException(Path base) throws IOException {
tb.writeJavaFiles(base, """
class TestLauncherException extends RuntimeException {
TestLauncherException() {
super("No trace", null, true, false); // No writable trace
}

public static void main(String... args) {
throw new TestLauncherException();
}
}
""");
Path file = base.resolve("TestLauncherException.java");
SourceLauncherTest.Result r = run(file, List.of(), List.of("3"));
checkEmpty("stdout", r.stdOut());
checkEmpty("stderr", r.stdErr());
checkTrace("exception", r.exception(), "TestLauncherException: No trace");
}

@Test
public void testNoDuplicateIncubatorWarning(Path base) throws Exception {
Path module = base.resolve("lib");
Expand Down