import junit.framework.TestCase; public class TestInOtherThreadSleep extends MultiThreadedTestCase { public void testException() { new Thread(new Runnable() { public void run() { // sleep for 10 seconds try { Thread.sleep(10*1000); } catch(InterruptedException ie) { /* ignore */ } // uncaught, should cause failure but does not throw new RuntimeException(); } }).start(); // test's main thread exits immediately } }