Program: 10652
Project: 10652
Buggy source:
@Test public void agnosticRtpEndpointToWebRtcWithFfmpeg() throws Exception {
  final CountDownLatch proccessOfferLatch=new CountDownLatch(1);
  MediaPipeline mp=kurentoClient.createMediaPipeline();
  SDES sdes=new SDES();
  sdes.setCrypto(CryptoSuite.AES_128_CM_HMAC_SHA1_80);
  RtpEndpoint rtpEp=new RtpEndpoint.Builder(mp).withCrypto(sdes).build();
  WebRtcEndpoint webRtcEp=new WebRtcEndpoint.Builder(mp).build();
  rtpEp.connect(webRtcEp);
  getPage().subscribeEvents("String_Node_Str");
  getPage().initWebRtc(webRtcEp,WebRtcChannel.AUDIO_AND_VIDEO,WebRtcMode.RCV_ONLY);
  String sdp="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  rtpEp.processOffer(sdp,new Continuation<String>(){
    @Override public void onSuccess(    String result) throws Exception {
      String[] parse=result.split("String_Node_Str");
      String port_=parse[1].split("String_Node_Str")[1];
      port=port_;
      proccessOfferLatch.countDown();
    }
    @Override public void onError(    Throwable cause) throws Exception {
      log.info("String_Node_Str",cause.getMessage());
    }
  }
);
  proccessOfferLatch.await(getPage().getTimeout(),TimeUnit.SECONDS);
  String[] kmsUriParse=kms.getWsUri().split("String_Node_Str");
  String kmsIp=kmsUriParse[1].split("String_Node_Str")[0];
  String mediaPath=FILE + "String_Node_Str" + getTestFilesDiskPath()+ "String_Node_Str";
  String ffmpegCmd="String_Node_Str" + mediaPath + "String_Node_Str"+ kmsIp+ "String_Node_Str"+ port;
  log.debug("String_Node_Str",mediaPath);
  log.debug("String_Node_Str",kmsIp,port);
  log.debug("String_Node_Str",ffmpegCmd);
  Shell.runAndWaitString(ffmpegCmd);
  Assert.assertTrue("String_Node_Str",getPage().waitForEvent("String_Node_Str"));
  Color[] expectedColors={Color.RED,Color.GREEN,Color.BLUE};
  for (  Color expectedColor : expectedColors) {
    Assert.assertTrue("String_Node_Str" + expectedColor,getPage().similarColor(expectedColor));
  }
  mp.release();
}

Fixed version (ground truth):
@Test public void agnosticRtpEndpointToWebRtcWithFfmpeg() throws Exception {
  final CountDownLatch proccessOfferLatch=new CountDownLatch(1);
  MediaPipeline mp=kurentoClient.createMediaPipeline();
  SDES sdes=new SDES();
  sdes.setCrypto(CryptoSuite.AES_128_CM_HMAC_SHA1_80);
  RtpEndpoint rtpEp=new RtpEndpoint.Builder(mp).withCrypto(sdes).build();
  WebRtcEndpoint webRtcEp=new WebRtcEndpoint.Builder(mp).build();
  final CountDownLatch flowingInLatch=new CountDownLatch(1);
  webRtcEp.addMediaFlowInStateChangeListener(new EventListener<MediaFlowInStateChangeEvent>(){
    @Override public void onEvent(    MediaFlowInStateChangeEvent event){
      flowingInLatch.countDown();
    }
  }
);
  rtpEp.connect(webRtcEp);
  getPage().subscribeEvents("String_Node_Str");
  getPage().initWebRtc(webRtcEp,WebRtcChannel.AUDIO_AND_VIDEO,WebRtcMode.RCV_ONLY);
  String sdp="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  rtpEp.processOffer(sdp,new Continuation<String>(){
    @Override public void onSuccess(    String result) throws Exception {
      String[] parse=result.split("String_Node_Str");
      String port_=parse[1].split("String_Node_Str")[1];
      port=port_;
      proccessOfferLatch.countDown();
    }
    @Override public void onError(    Throwable cause) throws Exception {
      log.info("String_Node_Str",cause.getMessage());
    }
  }
);
  proccessOfferLatch.await(getPage().getTimeout(),TimeUnit.SECONDS);
  String[] kmsUriParse=kms.getWsUri().split("String_Node_Str");
  String kmsIp=kmsUriParse[1].split("String_Node_Str")[0];
  String mediaPath=FILE + "String_Node_Str" + getTestFilesDiskPath()+ "String_Node_Str";
  String ffmpegCmd="String_Node_Str" + mediaPath + "String_Node_Str"+ kmsIp+ "String_Node_Str"+ port;
  log.debug("String_Node_Str",mediaPath);
  log.debug("String_Node_Str",kmsIp,port);
  log.debug("String_Node_Str",ffmpegCmd);
  Shell.run(ffmpegCmd.split("String_Node_Str"));
  Assert.assertTrue("String_Node_Str",flowingInLatch.await(getPage().getTimeout(),TimeUnit.SECONDS));
  Assert.assertTrue("String_Node_Str",getPage().waitForEvent("String_Node_Str"));
  Color[] expectedColors={Color.RED,Color.GREEN,Color.BLUE};
  for (  Color expectedColor : expectedColors) {
    Assert.assertTrue("String_Node_Str" + expectedColor,getPage().similarColor(expectedColor));
  }
  mp.release();
}