use of org.neo4j.shell.prettyprint.PrettyConfig in project neo4j by neo4j.
the class MainIntegrationTest method getShell.
private ShellAndConnection getShell(CliArgs cliArgs, LinePrinter linePrinter) {
PrettyConfig prettyConfig = new PrettyConfig(cliArgs);
ConnectionConfig connectionConfig = getConnectionConfig(cliArgs);
return new ShellAndConnection(new CypherShell(linePrinter, prettyConfig, true, new ShellParameterMap()), connectionConfig);
}
use of org.neo4j.shell.prettyprint.PrettyConfig in project neo4j by neo4j.
the class MainIntegrationTest method interactiveShell.
private CypherShell interactiveShell(LinePrinter linePrinter) throws Exception {
PrettyConfig prettyConfig = new PrettyConfig(new CliArgs());
CypherShell shell = new CypherShell(linePrinter, prettyConfig, true, new ShellParameterMap());
main.connectMaybeInteractively(shell, connectionConfig, true, true, true);
shell.setCommandHelper(new CommandHelper(mock(Logger.class), Historian.empty, shell));
return shell;
}
use of org.neo4j.shell.prettyprint.PrettyConfig in project neo4j by neo4j.
the class CypherShellMultiDatabaseIntegrationTest method switchingToNonExistingDatabaseShouldGiveErrorResponseFromServerInteractive.
@Test
public void switchingToNonExistingDatabaseShouldGiveErrorResponseFromServerInteractive() throws CommandException {
shell = new CypherShell(linePrinter, new PrettyConfig(Format.PLAIN, true, 1000), true, new ShellParameterMap());
useCommand = new Use(shell);
shell.connect(new ConnectionConfig("bolt", "localhost", 7687, "neo4j", "neo", Encryption.DEFAULT, ABSENT_DB_NAME));
useCommand.execute(SYSTEM_DB_NAME);
try {
useCommand.execute("this_database_name_does_not_exist_in_test_container");
fail("No ClientException thrown");
} catch (ClientException e) {
// In interactive we do not want to switch if the database does not exist
assertOnSystemDB();
}
}
use of org.neo4j.shell.prettyprint.PrettyConfig in project neo4j by neo4j.
the class CypherShellProtocolIntegrationTest method shouldConnectWithBoltSSCProtocol.
@Test
public void shouldConnectWithBoltSSCProtocol() throws Exception {
CypherShell shell = new CypherShell(new StringLinePrinter(), new PrettyConfig(Format.PLAIN, true, 1000), false, new ShellParameterMap());
// Given 3.X series where X > 1, where SSC are the default. Hard to test in 4.0 sadly.
onlyIn3_2to3_6(shell);
shell.connect(new ConnectionConfig("bolt+ssc", "localhost", 7687, "neo4j", "neo", Encryption.DEFAULT, ABSENT_DB_NAME));
assertTrue(shell.isConnected());
}
use of org.neo4j.shell.prettyprint.PrettyConfig in project neo4j by neo4j.
the class CypherShellProtocolIntegrationTest method shouldConnectWithNeo4jSSCProtocol.
@Test
public void shouldConnectWithNeo4jSSCProtocol() throws Exception {
CypherShell shell = new CypherShell(new StringLinePrinter(), new PrettyConfig(Format.PLAIN, true, 1000), false, new ShellParameterMap());
// Given 3.X series where X > 1, where SSC are the default. Hard to test in 4.0 sadly.
onlyIn3_2to3_6(shell);
// This should work by falling back to bolt+ssc
shell.connect(new ConnectionConfig("neo4j+ssc", "localhost", 7687, "neo4j", "neo", Encryption.DEFAULT, ABSENT_DB_NAME));
assertTrue(shell.isConnected());
}
Aggregations