Package generic.test
Class TestThread
- java.lang.Object
-
- java.lang.Thread
-
- generic.test.TestThread
-
- All Implemented Interfaces:
java.lang.Runnable
public class TestThread extends java.lang.Thread
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME_PREFIX
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StackTraceElement[]
filterTrace(java.lang.StackTraceElement[] trace)
Filters the given stack trace to remove entries known to be present in the test thread that offer little forensic valuestatic boolean
isTestThread()
Returns true if the current thread is the test threadstatic boolean
isTestThread(java.lang.Thread t)
Returns true if the given thread is the test threadstatic boolean
isTestThreadName(java.lang.String name)
Returns true if the given thread name is the test thread namevoid
run()
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
NAME_PREFIX
public static final java.lang.String NAME_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
isTestThread
public static boolean isTestThread()
Returns true if the current thread is the test thread- Returns:
- true if the current thread is the test thread
-
isTestThread
public static boolean isTestThread(java.lang.Thread t)
Returns true if the given thread is the test thread- Parameters:
t
- the thread to check- Returns:
- true if the given thread is the test thread
-
isTestThreadName
public static boolean isTestThreadName(java.lang.String name)
Returns true if the given thread name is the test thread name- Parameters:
name
- the thread name to check- Returns:
- true if the given thread name is the test thread name
-
filterTrace
public static java.lang.StackTraceElement[] filterTrace(java.lang.StackTraceElement[] trace)
Filters the given stack trace to remove entries known to be present in the test thread that offer little forensic value- Parameters:
trace
- the trace to filter- Returns:
- the filtered trace
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
-