use of org.neo4j.shell.impl.SameJvmClient in project neo4j by neo4j.
the class AppsIT method canDisableWelcomeMessage.
@Test
public void canDisableWelcomeMessage() throws Exception {
Map<String, Serializable> values = genericMap("quiet", "true");
final CollectingOutput out = new CollectingOutput();
ShellClient client = new SameJvmClient(values, shellServer, out);
client.shutdown();
final String outString = out.asString();
assertEquals("Shows welcome message: " + outString, false, outString.contains("Welcome to the Neo4j Shell! Enter 'help' for a list of commands"));
}
use of org.neo4j.shell.impl.SameJvmClient in project neo4j by neo4j.
the class AppsIT method doesShowWelcomeMessage.
@Test
public void doesShowWelcomeMessage() throws Exception {
Map<String, Serializable> values = genericMap();
final CollectingOutput out = new CollectingOutput();
ShellClient client = new SameJvmClient(values, shellServer, out);
client.shutdown();
final String outString = out.asString();
assertEquals("Shows welcome message: " + outString, true, outString.contains("Welcome to the Neo4j Shell! Enter 'help' for a list of commands"));
}
use of org.neo4j.shell.impl.SameJvmClient 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.impl.SameJvmClient 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.impl.SameJvmClient in project neo4j by neo4j.
the class FakeShellServer method doBefore.
@Before
public void doBefore() throws Exception {
db = (GraphDatabaseAPI) new TestGraphDatabaseFactory().newImpermanentDatabase();
shellServer = new FakeShellServer(db);
shellClient = new SameJvmClient(new HashMap<String, Serializable>(), shellServer, new CollectingOutput());
}
Aggregations