Search in sources :

Example 6 with PrettyConfig

use of org.neo4j.shell.prettyprint.PrettyConfig in project neo4j by neo4j.

the class CypherShellTransactionIntegrationTest method setUp.

@Before
public void setUp() throws Exception {
    linePrinter.clear();
    shell = new CypherShell(linePrinter, new PrettyConfig(Format.VERBOSE, true, 1000), false, new ShellParameterMap());
    rollbackCommand = new Rollback(shell);
    commitCommand = new Commit(shell);
    beginCommand = new Begin(shell);
    connect("neo");
    shell.execute("MATCH (n) DETACH DELETE (n)");
}
Also used : ShellParameterMap(org.neo4j.shell.ShellParameterMap) CypherShell(org.neo4j.shell.CypherShell) PrettyConfig(org.neo4j.shell.prettyprint.PrettyConfig) Before(org.junit.Before)

Example 7 with PrettyConfig

use of org.neo4j.shell.prettyprint.PrettyConfig in project neo4j by neo4j.

the class Main method startShell.

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);
}
Also used : Logger(org.neo4j.shell.log.Logger) AnsiLogger(org.neo4j.shell.log.AnsiLogger) AnsiLogger(org.neo4j.shell.log.AnsiLogger) PrettyConfig(org.neo4j.shell.prettyprint.PrettyConfig)

Example 8 with PrettyConfig

use of org.neo4j.shell.prettyprint.PrettyConfig in project neo4j by neo4j.

the class CypherShellFailureIntegrationTest method setUp.

@Before
public void setUp() {
    linePrinter.clear();
    shell = new CypherShell(linePrinter, new PrettyConfig(Format.VERBOSE, true, 1000), false, new ShellParameterMap());
}
Also used : ShellParameterMap(org.neo4j.shell.ShellParameterMap) CypherShell(org.neo4j.shell.CypherShell) PrettyConfig(org.neo4j.shell.prettyprint.PrettyConfig) Before(org.junit.Before)

Example 9 with PrettyConfig

use of org.neo4j.shell.prettyprint.PrettyConfig in project neo4j by neo4j.

the class CypherShellMultiDatabaseIntegrationTest method setUp.

@Before
public void setUp() throws Exception {
    linePrinter.clear();
    shell = new CypherShell(linePrinter, new PrettyConfig(Format.PLAIN, true, 1000), false, new ShellParameterMap());
    useCommand = new Use(shell);
    beginCommand = new Begin(shell);
    rollbackCommand = new Rollback(shell);
    shell.connect(new ConnectionConfig("bolt", "localhost", 7687, "neo4j", "neo", Encryption.DEFAULT, ABSENT_DB_NAME));
    // Multiple databases are only available from 4.0
    assumeTrue(majorVersion(shell.getServerVersion()) >= 4);
}
Also used : ShellParameterMap(org.neo4j.shell.ShellParameterMap) CypherShell(org.neo4j.shell.CypherShell) PrettyConfig(org.neo4j.shell.prettyprint.PrettyConfig) ConnectionConfig(org.neo4j.shell.ConnectionConfig) Before(org.junit.Before)

Example 10 with PrettyConfig

use of org.neo4j.shell.prettyprint.PrettyConfig in project neo4j by neo4j.

the class CypherShellProtocolIntegrationTest method shouldConnectWithBoltProtocol.

@Test
public void shouldConnectWithBoltProtocol() throws Exception {
    CypherShell shell = new CypherShell(new StringLinePrinter(), new PrettyConfig(Format.PLAIN, true, 1000), false, new ShellParameterMap());
    shell.connect(new ConnectionConfig("bolt", "localhost", 7687, "neo4j", "neo", Encryption.DEFAULT, ABSENT_DB_NAME));
    assertTrue(shell.isConnected());
}
Also used : ShellParameterMap(org.neo4j.shell.ShellParameterMap) CypherShell(org.neo4j.shell.CypherShell) StringLinePrinter(org.neo4j.shell.StringLinePrinter) PrettyConfig(org.neo4j.shell.prettyprint.PrettyConfig) ConnectionConfig(org.neo4j.shell.ConnectionConfig) Test(org.junit.Test)

Aggregations

PrettyConfig (org.neo4j.shell.prettyprint.PrettyConfig)14 CypherShell (org.neo4j.shell.CypherShell)11 ShellParameterMap (org.neo4j.shell.ShellParameterMap)11 Test (org.junit.Test)6 ConnectionConfig (org.neo4j.shell.ConnectionConfig)6 Before (org.junit.Before)5 StringLinePrinter (org.neo4j.shell.StringLinePrinter)4 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 ClientException (org.neo4j.driver.exceptions.ClientException)1 CliArgs (org.neo4j.shell.cli.CliArgs)1 CommandHelper (org.neo4j.shell.commands.CommandHelper)1 AnsiLogger (org.neo4j.shell.log.AnsiLogger)1 Logger (org.neo4j.shell.log.Logger)1