Search in sources :

Example 6 with Logger

use of org.neo4j.shell.log.Logger in project neo4j by neo4j.

the class MainIntegrationTest method shouldFailIfInputFileDoesntExist.

@Test
public void shouldFailIfInputFileDoesntExist() {
    // given
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    Logger logger = new AnsiLogger(false, Format.VERBOSE, new PrintStream(out), new PrintStream(out));
    // when
    executeFileNonInteractively("what.cypher", logger);
    // then
    assertThat(out.toString(), containsString(format("what.cypher (No such file or directory)%n")));
}
Also used : PrintStream(java.io.PrintStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Logger(org.neo4j.shell.log.Logger) AnsiLogger(org.neo4j.shell.log.AnsiLogger) AnsiLogger(org.neo4j.shell.log.AnsiLogger) Test(org.junit.Test)

Aggregations

Logger (org.neo4j.shell.log.Logger)6 AnsiLogger (org.neo4j.shell.log.AnsiLogger)5 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 PrintStream (java.io.PrintStream)2 Before (org.junit.Before)2 Test (org.junit.Test)2 ClientException (org.neo4j.driver.exceptions.ClientException)2 ShellStatementParser (org.neo4j.shell.parser.ShellStatementParser)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 ConnectionConfig (org.neo4j.shell.ConnectionConfig)1 DatabaseManager (org.neo4j.shell.DatabaseManager)1 OfflineTestShell (org.neo4j.shell.OfflineTestShell)1 ParameterMap (org.neo4j.shell.ParameterMap)1 StatementExecuter (org.neo4j.shell.StatementExecuter)1 TransactionHandler (org.neo4j.shell.TransactionHandler)1 UserMessagesHandler (org.neo4j.shell.UserMessagesHandler)1 CommandHelper (org.neo4j.shell.commands.CommandHelper)1 PrettyConfig (org.neo4j.shell.prettyprint.PrettyConfig)1