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.LoggerLOGGER-
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 voidclose(boolean force)static Stringexec(boolean useLineFeed, File workingDir, String... args)static StringexecLine(File workingDir, String command)LogAppendergetAppender()ListgetArgList()Map<String,String>getEnvironment()intgetExitCode()ExceptiongetFailureReason()static intgetFreePort(int preferred)LoggergetLogger()StringgetSysErr()StringgetSysOut()StringgetUniqueName()FilegetWorkingDir()booleanisFailed()static String[]prefixShellArgs(String[] args)voidrun()voidsetEnvironment(Map<String,String> environment)voidsetErrorListener(java.util.function.Consumer<String> errorListener)voidsetListener(java.util.function.Consumer<String> listener)voidsetPollAttempts(int pollAttempts)voidsetPollInterval(int pollInterval)voidsetRedirectErrorStream(boolean redirectErrorStream)static String[]tokenize(String command)static booleanwaitForHttp(String url)static booleanwaitForHttp(String url, java.util.function.Predicate<Response> condition)booleanwaitForPort(String host, int port)static booleanwaitForSocket(int port)intwaitSync()-
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)
-
-