|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.accumulo.core.util.shell.ShellOptions org.apache.accumulo.core.util.shell.Shell org.apache.accumulo.core.client.mock.MockShell
public class MockShell
An Accumulo Shell implementation that allows a developer to attach an InputStream and Writer to the Shell for testing purposes.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.accumulo.core.util.shell.Shell |
---|
Shell.Command, Shell.PrintFile, Shell.PrintLine, Shell.PrintShell |
Field Summary | |
---|---|
protected InputStream |
in
|
protected OutputStream |
out
|
protected Writer |
writer
Deprecated. since 1.6.0; use out |
Fields inherited from class org.apache.accumulo.core.util.shell.Shell |
---|
CHARSET, commandFactory, commandGrouping, COMMENT_PREFIX, execCommand, execFile, exitCode, HISTORY_DIR_NAME, HISTORY_FILE_NAME, instance, iteratorProfiles, log, NO_FIXED_ARG_LENGTH_CHECK, reader, scanIteratorOptions, verbose |
Fields inherited from class org.apache.accumulo.core.util.shell.ShellOptions |
---|
helpLongOption, helpOption, namespaceOption, tableOption, userOption |
Constructor Summary | |
---|---|
MockShell(InputStream in,
OutputStream out)
|
|
MockShell(InputStream in,
Writer out)
Deprecated. since 1.6.0; use OutputStream version |
Method Summary | |
---|---|
boolean |
config(String... args)
Configures the shell using the provided options. |
static ByteArrayInputStream |
makeCommands(String... commands)
Convenience method to create the byte-array to hand to the console |
void |
setConsoleInputStream(InputStream in)
|
void |
setConsoleWriter(OutputStream out)
|
void |
setConsoleWriter(Writer out)
Deprecated. since 1.6.0; use the OutputStream version |
protected void |
setInstance(org.apache.commons.cli.CommandLine cl)
Deprecated. since 1.6.0; use ShellOptionsJC version |
protected void |
setInstance(ShellOptionsJC options)
Sets the instance used by the shell based on the given options. |
int |
start()
|
Methods inherited from class org.apache.accumulo.core.util.shell.Shell |
---|
checkTableState, execCommand, getClassLoader, getConnector, getDefaultPrompt, getExit, getExitCode, getFormatter, getFormatter, getInstance, getPrincipal, getReader, getTableName, getToken, hasExited, isDebuggingEnabled, isMasking, isTabCompletion, isVerbose, main, printBinaryRecords, printBinaryRecords, printException, printInfo, printLines, printLines, printRecords, printRecords, printVerboseInfo, readMaskedLine, repeat, resetExitCode, setDebugging, setExit, setLogErrorsToConsole, setTableName, shutdown, updateUser |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected InputStream in
protected OutputStream out
@Deprecated protected Writer writer
Constructor Detail |
---|
public MockShell(InputStream in, OutputStream out) throws IOException
IOException
@Deprecated public MockShell(InputStream in, Writer out) throws IOException
IOException
Method Detail |
---|
public boolean config(String... args)
Shell
config
in class Shell
protected void setInstance(ShellOptionsJC options)
Shell
setInstance
in class Shell
options
- shell options@Deprecated protected void setInstance(org.apache.commons.cli.CommandLine cl)
public int start() throws IOException
start
in class Shell
IOException
public void setConsoleInputStream(InputStream in)
in
- the in to setpublic void setConsoleWriter(OutputStream out)
out
- the output stream to set@Deprecated public void setConsoleWriter(Writer out)
public static ByteArrayInputStream makeCommands(String... commands)
commands
- An array of commands to run
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |