Repository repo = Repository.create(repoConfig, dir);
Process process = getFirstServer(repo).getProcess();
process.destroy();
// Process is dead and we can't send command
try {
VersionCommand cmd = VersionCommand.on(repo);
cmd.execute();
assertFailedExecution(cmd);
} catch (UnexpectedServerTerminationException e) {
// success
}
repo.close();
repo = Repository.open(repoConfig, dir);
String longStringThatDoesntFitInBuffers = Strings.repeat("x", 10 * 1000 * 1000);
GenericCommand cmd = new GenericCommand(repo, "javahg-write");
HgInputStream stream = cmd.launchStream("o", longStringThatDoesntFitInBuffers);
boolean killed = killProcess(process);
if (killed) {
// Command is now sent, but we can't read output
try {
// String s =