Search in sources :

Example 6 with CypherShell

use of org.neo4j.shell.CypherShell 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 7 with CypherShell

use of org.neo4j.shell.CypherShell 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 8 with CypherShell

use of org.neo4j.shell.CypherShell 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)

Example 9 with CypherShell

use of org.neo4j.shell.CypherShell in project neo4j by neo4j.

the class CypherShellProtocolIntegrationTest method shouldConnectWithNeo4jProtocol.

@Test
public void shouldConnectWithNeo4jProtocol() throws Exception {
    CypherShell shell = new CypherShell(new StringLinePrinter(), new PrettyConfig(Format.PLAIN, true, 1000), false, new ShellParameterMap());
    // This should work even on older databases without the neo4j protocol, by falling back to bolt
    shell.connect(new ConnectionConfig("neo4j", "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)

Example 10 with CypherShell

use of org.neo4j.shell.CypherShell in project neo4j by neo4j.

the class CypherShellVerboseIntegrationTest method setUp.

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

Aggregations

CypherShell (org.neo4j.shell.CypherShell)12 ShellParameterMap (org.neo4j.shell.ShellParameterMap)12 PrettyConfig (org.neo4j.shell.prettyprint.PrettyConfig)11 Test (org.junit.Test)7 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 Begin (org.neo4j.shell.commands.Begin)1 Command (org.neo4j.shell.commands.Command)1 CommandHelper (org.neo4j.shell.commands.CommandHelper)1 AnsiLogger (org.neo4j.shell.log.AnsiLogger)1