-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Terminate the thread when unhandled exception happens. (#476)
- Loading branch information
Showing
2 changed files
with
20 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/tests/gov/nasa/jpf/test/java/concurrent/ThreadExceptionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package gov.nasa.jpf.test.java.concurrent; | ||
|
||
import gov.nasa.jpf.util.test.TestJPF; | ||
import org.junit.Test; | ||
|
||
public class ThreadExceptionTest extends TestJPF { | ||
@Test | ||
public void testResourceAcquisition() { | ||
if (verifyUnhandledException("java.lang.RuntimeException", | ||
"+search.class=gov.nasa.jpf.search.RandomSearch", | ||
"+cg.randomize_choices=FIXED_SEED", "+search.RandomSearch.path_limit=10", "+search.multiple_errors=true")) { | ||
Thread t = new Thread(() -> { | ||
throw new RuntimeException("Exception from thread"); | ||
}); | ||
t.start(); | ||
} | ||
} | ||
} |