Package org.opennms.smoketest.utils
Class StreamGobbler
- java.lang.Object
-
- java.lang.Thread
-
- org.opennms.smoketest.utils.StreamGobbler
-
- All Implemented Interfaces:
Runnable
public class StreamGobbler extends Thread
Starts a thread that reads lines from an input stream, logs them, and stores them in an array list. The list of stored lines is used to search for expected output.Used for consuming
stdout
andstderr
of processes. Processes get blocked when their output buffers are full. Consuming their output prevents them from getting blocked.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description StreamGobbler(InputStream stream, String kind)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
getLines()
void
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
-
-