use of org.neo4j.shell.impl.SystemOutput 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.SystemOutput in project neo4j by neo4j.
the class ShellQueryLoggingIT method setup.
@Before
public void setup() throws Exception {
server = new GraphDatabaseShellServer(db.getGraphDatabaseAPI());
SystemOutput output = new SystemOutput(new PrintWriter(out));
client = ShellLobby.newClient(server, new HashMap<>(), output, action -> () -> {
});
// clear the output (remove the welcome message)
out.getBuffer().setLength(0);
}
use of org.neo4j.shell.impl.SystemOutput in project neo4j by neo4j.
the class StartClient method tryStartLocalServerAndClient.
private void tryStartLocalServerAndClient(File path, boolean readOnly, Args args, CtrlCHandler signalHandler) throws Exception {
String configFile = args.get(ARG_CONFIG, null);
final GraphDatabaseShellServer server = getGraphDatabaseShellServer(path, readOnly, configFile);
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
shutdownIfNecessary(server);
}
});
if (!isCommandLine(args)) {
out.println("NOTE: Local Neo4j graph database service at '" + path + "'");
}
ShellClient client = ShellLobby.newClient(server, getSessionVariablesFromArgs(args), new SystemOutput(out), signalHandler);
grabPromptOrJustExecuteCommand(client, args);
shutdownIfNecessary(server);
}
use of org.neo4j.shell.impl.SystemOutput in project neo4j by neo4j.
the class OutputAsWriterTest method setUp.
@Before
public void setUp() throws Exception {
out = System.out;
buffer = new ByteArrayOutputStream();
System.setOut(new PrintStream(buffer));
output = new SystemOutput();
writer = new OutputAsWriter(output);
}
Aggregations