import junit.framework.TestCase; public class TestInOtherThreadSleepJoin extends MultiThreadedTestCase { public void testException() { final Thread t = new Thread(new Runnable() { public void run() { // sleep for 10 seconds try { Thread.sleep(1000); } catch(InterruptedException ioe) { /* ignore */ } // uncaught, causes test to fail throw new RuntimeException(); } }); t.start(); // main thread waits for spawned thread to finish try { t.join(); } catch(InterruptedException ie) { /* ignore */ } } }