Package generic.test
Class TestThread
java.lang.Object
java.lang.Thread
generic.test.TestThread
- All Implemented Interfaces:
Runnable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Method Summary
Modifier and TypeMethodDescriptionstatic StackTraceElement[]
filterTrace
(StackTraceElement[] trace) Filters the given stack trace to remove entries known to be present in the test thread that offer little forensic valuestatic boolean
Returns true if the current thread is the test threadstatic boolean
Returns true if the given thread is the test threadstatic boolean
isTestThreadName
(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, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
NAME_PREFIX
- See Also:
-
-
Method Details
-
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
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
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
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()
-