Search in sources :

Example 1 with RemoteClient

use of org.neo4j.shell.impl.RemoteClient in project neo4j-documentation by neo4j.

the class ShellDocTest method testEnableServerOnDefaultPort.

@Test
public void testEnableServerOnDefaultPort() throws Exception {
    GraphDatabaseService graphDb = new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().setConfig(ShellSettings.remote_shell_enabled, Settings.TRUE).newGraphDatabase();
    try {
        RemoteClient client = new RemoteClient(NO_INITIAL_SESSION, remoteLocation(), new CollectingOutput());
        client.evaluate("help");
        client.shutdown();
    } finally {
        graphDb.shutdown();
    }
}
Also used : GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) TestGraphDatabaseFactory(org.neo4j.test.TestGraphDatabaseFactory) CollectingOutput(org.neo4j.shell.impl.CollectingOutput) RemoteClient(org.neo4j.shell.impl.RemoteClient) Test(org.junit.Test)

Example 2 with RemoteClient

use of org.neo4j.shell.impl.RemoteClient in project neo4j-documentation by neo4j.

the class ShellDocTest method testEnableRemoteShellOnCustomPort.

@Test
public void testEnableRemoteShellOnCustomPort() throws Exception {
    int port = 8085;
    GraphDatabaseService graphDb = new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().setConfig(ShellSettings.remote_shell_enabled, "true").setConfig(ShellSettings.remote_shell_port, "" + port).newGraphDatabase();
    RemoteClient client = new RemoteClient(NO_INITIAL_SESSION, remoteLocation(port), new CollectingOutput());
    client.evaluate("help");
    client.shutdown();
    graphDb.shutdown();
}
Also used : GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) TestGraphDatabaseFactory(org.neo4j.test.TestGraphDatabaseFactory) CollectingOutput(org.neo4j.shell.impl.CollectingOutput) RemoteClient(org.neo4j.shell.impl.RemoteClient) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 GraphDatabaseService (org.neo4j.graphdb.GraphDatabaseService)2 CollectingOutput (org.neo4j.shell.impl.CollectingOutput)2 RemoteClient (org.neo4j.shell.impl.RemoteClient)2 TestGraphDatabaseFactory (org.neo4j.test.TestGraphDatabaseFactory)2