Program: 34803
Project: 34803
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str") public void addTemplateConfigurationTestScenario1() throws Exception {
  String configName="String_Node_Str";
  DomainInfoDTO domainInfo=executionManagerAdminServiceClient.getDomainInfo("String_Node_Str");
  if (domainInfo == null) {
    Assert.fail("String_Node_Str");
  }
 else {
    log.info("String_Node_Str");
    eventStreamCount=eventStreamManagerAdminServiceClient.getEventStreamCount();
    executionPlanCount=eventProcessorAdminServiceClient.getExecutionPlanConfigurationCount();
    eventStreamCount=eventStreamManagerAdminServiceClient.getEventStreamCount();
    log.info("String_Node_Str");
    ScenarioConfigurationDTO configuration=new ScenarioConfigurationDTO();
    configuration.setName(configName);
    configuration.setDomain(domainInfo.getName());
    configuration.setType(domainInfo.getScenarioInfoDTOs()[0].getType());
    configuration.setDescription("String_Node_Str");
    for (    ParameterDTOE parameterDTOE : domainInfo.getScenarioInfoDTOs()[0].getParameterDTOs()) {
      ParameterDTO parameterDTO=new ParameterDTO();
      parameterDTO.setName(parameterDTOE.getName());
      parameterDTO.setValue(parameterDTOE.getDefaultValue());
      configuration.addParameterDTOs(parameterDTO);
    }
    String[] streamIDsToBeMapped=executionManagerAdminServiceClient.saveConfiguration(configuration);
    Assert.assertEquals(TO_STREAM_ID,streamIDsToBeMapped[0]);
    Assert.assertEquals(eventProcessorAdminServiceClient.getExecutionPlanConfigurationCount(),++executionPlanCount);
    Assert.assertEquals(eventStreamManagerAdminServiceClient.getEventStreamCount(),eventStreamCount);
    Assert.assertEquals(executionManagerAdminServiceClient.getConfigurationsCount(domainInfo.getName()),++configurationCount);
    StreamMappingDTO streamMappingDTO=new StreamMappingDTO();
    streamMappingDTO.setFromStream(DEVICE_STREAM_ID);
    streamMappingDTO.setToStream(TO_STREAM_ID);
    AttributeMappingDTO[] attributeMappingDTOs=new AttributeMappingDTO[TO_STREAM_ATTRIBUTE_COUNT];
    AttributeMappingDTO idAttributeMappingDTO=new AttributeMappingDTO();
    idAttributeMappingDTO.setFromAttribute("String_Node_Str");
    idAttributeMappingDTO.setToAttribute("String_Node_Str");
    idAttributeMappingDTO.setAttributeType("String_Node_Str");
    AttributeMappingDTO valueAttributeMappingDTO=new AttributeMappingDTO();
    valueAttributeMappingDTO.setFromAttribute("String_Node_Str");
    valueAttributeMappingDTO.setToAttribute("String_Node_Str");
    valueAttributeMappingDTO.setAttributeType("String_Node_Str");
    attributeMappingDTOs[0]=idAttributeMappingDTO;
    attributeMappingDTOs[1]=valueAttributeMappingDTO;
    streamMappingDTO.setAttributeMappingDTOs(attributeMappingDTOs);
    StreamMappingDTO[] streamMappingDTOs={streamMappingDTO};
    boolean streamMappingSaved=executionManagerAdminServiceClient.saveStreamMapping(streamMappingDTOs,configName,domainInfo.getName());
    Assert.assertEquals(streamMappingSaved,true);
    Assert.assertEquals(eventProcessorAdminServiceClient.getExecutionPlanConfigurationCount(),++executionPlanCount);
    log.info("String_Node_Str");
    configuration.setDescription("String_Node_Str");
    executionManagerAdminServiceClient.saveConfiguration(configuration);
    Assert.assertEquals(eventProcessorAdminServiceClient.getExecutionPlanConfigurationCount(),executionPlanCount);
    Assert.assertEquals(eventStreamManagerAdminServiceClient.getEventStreamCount(),eventStreamCount);
    Assert.assertEquals(executionManagerAdminServiceClient.getConfigurationsCount(domainInfo.getName()),configurationCount);
    log.info("String_Node_Str");
    executionManagerAdminServiceClient.deleteConfiguration(configuration.getDomain(),configuration.getName());
    executionPlanCount=executionPlanCount - 2;
    Assert.assertEquals(eventProcessorAdminServiceClient.getExecutionPlanConfigurationCount(),executionPlanCount);
    Assert.assertEquals(eventStreamManagerAdminServiceClient.getEventStreamCount(),eventStreamCount);
    Assert.assertEquals(executionManagerAdminServiceClient.getConfigurationsCount(domainInfo.getName()),--configurationCount);
  }
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str") public void addTemplateConfigurationTestScenario1() throws Exception {
  String configName="String_Node_Str";
  DomainInfoDTO domainInfo=executionManagerAdminServiceClient.getDomainInfo("String_Node_Str");
  if (domainInfo == null) {
    Assert.fail("String_Node_Str");
  }
 else {
    log.info("String_Node_Str");
    eventStreamCount=eventStreamManagerAdminServiceClient.getEventStreamCount();
    executionPlanCount=eventProcessorAdminServiceClient.getExecutionPlanConfigurationCount();
    eventStreamCount=eventStreamManagerAdminServiceClient.getEventStreamCount();
    log.info("String_Node_Str");
    ScenarioConfigurationDTO configuration=new ScenarioConfigurationDTO();
    configuration.setName(configName);
    configuration.setDomain(domainInfo.getName());
    configuration.setType(domainInfo.getScenarioInfoDTOs()[0].getType());
    configuration.setDescription("String_Node_Str");
    for (    DomainParameterDTO parameterDTOE : domainInfo.getScenarioInfoDTOs()[0].getDomainParameterDTOs()) {
      ConfigurationParameterDTO parameterDTO=new ConfigurationParameterDTO();
      parameterDTO.setName(parameterDTOE.getName());
      parameterDTO.setValue(parameterDTOE.getDefaultValue());
      configuration.addConfigurationParameterDTOs(parameterDTO);
    }
    String[] streamIDsToBeMapped=executionManagerAdminServiceClient.saveConfiguration(configuration);
    Assert.assertEquals(TO_STREAM_ID,streamIDsToBeMapped[0]);
    Assert.assertEquals(eventProcessorAdminServiceClient.getExecutionPlanConfigurationCount(),++executionPlanCount);
    Assert.assertEquals(eventStreamManagerAdminServiceClient.getEventStreamCount(),eventStreamCount);
    Assert.assertEquals(executionManagerAdminServiceClient.getConfigurationsCount(domainInfo.getName()),++configurationCount);
    StreamMappingDTO streamMappingDTO=new StreamMappingDTO();
    streamMappingDTO.setFromStream(DEVICE_STREAM_ID);
    streamMappingDTO.setToStream(TO_STREAM_ID);
    AttributeMappingDTO[] attributeMappingDTOs=new AttributeMappingDTO[TO_STREAM_ATTRIBUTE_COUNT];
    AttributeMappingDTO idAttributeMappingDTO=new AttributeMappingDTO();
    idAttributeMappingDTO.setFromAttribute("String_Node_Str");
    idAttributeMappingDTO.setToAttribute("String_Node_Str");
    idAttributeMappingDTO.setAttributeType("String_Node_Str");
    AttributeMappingDTO valueAttributeMappingDTO=new AttributeMappingDTO();
    valueAttributeMappingDTO.setFromAttribute("String_Node_Str");
    valueAttributeMappingDTO.setToAttribute("String_Node_Str");
    valueAttributeMappingDTO.setAttributeType("String_Node_Str");
    attributeMappingDTOs[0]=idAttributeMappingDTO;
    attributeMappingDTOs[1]=valueAttributeMappingDTO;
    streamMappingDTO.setAttributeMappingDTOs(attributeMappingDTOs);
    StreamMappingDTO[] streamMappingDTOs={streamMappingDTO};
    boolean streamMappingSaved=executionManagerAdminServiceClient.saveStreamMapping(streamMappingDTOs,configName,domainInfo.getName());
    Assert.assertEquals(streamMappingSaved,true);
    Assert.assertEquals(eventProcessorAdminServiceClient.getExecutionPlanConfigurationCount(),++executionPlanCount);
    log.info("String_Node_Str");
    configuration.setDescription("String_Node_Str");
    executionManagerAdminServiceClient.saveConfiguration(configuration);
    Assert.assertEquals(eventProcessorAdminServiceClient.getExecutionPlanConfigurationCount(),executionPlanCount);
    Assert.assertEquals(eventStreamManagerAdminServiceClient.getEventStreamCount(),eventStreamCount);
    Assert.assertEquals(executionManagerAdminServiceClient.getConfigurationsCount(domainInfo.getName()),configurationCount);
    log.info("String_Node_Str");
    executionManagerAdminServiceClient.deleteConfiguration(configuration.getDomain(),configuration.getName());
    executionPlanCount=executionPlanCount - 2;
    Assert.assertEquals(eventProcessorAdminServiceClient.getExecutionPlanConfigurationCount(),executionPlanCount);
    Assert.assertEquals(eventStreamManagerAdminServiceClient.getEventStreamCount(),eventStreamCount);
    Assert.assertEquals(executionManagerAdminServiceClient.getConfigurationsCount(domainInfo.getName()),--configurationCount);
  }
}