use of org.neo4j.shell.prettyprint.PrettyPrinter in project neo4j by neo4j.
the class InteractiveShellRunnerTest method setupInteractiveTestShellRunner.
private TestInteractiveShellRunner setupInteractiveTestShellRunner(String input) throws Exception {
// NOTE: Tests using this will test a bit more of the stack using OfflineTestShell
ByteArrayOutputStream output = new ByteArrayOutputStream();
ByteArrayOutputStream error = new ByteArrayOutputStream();
BoltStateHandler mockedBoltStateHandler = mock(BoltStateHandler.class);
when(mockedBoltStateHandler.getProtocolVersion()).thenReturn("");
final PrettyPrinter mockedPrettyPrinter = mock(PrettyPrinter.class);
Logger logger = new AnsiLogger(false, Format.VERBOSE, new PrintStream(output), new PrintStream(error));
OfflineTestShell offlineTestShell = new OfflineTestShell(logger, mockedBoltStateHandler, mockedPrettyPrinter);
CommandHelper commandHelper = new CommandHelper(logger, Historian.empty, offlineTestShell);
offlineTestShell.setCommandHelper(commandHelper);
InputStream inputStream = new ByteArrayInputStream(input.getBytes());
InteractiveShellRunner runner = new InteractiveShellRunner(offlineTestShell, offlineTestShell, offlineTestShell, logger, new ShellStatementParser(), inputStream, historyFile, userMessagesHandler, connectionConfig);
return new TestInteractiveShellRunner(runner, output, error, mockedBoltStateHandler);
}
Aggregations