Search in sources :

Example 1 with StringLinePrinter

use of org.neo4j.shell.StringLinePrinter 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());
}
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 2 with StringLinePrinter

use of org.neo4j.shell.StringLinePrinter 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());
}
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 3 with StringLinePrinter

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

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

Aggregations

Test (org.junit.Test)4 ConnectionConfig (org.neo4j.shell.ConnectionConfig)4 CypherShell (org.neo4j.shell.CypherShell)4 ShellParameterMap (org.neo4j.shell.ShellParameterMap)4 StringLinePrinter (org.neo4j.shell.StringLinePrinter)4 PrettyConfig (org.neo4j.shell.prettyprint.PrettyConfig)4