Program: 114909
Project: 114909
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str") public void testHostObjectTestCase() throws Exception {
  apiPublisher.login(user.getUserName(),user.getPassword());
  apiStore.login(user.getUserName(),user.getPassword());
  String APIName="String_Node_Str";
  String APIContext="String_Node_Str";
  String tags="String_Node_Str";
  String url="String_Node_Str";
  String description="String_Node_Str";
  String providerName=user.getUserName();
  String APIVersion="String_Node_Str";
  String filePublisher, fileStore;
  if (publisherContext.getContextTenant().getDomain().equals("String_Node_Str")) {
    filePublisher="String_Node_Str";
    fileStore="String_Node_Str";
  }
 else {
    filePublisher="String_Node_Str";
    fileStore="String_Node_Str";
  }
  APIRequest apiRequest=new APIRequest(APIName,APIContext,new URL(url));
  apiRequest.setTags(tags);
  apiRequest.setDescription(description);
  apiRequest.setVersion(APIVersion);
  apiRequest.setProvider(providerName);
  apiPublisher.addAPI(apiRequest);
  APIBean apiBean=APIMTestCaseUtils.getAPIBeanFromHttpResponse(apiPublisher.getAPI(APIName,providerName));
  APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(APIName,providerName,APILifeCycleState.PUBLISHED);
  apiPublisher.changeAPILifeCycleStatus(updateRequest);
  assertEquals(apiBean.getId().getApiName(),APIName,"String_Node_Str");
  assertTrue(apiBean.getContext().contains(APIContext),"String_Node_Str");
  assertEquals(apiBean.getId().getVersion(),APIVersion,"String_Node_Str");
  assertEquals(apiBean.getId().getProviderName(),providerName,"String_Node_Str");
  for (  String tag : apiBean.getTags()) {
    assertTrue(tags.contains(tag),"String_Node_Str");
  }
  assertEquals(apiBean.getDescription(),description,"String_Node_Str");
  apiStore.addApplication("String_Node_Str",APIMIntegrationConstants.APPLICATION_TIER.UNLIMITED,"String_Node_Str","String_Node_Str");
  SubscriptionRequest subscriptionRequest=new SubscriptionRequest(APIName,providerName);
  subscriptionRequest.setApplicationName(hostObjectTestApplicationName);
  apiStore.subscribe(subscriptionRequest);
  apiPublisher.addDocument(APIName,APIVersion,providerName,"String_Node_Str",APIMIntegrationConstants.API_DOCUMENT_TYPE_HOW_TO,APIMIntegrationConstants.API_DOCUMENT_SOURCE_INLINE,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  APPKeyRequestGenerator generateAppKeyRequest=new APPKeyRequestGenerator(hostObjectTestApplicationName);
  String responseString=apiStore.generateApplicationKey(generateAppKeyRequest).getData();
  JSONObject response=new JSONObject(responseString);
  String accessToken=response.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").get("String_Node_Str").toString();
  assertNotNull(accessToken,"String_Node_Str");
  String sourcePath=computeSourcePath(filePublisher);
  String destinationPath=computeDestPath(filePublisher);
  copySampleFile(sourcePath,destinationPath);
  sourcePath=computeSourcePath(fileStore);
  destinationPath=computeDestPath(fileStore);
  copySampleFile(sourcePath,destinationPath);
  String finalOutputPublisher=null;
  int deploymentDelayInMilliseconds=90 * 1000;
  long startTime=System.currentTimeMillis();
  try {
    String[] responseArrayFromPublisher=new String[35];
    boolean isPublisherResponse=false;
    while (((System.currentTimeMillis() - startTime) < deploymentDelayInMilliseconds) && !isPublisherResponse) {
      Thread.sleep(500);
      URL jaggeryURL=new URL(publisherUrls.getWebAppURLHttp() + "String_Node_Str" + filePublisher);
      URLConnection jaggeryServerConnection=jaggeryURL.openConnection();
      BufferedReader in=new BufferedReader(new InputStreamReader(jaggeryServerConnection.getInputStream()));
      String inputLine;
      while ((inputLine=in.readLine()) != null) {
        finalOutputPublisher=inputLine;
      }
      if (null != finalOutputPublisher) {
        responseArrayFromPublisher=finalOutputPublisher.split("String_Node_Str");
        isPublisherResponse=responseArrayFromPublisher[30].contains("String_Node_Str");
      }
      in.close();
    }
    log.info(finalOutputPublisher);
    validatePublisherResponseArray(responseArrayFromPublisher);
  }
 catch (  IOException e) {
    log.error("String_Node_Str");
  }
 finally {
    assertNotNull(finalOutputPublisher,"String_Node_Str");
  }
  String finalOutputStore=null;
  try {
    String[] responseArrayFromStore=new String[27];
    boolean isStoreResponse=false;
    startTime=System.currentTimeMillis();
    while (((System.currentTimeMillis() - startTime) < deploymentDelayInMilliseconds) && !isStoreResponse) {
      Thread.sleep(500);
      URL jaggeryURL=new URL(storeUrls.getWebAppURLHttp() + "String_Node_Str" + fileStore);
      URLConnection jaggeryServerConnection=jaggeryURL.openConnection();
      BufferedReader in=new BufferedReader(new InputStreamReader(jaggeryServerConnection.getInputStream()));
      String inputLine;
      while ((inputLine=in.readLine()) != null) {
        finalOutputStore=inputLine;
      }
      if (null != finalOutputStore) {
        responseArrayFromStore=finalOutputStore.split("String_Node_Str");
        isStoreResponse=responseArrayFromStore[9].contains("String_Node_Str");
      }
      in.close();
    }
    log.info(finalOutputStore);
    validateStoreResponseArray(responseArrayFromStore);
  }
 catch (  IOException e) {
    log.error("String_Node_Str");
  }
 finally {
    assertNotNull(finalOutputStore,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str") public void testHostObjectTestCase() throws Exception {
  apiPublisher.login(user.getUserName(),user.getPassword());
  apiStore.login(user.getUserName(),user.getPassword());
  String APIName="String_Node_Str";
  String APIContext="String_Node_Str";
  String tags="String_Node_Str";
  String url="String_Node_Str";
  String description="String_Node_Str";
  String providerName=user.getUserName();
  String APIVersion="String_Node_Str";
  String filePublisher, fileStore;
  if (publisherContext.getContextTenant().getDomain().equals("String_Node_Str")) {
    filePublisher="String_Node_Str";
    fileStore="String_Node_Str";
  }
 else {
    filePublisher="String_Node_Str";
    fileStore="String_Node_Str";
  }
  APIRequest apiRequest=new APIRequest(APIName,APIContext,new URL(url));
  apiRequest.setTags(tags);
  apiRequest.setDescription(description);
  apiRequest.setVersion(APIVersion);
  apiRequest.setProvider(providerName);
  apiPublisher.addAPI(apiRequest);
  APIBean apiBean=APIMTestCaseUtils.getAPIBeanFromHttpResponse(apiPublisher.getAPI(APIName,providerName));
  APILifeCycleStateRequest updateRequest=new APILifeCycleStateRequest(APIName,providerName,APILifeCycleState.PUBLISHED);
  apiPublisher.changeAPILifeCycleStatus(updateRequest);
  assertEquals(apiBean.getId().getApiName(),APIName,"String_Node_Str");
  assertTrue(apiBean.getContext().contains(APIContext),"String_Node_Str");
  assertEquals(apiBean.getId().getVersion(),APIVersion,"String_Node_Str");
  assertEquals(apiBean.getId().getProviderName(),providerName,"String_Node_Str");
  for (  String tag : apiBean.getTags()) {
    assertTrue(tags.contains(tag),"String_Node_Str");
  }
  assertEquals(apiBean.getDescription(),description,"String_Node_Str");
  apiStore.addApplication(hostObjectTestApplicationName,APIMIntegrationConstants.APPLICATION_TIER.UNLIMITED,"String_Node_Str","String_Node_Str");
  SubscriptionRequest subscriptionRequest=new SubscriptionRequest(APIName,providerName);
  subscriptionRequest.setApplicationName(hostObjectTestApplicationName);
  apiStore.subscribe(subscriptionRequest);
  apiPublisher.addDocument(APIName,APIVersion,providerName,"String_Node_Str",APIMIntegrationConstants.API_DOCUMENT_TYPE_HOW_TO,APIMIntegrationConstants.API_DOCUMENT_SOURCE_INLINE,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  APPKeyRequestGenerator generateAppKeyRequest=new APPKeyRequestGenerator(hostObjectTestApplicationName);
  String responseString=apiStore.generateApplicationKey(generateAppKeyRequest).getData();
  JSONObject response=new JSONObject(responseString);
  String accessToken=response.getJSONObject("String_Node_Str").getJSONObject("String_Node_Str").get("String_Node_Str").toString();
  assertNotNull(accessToken,"String_Node_Str");
  String sourcePath=computeSourcePath(filePublisher);
  String destinationPath=computeDestPath(filePublisher);
  copySampleFile(sourcePath,destinationPath);
  sourcePath=computeSourcePath(fileStore);
  destinationPath=computeDestPath(fileStore);
  copySampleFile(sourcePath,destinationPath);
  String finalOutputPublisher=null;
  int deploymentDelayInMilliseconds=90 * 1000;
  long startTime=System.currentTimeMillis();
  try {
    String[] responseArrayFromPublisher=new String[35];
    boolean isPublisherResponse=false;
    while (((System.currentTimeMillis() - startTime) < deploymentDelayInMilliseconds) && !isPublisherResponse) {
      Thread.sleep(500);
      URL jaggeryURL=new URL(publisherUrls.getWebAppURLHttp() + "String_Node_Str" + filePublisher);
      URLConnection jaggeryServerConnection=jaggeryURL.openConnection();
      BufferedReader in=new BufferedReader(new InputStreamReader(jaggeryServerConnection.getInputStream()));
      String inputLine;
      while ((inputLine=in.readLine()) != null) {
        finalOutputPublisher=inputLine;
      }
      if (null != finalOutputPublisher) {
        responseArrayFromPublisher=finalOutputPublisher.split("String_Node_Str");
        isPublisherResponse=responseArrayFromPublisher[30].contains("String_Node_Str");
      }
      in.close();
    }
    log.info(finalOutputPublisher);
    validatePublisherResponseArray(responseArrayFromPublisher);
  }
 catch (  IOException e) {
    log.error("String_Node_Str");
  }
 finally {
    assertNotNull(finalOutputPublisher,"String_Node_Str");
  }
  String finalOutputStore=null;
  try {
    String[] responseArrayFromStore=new String[27];
    boolean isStoreResponse=false;
    startTime=System.currentTimeMillis();
    while (((System.currentTimeMillis() - startTime) < deploymentDelayInMilliseconds) && !isStoreResponse) {
      Thread.sleep(500);
      URL jaggeryURL=new URL(storeUrls.getWebAppURLHttp() + "String_Node_Str" + fileStore);
      URLConnection jaggeryServerConnection=jaggeryURL.openConnection();
      BufferedReader in=new BufferedReader(new InputStreamReader(jaggeryServerConnection.getInputStream()));
      String inputLine;
      while ((inputLine=in.readLine()) != null) {
        finalOutputStore=inputLine;
      }
      if (null != finalOutputStore) {
        responseArrayFromStore=finalOutputStore.split("String_Node_Str");
        isStoreResponse=responseArrayFromStore[9].contains("String_Node_Str");
      }
      in.close();
    }
    log.info(finalOutputStore);
    validateStoreResponseArray(responseArrayFromStore);
  }
 catch (  IOException e) {
    log.error("String_Node_Str");
  }
 finally {
    assertNotNull(finalOutputStore,"String_Node_Str");
  }
}