|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.MultiThreadedTestCase.ExceptionHandler
private static class MultiThreadedTestCase.ExceptionHandler
Class that stores exceptions thrown in other threads so they can be rethrown in the main thread. AssertionFailedErrors thrown in other threads do not count as AssertionFailedErrors in the main class, i.e. if an assertion fails in a thread that is not the main thread, the unit test will not fail!
| Field Summary | |
|---|---|
private Throwable |
_e
Stored throwable, or null if nothing stored. |
private Thread |
_mainThread
Thread that spawns the other threads. |
private Thread |
_t
Stored thread that threw or null if none. |
static MultiThreadedTestCase.ExceptionHandler |
ONLY
Singleton instance. |
| Constructor Summary | |
|---|---|
private |
MultiThreadedTestCase.ExceptionHandler()
Singleton constructor. |
| Method Summary | |
|---|---|
boolean |
exceptionOccurred()
Returns true if an exception has occurred. |
Throwable |
getException()
|
Thread |
getThread()
|
void |
reset()
Reset the stored exception and thread. |
void |
rethrow()
Rethrow the exception, if one was stored. |
void |
setMainThread(Thread mainThread)
Set the thread that spawns the other threads. |
void |
uncaughtException(Thread t,
Throwable e)
Gets called if an uncaught exception occurs in a thread. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private volatile Throwable _e
private volatile Thread _t
private volatile Thread _mainThread
public static final MultiThreadedTestCase.ExceptionHandler ONLY
| Constructor Detail |
|---|
private MultiThreadedTestCase.ExceptionHandler()
| Method Detail |
|---|
public void uncaughtException(Thread t,
Throwable e)
uncaughtException in interface Thread.UncaughtExceptionHandlert - the threade - the uncaught exceptionpublic void reset()
public void rethrow()
public boolean exceptionOccurred()
public Throwable getException()
public Thread getThread()
public void setMainThread(Thread mainThread)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||