Package com.intuit.karate.shell
Class Command
- java.lang.Object
-
- java.lang.Thread
-
- com.intuit.karate.shell.Command
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger
LOGGER
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close(boolean force)
static String
exec(boolean useLineFeed, File workingDir, String... args)
static String
execLine(File workingDir, String command)
LogAppender
getAppender()
List
getArgList()
Map<String,String>
getEnvironment()
int
getExitCode()
Exception
getFailureReason()
static int
getFreePort(int preferred)
Logger
getLogger()
String
getSysErr()
String
getSysOut()
String
getUniqueName()
File
getWorkingDir()
boolean
isFailed()
static String[]
prefixShellArgs(String[] args)
void
run()
void
setEnvironment(Map<String,String> environment)
void
setErrorListener(java.util.function.Consumer<String> errorListener)
void
setListener(java.util.function.Consumer<String> listener)
void
setPollAttempts(int pollAttempts)
void
setPollInterval(int pollInterval)
void
setRedirectErrorStream(boolean redirectErrorStream)
static String[]
tokenize(String command)
static boolean
waitForHttp(String url)
static boolean
waitForHttp(String url, java.util.function.Predicate<Response> condition)
boolean
waitForPort(String host, int port)
static boolean
waitForSocket(int port)
int
waitSync()
-
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
-
-
-
-
Method Detail
-
setPollAttempts
public void setPollAttempts(int pollAttempts)
-
setPollInterval
public void setPollInterval(int pollInterval)
-
isFailed
public boolean isFailed()
-
getFailureReason
public Exception getFailureReason()
-
setListener
public void setListener(java.util.function.Consumer<String> listener)
-
setErrorListener
public void setErrorListener(java.util.function.Consumer<String> errorListener)
-
setRedirectErrorStream
public void setRedirectErrorStream(boolean redirectErrorStream)
-
getSysOut
public String getSysOut()
-
getSysErr
public String getSysErr()
-
getFreePort
public static int getFreePort(int preferred)
-
waitForPort
public boolean waitForPort(String host, int port)
-
waitForHttp
public static boolean waitForHttp(String url)
-
waitForHttp
public static boolean waitForHttp(String url, java.util.function.Predicate<Response> condition)
-
waitForSocket
public static boolean waitForSocket(int port)
-
getWorkingDir
public File getWorkingDir()
-
getArgList
public List getArgList()
-
getLogger
public Logger getLogger()
-
getAppender
public LogAppender getAppender()
-
getUniqueName
public String getUniqueName()
-
getExitCode
public int getExitCode()
-
waitSync
public int waitSync()
-
close
public void close(boolean force)
-
-