@Test public void printsDriverVersionAndExits() { CliArgs args = new CliArgs(); args.setDriverVersion(true); PrintStream printStream = mock(PrintStream.class); Main main = new Main(System.in, printStream); main.startShell(args); ArgumentCaptor<String> argument = ArgumentCaptor.forClass(String.class); verify(printStream).println(argument.capture()); assertTrue(argument.getValue().matches("Neo4j Driver \\d+\\.\\d+\\.\\d+.*")); }
void startShell(@Nonnull CliArgs cliArgs) { if (cliArgs.getVersion()) { out.println("Cypher-Shell " + Build.version()); } if (cliArgs.getDriverVersion()) { out.println("Neo4j Driver " + Build.driverVersion()); } if (cliArgs.getVersion() || cliArgs.getDriverVersion()) { return; } Logger logger = new AnsiLogger( cliArgs.getDebugMode() ); PrettyConfig prettyConfig = new PrettyConfig( cliArgs ); CypherShell shell = new CypherShell( logger, prettyConfig, ShellRunner.shouldBeInteractive( cliArgs ), cliArgs.getParameters() ); int exitCode = runShell( cliArgs, shell, logger ); System.exit( exitCode ); }
Main { void startShell(@Nonnull CliArgs cliArgs) { if (cliArgs.getVersion()) { out.println("Cypher-Shell " + Build.version()); } if (cliArgs.getDriverVersion()) { out.println("Neo4j Driver " + Build.driverVersion()); } if (cliArgs.getVersion() || cliArgs.getDriverVersion()) { return; } Logger logger = new AnsiLogger( cliArgs.getDebugMode() ); PrettyConfig prettyConfig = new PrettyConfig( cliArgs ); CypherShell shell = new CypherShell( logger, prettyConfig, ShellRunner.shouldBeInteractive( cliArgs ), cliArgs.getParameters() ); int exitCode = runShell( cliArgs, shell, logger ); System.exit( exitCode ); } }
Main { void startShell(@Nonnull CliArgs cliArgs) { if (cliArgs.getVersion()) { out.println("Cypher-Shell " + Build.version()); } if (cliArgs.getDriverVersion()) { out.println("Neo4j Driver " + Build.driverVersion()); } if (cliArgs.getVersion() || cliArgs.getDriverVersion()) { return; } Logger logger = new AnsiLogger( cliArgs.getDebugMode() ); PrettyConfig prettyConfig = new PrettyConfig( cliArgs ); CypherShell shell = new CypherShell( logger, prettyConfig, ShellRunner.shouldBeInteractive( cliArgs ), cliArgs.getParameters() ); int exitCode = runShell( cliArgs, shell, logger ); System.exit( exitCode ); } Main();   Main(final InputStream in, final PrintStream out); private  Main(final InputStream in, final PrintStream out, final boolean hasSpecialInteractiveOutputStream ); }
Main { void startShell(@Nonnull CliArgs cliArgs) { if (cliArgs.getVersion()) { out.println("Cypher-Shell " + Build.version()); } if (cliArgs.getDriverVersion()) { out.println("Neo4j Driver " + Build.driverVersion()); } if (cliArgs.getVersion() || cliArgs.getDriverVersion()) { return; } Logger logger = new AnsiLogger( cliArgs.getDebugMode() ); PrettyConfig prettyConfig = new PrettyConfig( cliArgs ); CypherShell shell = new CypherShell( logger, prettyConfig, ShellRunner.shouldBeInteractive( cliArgs ), cliArgs.getParameters() ); int exitCode = runShell( cliArgs, shell, logger ); System.exit( exitCode ); } Main();   Main(final InputStream in, final PrintStream out); private  Main(final InputStream in, final PrintStream out, final boolean hasSpecialInteractiveOutputStream ); static void main(String[] args); }
Main { void startShell(@Nonnull CliArgs cliArgs) { if (cliArgs.getVersion()) { out.println("Cypher-Shell " + Build.version()); } if (cliArgs.getDriverVersion()) { out.println("Neo4j Driver " + Build.driverVersion()); } if (cliArgs.getVersion() || cliArgs.getDriverVersion()) { return; } Logger logger = new AnsiLogger( cliArgs.getDebugMode() ); PrettyConfig prettyConfig = new PrettyConfig( cliArgs ); CypherShell shell = new CypherShell( logger, prettyConfig, ShellRunner.shouldBeInteractive( cliArgs ), cliArgs.getParameters() ); int exitCode = runShell( cliArgs, shell, logger ); System.exit( exitCode ); } Main();   Main(final InputStream in, final PrintStream out); private  Main(final InputStream in, final PrintStream out, final boolean hasSpecialInteractiveOutputStream ); static void main(String[] args); static final int EXIT_FAILURE; static final int EXIT_SUCCESS; }