Program: 24245
Project: 24245
Buggy source:
@Test public void testStartedThenAbort() throws Exception {
  String path=Paths.get(String.format("String_Node_Str",Paths.get("String_Node_Str").toAbsolutePath().toString(),SCRIPT_PATH,"String_Node_Str")).toString();
  Socket client=new Socket();
  client.connect(new InetSocketAddress("String_Node_Str",61234));
  OutputStream outputStream=client.getOutputStream();
  InputStream inputStream=client.getInputStream();
  byte[] prepare=("String_Node_Str" + "String_Node_Str" + ("String_Node_Str".length() + path.length() + "String_Node_Str".length()) + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ path+ "String_Node_Str").getBytes("String_Node_Str");
  outputStream.write(prepare);
  outputStream.flush();
  String preparedContent="String_Node_Str" + path + "String_Node_Str";
  ByteBuffer preparedExpected=ByteBuffer.wrap(("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + preparedContent.length() + "String_Node_Str"+ "String_Node_Str"+ preparedContent).getBytes("String_Node_Str"));
  ByteBuffer prepared=ByteBuffer.allocate(preparedExpected.capacity());
  while (prepared.hasRemaining()) {
    prepared.put((byte)inputStream.read());
  }
  prepared.flip();
  assertEquals(preparedExpected,prepared);
  byte[] start=("String_Node_Str" + "String_Node_Str" + ("String_Node_Str".length() + path.length() + "String_Node_Str".length()) + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ path+ "String_Node_Str").getBytes("String_Node_Str");
  outputStream.write(start);
  outputStream.flush();
  String startedContent="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + path + "String_Node_Str";
  ByteBuffer startedExpected=ByteBuffer.wrap(("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + startedContent.length() + "String_Node_Str"+ "String_Node_Str"+ startedContent).getBytes("String_Node_Str"));
  ByteBuffer started=ByteBuffer.allocate(startedExpected.capacity());
  while (started.hasRemaining()) {
    started.put((byte)inputStream.read());
  }
  started.flip();
  assertEquals(startedExpected,started);
  byte[] abort=("String_Node_Str" + "String_Node_Str" + ("String_Node_Str".length() + path.length() + "String_Node_Str".length()) + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ path+ "String_Node_Str").getBytes("String_Node_Str");
  outputStream.write(abort);
  outputStream.flush();
  String finishedContent="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + path + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ByteBuffer finishedExpected=ByteBuffer.wrap(("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + finishedContent.length() + "String_Node_Str"+ "String_Node_Str"+ finishedContent).getBytes("String_Node_Str"));
  ByteBuffer finished=ByteBuffer.allocate(finishedExpected.capacity());
  while (finished.hasRemaining()) {
    finished.put((byte)inputStream.read());
  }
  finished.flip();
  client.close();
  assertEquals(finishedExpected,finished);
}

Fixed version (ground truth):
@Test(timeout=TEST_TIMEOUT) public void testStartedThenAbort() throws Exception {
  String path=Paths.get(String.format("String_Node_Str",Paths.get("String_Node_Str").toAbsolutePath().toString(),SCRIPT_PATH,"String_Node_Str")).toString();
  Socket client=new Socket();
  client.connect(new InetSocketAddress("String_Node_Str",61234));
  OutputStream outputStream=client.getOutputStream();
  InputStream inputStream=client.getInputStream();
  byte[] prepare=("String_Node_Str" + "String_Node_Str" + ("String_Node_Str".length() + path.length()) + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ path+ "String_Node_Str").getBytes("String_Node_Str");
  outputStream.write(prepare);
  outputStream.flush();
  String preparedContent="String_Node_Str" + path + "String_Node_Str";
  ByteBuffer preparedExpected=ByteBuffer.wrap(("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + preparedContent.length() + "String_Node_Str"+ "String_Node_Str"+ preparedContent).getBytes("String_Node_Str"));
  ByteBuffer prepared=ByteBuffer.allocate(preparedExpected.capacity());
  while (prepared.hasRemaining()) {
    prepared.put((byte)inputStream.read());
  }
  prepared.flip();
  assertEquals(preparedExpected,prepared);
  byte[] start=("String_Node_Str" + "String_Node_Str" + ("String_Node_Str".length() + path.length()) + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ path+ "String_Node_Str").getBytes("String_Node_Str");
  outputStream.write(start);
  outputStream.flush();
  String startedContent="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + path + "String_Node_Str";
  ByteBuffer startedExpected=ByteBuffer.wrap(("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + startedContent.length() + "String_Node_Str"+ "String_Node_Str"+ startedContent).getBytes("String_Node_Str"));
  ByteBuffer started=ByteBuffer.allocate(startedExpected.capacity());
  while (started.hasRemaining()) {
    started.put((byte)inputStream.read());
  }
  started.flip();
  assertEquals(startedExpected,started);
  byte[] abort=("String_Node_Str" + "String_Node_Str" + ("String_Node_Str".length() + path.length()) + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ path+ "String_Node_Str").getBytes("String_Node_Str");
  outputStream.write(abort);
  outputStream.flush();
  String finishedContent="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + path + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  ByteBuffer finishedExpected=ByteBuffer.wrap(("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + finishedContent.length() + "String_Node_Str"+ "String_Node_Str"+ finishedContent).getBytes("String_Node_Str"));
  ByteBuffer finished=ByteBuffer.allocate(finishedExpected.capacity());
  while (finished.hasRemaining()) {
    finished.put((byte)inputStream.read());
  }
  finished.flip();
  client.close();
  assertEquals(finishedExpected,finished);
}