org.apache.accumulo.core.client.mock
Class MockShell
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
- extends Shell
An Accumulo Shell implementation that allows a developer to attach an InputStream and Writer to the Shell for testing purposes.
Fields inherited from class org.apache.accumulo.core.util.shell.Shell |
CHARSET, commandFactory, commandGrouping, configError, execCommand, execFile, exitCode, instance, iteratorProfiles, log, NO_FIXED_ARG_LENGTH_CHECK, reader, scanIteratorOptions, verbose |
Methods inherited from class org.apache.accumulo.core.util.shell.Shell |
checkTableState, execCommand, getConnector, getDefaultPrompt, getExit, getExitCode, getFormatter, getFormatter, getPrincipal, getReader, getTableName, getToken, hasExited, isDebuggingEnabled, isMasking, isVerbose, main, printBinaryRecords, printBinaryRecords, printException, printInfo, printLines, printLines, printRecords, printRecords, printVerboseInfo, readMaskedLine, repeat, resetExitCode, setDebugging, setExit, setLogErrorsToConsole, setTableName, updateUser |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
in
protected InputStream in
writer
protected Writer writer
MockShell
public MockShell(InputStream in,
Writer writer)
throws IOException
- Throws:
IOException
config
public boolean config(String... args)
- Overrides:
config
in class Shell
setInstance
protected void setInstance(org.apache.commons.cli.CommandLine cl)
- Overrides:
setInstance
in class Shell
start
public int start()
throws IOException
- Overrides:
start
in class Shell
- Throws:
IOException
setConsoleInputStream
public void setConsoleInputStream(InputStream in)
- Parameters:
in
- the in to set
setConsoleWriter
public void setConsoleWriter(Writer writer)
- Parameters:
writer
- the writer to set
makeCommands
public static ByteArrayInputStream makeCommands(String... commands)
- Convenience method to create the byte-array to hand to the console
- Parameters:
commands
- An array of commands to run
- Returns:
- A byte[] input stream which can be handed to the console.
Copyright © 2013 Apache Accumulo Project. All Rights Reserved.