use of org.neo4j.shell.kernel.GraphDatabaseShellServer in project neo4j by neo4j.
the class DontShutdownClient method main.
public static void main(String[] args) throws Exception {
File path = new File(args[0]);
File configFile = createDefaultConfigFile(path);
GraphDatabaseShellServer server = new GraphDatabaseShellServer(path, false, configFile.getAbsolutePath());
new SameJvmClient(new HashMap<>(), server, /* Temporary, switch back to SilentOutput once flaky test is resolved. */
new SystemOutput(), InterruptSignalHandler.getHandler());
server.shutdown();
// Intentionally don't shutdown the client
}
use of org.neo4j.shell.kernel.GraphDatabaseShellServer in project neo4j by neo4j.
the class DontShutdownLocalServer method main.
public static void main(String[] args) throws Exception {
File path = new File(args[0]);
File configFile = createDefaultConfigFile(path);
new GraphDatabaseShellServer(path, false, configFile.getAbsolutePath());
// Intentionally don't shutdown the server
}
use of org.neo4j.shell.kernel.GraphDatabaseShellServer in project neo4j by neo4j.
the class TransactionGuardIntegrationTest method terminateLongRunningShellPeriodicCommitQuery.
@Test
public void terminateLongRunningShellPeriodicCommitQuery() throws Exception {
GraphDatabaseAPI database = startDatabaseWithTimeoutCustomGuard();
GraphDatabaseShellServer shellServer = getGraphDatabaseShellServer(database);
try {
SameJvmClient client = getShellClient(shellServer);
CollectingOutput commandOutput = new CollectingOutput();
URL url = prepareTestImportFile(8);
execute(shellServer, commandOutput, client.getId(), "USING PERIODIC COMMIT 5 LOAD CSV FROM '" + url + "' AS line CREATE ();");
fail("Transaction should be already terminated.");
} catch (ShellException e) {
assertThat(e.getMessage(), containsString("Transaction timeout."));
}
assertDatabaseDoesNotHaveNodes(database);
}
use of org.neo4j.shell.kernel.GraphDatabaseShellServer in project neo4j by neo4j.
the class StartClientIT method shouldNotStartBolt.
@Test
public void shouldNotStartBolt() throws IOException {
// Given
AssertableLogProvider log = new AssertableLogProvider();
// When
new StartClient(System.out, System.err) {
@Override
protected GraphDatabaseShellServer getGraphDatabaseShellServer(File path, boolean readOnly, String configFile) throws RemoteException {
return new GraphDatabaseShellServer(new TestGraphDatabaseFactory().setUserLogProvider(log), path, readOnly, configFile);
}
}.start(new String[] { "-c", "RETURN 1;", "-path", db.getStoreDir(), "-config", getClass().getResource("/config-with-bolt-connector.conf").getFile() }, mock(CtrlCHandler.class));
// Then
log.assertNone(inLog(startsWith(WorkerFactory.class.getPackage().getName())).any());
}
use of org.neo4j.shell.kernel.GraphDatabaseShellServer in project neo4j by neo4j.
the class CdTest method setup.
@Before
public void setup() throws Exception {
db = dbRule.getGraphDatabaseAPI();
server = new GraphDatabaseShellServer(db);
session.set(Variables.TITLE_KEYS_KEY, "name");
}
Aggregations