|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ThreadGroup
edu.rice.cs.cunit.concJUnit.TestThreadGroup
public class TestThreadGroup
Test thread group.
| Nested Class Summary | |
|---|---|
static class |
TestThreadGroup.AwtHandler
"sun.awt.exception.handler" handler. |
static class |
TestThreadGroup.DummyHandler
"sun.awt.exception.handler" dummy handler. |
static class |
TestThreadGroup.LuckyWarningsDisabledException
Exception indicating that "lucky" warnings can't be used. |
| Constructor Summary | |
|---|---|
TestThreadGroup()
Create a new test thread group. |
|
| Method Summary | |
|---|---|
static Thread[] |
checkThreadsAlive(ThreadGroup tg,
Thread t)
Check if there are still some threads alive, i.e. |
static HashSet<Thread> |
collectThreads(Thread t,
String fieldName)
|
static void |
dumpThreads(String fieldName)
Print thread set with the specified name. |
static void |
extendStackTrace(Throwable t,
Thread thread)
Extend the stack trace in the throwable by the start stack trace of the thread. |
static TestThreadGroup |
getCurrentThreadGroup()
Get the current thread group so the AWT handler can use it. |
Object |
getEvent()
Get the event that gets notified when the test is done. |
static String |
getThreadStartStackTrace(Thread t)
Return the start stack trace for the specified thread. |
Throwable |
getUncaughtException()
Get the uncaught exception, or null if none. |
Thread |
getUncaughtThread()
Get the thread that threw the uncaught exception, or null if none. |
boolean |
hasBeenNotified()
Returns true if the event has already been notified. |
static boolean |
isCheckJoinEnabled()
|
static boolean |
isCheckLuckyEnabled()
|
static boolean |
isCheckThreadsEnabled()
|
void |
notifyEvent()
Signal that the event has occurred. |
static void |
setCurrentThreadGroup(TestThreadGroup tg)
Set the current thread group so the AWT handler can use it. |
void |
setNotified()
Sets the notified flag to true. |
static boolean |
shouldIgnoreThread(Thread at)
Return true if the specified thread should be ignored because it is a system thread or a daemon. |
void |
uncaughtException(Thread t,
Throwable e)
Catch and register an uncaught exception. |
void |
waitForEvent()
Wait for the event to occur, if it hasn't already occurred. |
| Methods inherited from class java.lang.ThreadGroup |
|---|
activeCount, activeGroupCount, allowThreadSuspension, checkAccess, destroy, enumerate, enumerate, enumerate, enumerate, getMaxPriority, getName, getParent, interrupt, isDaemon, isDestroyed, list, parentOf, resume, setDaemon, setMaxPriority, stop, suspend, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TestThreadGroup()
| Method Detail |
|---|
public void uncaughtException(Thread t,
Throwable e)
uncaughtException in interface Thread.UncaughtExceptionHandleruncaughtException in class ThreadGroupt - threade - exceptionpublic Throwable getUncaughtException()
public Thread getUncaughtThread()
public Object getEvent()
public boolean hasBeenNotified()
public void setNotified()
public void waitForEvent()
throws InterruptedException
InterruptedExceptionpublic void notifyEvent()
public static Thread[] checkThreadsAlive(ThreadGroup tg,
Thread t)
tg - thread group the threads are int - main test thread, i.e. the thread that may have spawned others
public static boolean shouldIgnoreThread(Thread at)
at - thread
public static HashSet<Thread> collectThreads(Thread t,
String fieldName)
throws TestThreadGroup.LuckyWarningsDisabledException
TestThreadGroup.LuckyWarningsDisabledExceptionpublic static void dumpThreads(String fieldName)
fieldName - name of the thread set
public static String getThreadStartStackTrace(Thread t)
throws TestThreadGroup.LuckyWarningsDisabledException
t - thread
TestThreadGroup.LuckyWarningsDisabledException
public static void extendStackTrace(Throwable t,
Thread thread)
throws TestThreadGroup.LuckyWarningsDisabledException
t - throwable whose stack trace should be extendedthread - thread whose start stack trace should be appended to the throwable's stack trace
TestThreadGroup.LuckyWarningsDisabledExceptionpublic static void setCurrentThreadGroup(TestThreadGroup tg)
tg - thread grouppublic static TestThreadGroup getCurrentThreadGroup()
public static boolean isCheckThreadsEnabled()
public static boolean isCheckJoinEnabled()
public static boolean isCheckLuckyEnabled()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||