Program: 113003
Project: 113003
Buggy source:
@Test public void testServices() throws IOException, SchemaException {
  geoserverServiceClient=new GeoserverServiceClient(GEOWAVE_BASE_URL);
  infoServiceClient=new InfoServiceClient(GEOWAVE_BASE_URL);
  ingestServiceClient=new IngestServiceClient(GEOWAVE_BASE_URL);
  boolean success=false;
  LOGGER.info("String_Node_Str");
  success=ingestServiceClient.localIngest(new File[]{new File(ASHLAND_GPX_FILE)},dataStoreOptions.getType(),TestUtils.TEST_NAMESPACE,null,ASHLAND_INGEST_TYPE,null,false);
  assertTrue("String_Node_Str" + ASHLAND_GPX_FILE + "String_Node_Str",success);
  success=false;
  TestUtils.deleteAll(dataStoreOptions);
  LOGGER.info("String_Node_Str");
  success=ingestServiceClient.hdfsIngest(new File[]{new File(ASHLAND_GPX_FILE)},dataStoreOptions.getType(),TestUtils.TEST_NAMESPACE,null,ASHLAND_INGEST_TYPE,null,false);
  assertTrue("String_Node_Str" + ASHLAND_GPX_FILE + "String_Node_Str",success);
  success=false;
  LOGGER.info("String_Node_Str");
  final JSONArray adapters=infoServiceClient.getAdapters(dataStoreOptions.getType()).getJSONArray("String_Node_Str");
  for (int i=0; i < adapters.size(); i++) {
    if (adapters.getJSONObject(i).getString("String_Node_Str").equals(GpxUtils.GPX_WAYPOINT_FEATURE)) {
      success=true;
      break;
    }
  }
  assertTrue("String_Node_Str" + GpxUtils.GPX_WAYPOINT_FEATURE + "String_Node_Str",success);
  success=false;
  LOGGER.info("String_Node_Str");
  final JSONArray indices=infoServiceClient.getIndices(dataStoreOptions.getType()).getJSONArray("String_Node_Str");
  final String expectedIndex=new SpatialDimensionalityTypeProvider().getDimensionalityTypeName();
  for (int i=0; i < indices.size(); i++) {
    if (indices.getJSONObject(i).getString("String_Node_Str").equals(expectedIndex)) {
      success=true;
      break;
    }
  }
  assertTrue("String_Node_Str" + expectedIndex + "String_Node_Str",success);
  success=false;
  LOGGER.info("String_Node_Str");
  assertTrue("String_Node_Str" + TEST_WORKSPACE + "String_Node_Str",geoserverServiceClient.createWorkspace(TEST_WORKSPACE));
  LOGGER.info("String_Node_Str");
  final JSONArray workspaces=geoserverServiceClient.getWorkspaces().getJSONArray("String_Node_Str");
  for (int i=0; i < workspaces.size(); i++) {
    if (workspaces.getJSONObject(i).getString("String_Node_Str").equals(TEST_WORKSPACE)) {
      success=true;
      break;
    }
  }
  assertTrue("String_Node_Str" + TEST_WORKSPACE + "String_Node_Str",success);
  success=false;
  LOGGER.info("String_Node_Str");
  assertTrue("String_Node_Str" + TEST_STYLE_NAME_NO_DIFFERENCE + "String_Node_Str",geoserverServiceClient.publishStyle(new File[]{new File(TEST_SLD_NO_DIFFERENCE_FILE)}));
  assertTrue("String_Node_Str" + TEST_STYLE_NAME_MINOR_SUBSAMPLE + "String_Node_Str",geoserverServiceClient.publishStyle(new File[]{new File(TEST_SLD_MINOR_SUBSAMPLE_FILE)}));
  LOGGER.info("String_Node_Str");
  final JSONArray styles=geoserverServiceClient.getStyles().getJSONArray("String_Node_Str");
  for (int i=0; i < styles.size(); i++) {
    if (styles.getJSONObject(i).getString("String_Node_Str").equals(TEST_STYLE_NAME_NO_DIFFERENCE)) {
      success=true;
      break;
    }
  }
  assertTrue("String_Node_Str" + TEST_STYLE_NAME_NO_DIFFERENCE + "String_Node_Str",success);
  success=false;
  for (int i=0; i < styles.size(); i++) {
    if (styles.getJSONObject(i).getString("String_Node_Str").equals(TEST_STYLE_NAME_MINOR_SUBSAMPLE)) {
      success=true;
      break;
    }
  }
  assertTrue("String_Node_Str" + TEST_STYLE_NAME_MINOR_SUBSAMPLE + "String_Node_Str",success);
  success=false;
  LOGGER.info("String_Node_Str");
  final String style=IOUtils.toString(geoserverServiceClient.getStyle(TEST_SLD_NO_DIFFERENCE_FILE));
  assertTrue("String_Node_Str" + TEST_STYLE_NAME_NO_DIFFERENCE + "String_Node_Str",(style != null) && !style.isEmpty());
  LOGGER.info("String_Node_Str");
  assertTrue("String_Node_Str",geoserverServiceClient.publishDatastore(dataStoreOptions.getType(),dataStoreOptions.getFactoryOptionsAsMap(),TestUtils.TEST_NAMESPACE,null,null,null,null,TEST_WORKSPACE));
  LOGGER.info("String_Node_Str");
  final JSONArray datastores=geoserverServiceClient.getDatastores(TEST_WORKSPACE).getJSONArray("String_Node_Str");
  JSONObject dsInfo=null;
  for (int i=0; i < datastores.size(); i++) {
    if (datastores.getJSONObject(i).getString("String_Node_Str").equals(TestUtils.TEST_NAMESPACE)) {
      dsInfo=datastores.getJSONObject(i);
      success=true;
      break;
    }
  }
  assertTrue("String_Node_Str",success);
  success=false;
  if (dsInfo != null) {
    final Map<String,String> options=dataStoreOptions.getFactoryOptionsAsMap();
    for (    final Entry<String,String> entry : options.entrySet()) {
      assertTrue("String_Node_Str" + entry.getKey() + "String_Node_Str",dsInfo.getString(entry.getKey()).equals(entry.getValue()));
    }
  }
  LOGGER.info("String_Node_Str");
  final JSONObject datastore=geoserverServiceClient.getDatastore(TestUtils.TEST_NAMESPACE,TEST_WORKSPACE);
  assertTrue("String_Node_Str",datastore.getJSONObject("String_Node_Str").getString("String_Node_Str").equals(TestUtils.TEST_NAMESPACE));
  LOGGER.info("String_Node_Str");
  assertTrue("String_Node_Str" + GpxUtils.GPX_WAYPOINT_FEATURE + "String_Node_Str",geoserverServiceClient.publishLayer(TestUtils.TEST_NAMESPACE,TEST_STYLE_NAME_NO_DIFFERENCE,GpxUtils.GPX_WAYPOINT_FEATURE,TEST_WORKSPACE));
  LOGGER.info("String_Node_Str");
  final JSONArray layers=geoserverServiceClient.getLayers().getJSONArray("String_Node_Str").getJSONObject(0).getJSONArray("String_Node_Str");
  for (int i=0; i < layers.size(); i++) {
    if (layers.getJSONObject(i).getString("String_Node_Str").equals(GpxUtils.GPX_WAYPOINT_FEATURE)) {
      success=true;
      break;
    }
  }
  assertTrue("String_Node_Str" + GpxUtils.GPX_WAYPOINT_FEATURE + "String_Node_Str",success);
  success=false;
  LOGGER.info("String_Node_Str");
  final JSONObject layer=geoserverServiceClient.getLayer(GpxUtils.GPX_WAYPOINT_FEATURE);
  assertTrue("String_Node_Str",layer.getJSONObject("String_Node_Str").getString("String_Node_Str").equals(GpxUtils.GPX_WAYPOINT_FEATURE));
  LOGGER.info("String_Node_Str");
  assertTrue("String_Node_Str" + GpxUtils.GPX_WAYPOINT_FEATURE + "String_Node_Str",geoserverServiceClient.deleteLayer(GpxUtils.GPX_WAYPOINT_FEATURE));
  assertTrue("String_Node_Str",geoserverServiceClient.deleteDatastore(TestUtils.TEST_NAMESPACE,TEST_WORKSPACE));
  assertTrue("String_Node_Str" + TEST_STYLE_NAME_NO_DIFFERENCE + "String_Node_Str",geoserverServiceClient.deleteStyle(TEST_STYLE_NAME_NO_DIFFERENCE));
  assertTrue("String_Node_Str" + TEST_STYLE_NAME_MINOR_SUBSAMPLE + "String_Node_Str",geoserverServiceClient.deleteStyle(TEST_STYLE_NAME_MINOR_SUBSAMPLE));
  assertTrue("String_Node_Str",geoserverServiceClient.deleteWorkspace(TEST_WORKSPACE));
}

Fixed version (ground truth):
@Test public void testServices() throws IOException, SchemaException {
  geoserverServiceClient=new GeoserverServiceClient(ServicesTestEnvironment.GEOWAVE_BASE_URL);
  infoServiceClient=new InfoServiceClient(ServicesTestEnvironment.GEOWAVE_BASE_URL);
  ingestServiceClient=new IngestServiceClient(ServicesTestEnvironment.GEOWAVE_BASE_URL);
  boolean success=false;
  LOGGER.info("String_Node_Str");
  success=ingestServiceClient.localIngest(new File[]{new File(ASHLAND_GPX_FILE)},dataStoreOptions.getType(),TestUtils.TEST_NAMESPACE,null,ASHLAND_INGEST_TYPE,null,false);
  assertTrue("String_Node_Str" + ASHLAND_GPX_FILE + "String_Node_Str",success);
  success=false;
  TestUtils.deleteAll(dataStoreOptions);
  LOGGER.info("String_Node_Str");
  success=ingestServiceClient.hdfsIngest(new File[]{new File(ASHLAND_GPX_FILE)},dataStoreOptions.getType(),TestUtils.TEST_NAMESPACE,null,ASHLAND_INGEST_TYPE,null,false);
  assertTrue("String_Node_Str" + ASHLAND_GPX_FILE + "String_Node_Str",success);
  success=false;
  LOGGER.info("String_Node_Str");
  final JSONArray adapters=infoServiceClient.getAdapters(dataStoreOptions.getType()).getJSONArray("String_Node_Str");
  for (int i=0; i < adapters.size(); i++) {
    if (adapters.getJSONObject(i).getString("String_Node_Str").equals(GpxUtils.GPX_WAYPOINT_FEATURE)) {
      success=true;
      break;
    }
  }
  assertTrue("String_Node_Str" + GpxUtils.GPX_WAYPOINT_FEATURE + "String_Node_Str",success);
  success=false;
  LOGGER.info("String_Node_Str");
  final JSONArray indices=infoServiceClient.getIndices(dataStoreOptions.getType()).getJSONArray("String_Node_Str");
  final String expectedIndex=new SpatialDimensionalityTypeProvider().getDimensionalityTypeName();
  for (int i=0; i < indices.size(); i++) {
    if (indices.getJSONObject(i).getString("String_Node_Str").equals(expectedIndex)) {
      success=true;
      break;
    }
  }
  assertTrue("String_Node_Str" + expectedIndex + "String_Node_Str",success);
  success=false;
  LOGGER.info("String_Node_Str");
  assertTrue("String_Node_Str" + ServicesTestEnvironment.TEST_WORKSPACE + "String_Node_Str",geoserverServiceClient.createWorkspace(ServicesTestEnvironment.TEST_WORKSPACE));
  LOGGER.info("String_Node_Str");
  final JSONArray workspaces=geoserverServiceClient.getWorkspaces().getJSONArray("String_Node_Str");
  for (int i=0; i < workspaces.size(); i++) {
    if (workspaces.getJSONObject(i).getString("String_Node_Str").equals(ServicesTestEnvironment.TEST_WORKSPACE)) {
      success=true;
      break;
    }
  }
  assertTrue("String_Node_Str" + ServicesTestEnvironment.TEST_WORKSPACE + "String_Node_Str",success);
  success=false;
  LOGGER.info("String_Node_Str");
  assertTrue("String_Node_Str" + ServicesTestEnvironment.TEST_STYLE_NAME_NO_DIFFERENCE + "String_Node_Str",geoserverServiceClient.publishStyle(new File[]{new File(ServicesTestEnvironment.TEST_SLD_NO_DIFFERENCE_FILE)}));
  assertTrue("String_Node_Str" + ServicesTestEnvironment.TEST_STYLE_NAME_MINOR_SUBSAMPLE + "String_Node_Str",geoserverServiceClient.publishStyle(new File[]{new File(ServicesTestEnvironment.TEST_SLD_MINOR_SUBSAMPLE_FILE)}));
  LOGGER.info("String_Node_Str");
  final JSONArray styles=geoserverServiceClient.getStyles().getJSONArray("String_Node_Str");
  for (int i=0; i < styles.size(); i++) {
    if (styles.getJSONObject(i).getString("String_Node_Str").equals(ServicesTestEnvironment.TEST_STYLE_NAME_NO_DIFFERENCE)) {
      success=true;
      break;
    }
  }
  assertTrue("String_Node_Str" + ServicesTestEnvironment.TEST_STYLE_NAME_NO_DIFFERENCE + "String_Node_Str",success);
  success=false;
  for (int i=0; i < styles.size(); i++) {
    if (styles.getJSONObject(i).getString("String_Node_Str").equals(ServicesTestEnvironment.TEST_STYLE_NAME_MINOR_SUBSAMPLE)) {
      success=true;
      break;
    }
  }
  assertTrue("String_Node_Str" + ServicesTestEnvironment.TEST_STYLE_NAME_MINOR_SUBSAMPLE + "String_Node_Str",success);
  success=false;
  LOGGER.info("String_Node_Str");
  final String style=IOUtils.toString(geoserverServiceClient.getStyle(ServicesTestEnvironment.TEST_SLD_NO_DIFFERENCE_FILE));
  assertTrue("String_Node_Str" + ServicesTestEnvironment.TEST_STYLE_NAME_NO_DIFFERENCE + "String_Node_Str",(style != null) && !style.isEmpty());
  LOGGER.info("String_Node_Str");
  assertTrue("String_Node_Str",geoserverServiceClient.publishDatastore(dataStoreOptions.getType(),dataStoreOptions.getFactoryOptionsAsMap(),TestUtils.TEST_NAMESPACE,null,null,null,null,ServicesTestEnvironment.TEST_WORKSPACE));
  LOGGER.info("String_Node_Str");
  final JSONArray datastores=geoserverServiceClient.getDatastores(ServicesTestEnvironment.TEST_WORKSPACE).getJSONArray("String_Node_Str");
  JSONObject dsInfo=null;
  for (int i=0; i < datastores.size(); i++) {
    if (datastores.getJSONObject(i).getString("String_Node_Str").equals(TestUtils.TEST_NAMESPACE)) {
      dsInfo=datastores.getJSONObject(i);
      success=true;
      break;
    }
  }
  assertTrue("String_Node_Str",success);
  success=false;
  if (dsInfo != null) {
    final Map<String,String> options=dataStoreOptions.getFactoryOptionsAsMap();
    List<ConfigOption> configOptions=Arrays.asList(ConfigUtils.createConfigOptionsFromJCommander(dataStoreOptions));
    Collection<String> nonPasswordRequiredFields=Collections2.transform(Collections2.filter(configOptions,new Predicate<ConfigOption>(){
      @Override public boolean apply(      ConfigOption input){
        return !input.isPassword() && !input.isOptional();
      }
    }
),new Function<ConfigOption,String>(){
      @Override public String apply(      ConfigOption input){
        return input.getName();
      }
    }
);
    for (    final Entry<String,String> entry : options.entrySet()) {
      if (nonPasswordRequiredFields.contains(entry.getKey())) {
        assertTrue("String_Node_Str" + entry.getKey() + "String_Node_Str",dsInfo.getString(entry.getKey()).equals(entry.getValue()));
      }
    }
  }
  LOGGER.info("String_Node_Str");
  final JSONObject datastore=geoserverServiceClient.getDatastore(TestUtils.TEST_NAMESPACE,ServicesTestEnvironment.TEST_WORKSPACE);
  assertTrue("String_Node_Str",datastore.getJSONObject("String_Node_Str").getString("String_Node_Str").equals(TestUtils.TEST_NAMESPACE));
  LOGGER.info("String_Node_Str");
  assertTrue("String_Node_Str" + GpxUtils.GPX_WAYPOINT_FEATURE + "String_Node_Str",geoserverServiceClient.publishLayer(TestUtils.TEST_NAMESPACE,ServicesTestEnvironment.TEST_STYLE_NAME_NO_DIFFERENCE,GpxUtils.GPX_WAYPOINT_FEATURE,ServicesTestEnvironment.TEST_WORKSPACE));
  LOGGER.info("String_Node_Str");
  final JSONArray layers=geoserverServiceClient.getLayers().getJSONArray("String_Node_Str").getJSONObject(0).getJSONArray("String_Node_Str");
  for (int i=0; i < layers.size(); i++) {
    if (layers.getJSONObject(i).getString("String_Node_Str").equals(GpxUtils.GPX_WAYPOINT_FEATURE)) {
      success=true;
      break;
    }
  }
  assertTrue("String_Node_Str" + GpxUtils.GPX_WAYPOINT_FEATURE + "String_Node_Str",success);
  success=false;
  LOGGER.info("String_Node_Str");
  final JSONObject layer=geoserverServiceClient.getLayer(GpxUtils.GPX_WAYPOINT_FEATURE);
  assertTrue("String_Node_Str",layer.getJSONObject("String_Node_Str").getString("String_Node_Str").equals(GpxUtils.GPX_WAYPOINT_FEATURE));
  LOGGER.info("String_Node_Str");
  assertTrue("String_Node_Str" + GpxUtils.GPX_WAYPOINT_FEATURE + "String_Node_Str",geoserverServiceClient.deleteLayer(GpxUtils.GPX_WAYPOINT_FEATURE));
  assertTrue("String_Node_Str",geoserverServiceClient.deleteDatastore(TestUtils.TEST_NAMESPACE,ServicesTestEnvironment.TEST_WORKSPACE));
  assertTrue("String_Node_Str" + ServicesTestEnvironment.TEST_STYLE_NAME_NO_DIFFERENCE + "String_Node_Str",geoserverServiceClient.deleteStyle(ServicesTestEnvironment.TEST_STYLE_NAME_NO_DIFFERENCE));
  assertTrue("String_Node_Str" + ServicesTestEnvironment.TEST_STYLE_NAME_MINOR_SUBSAMPLE + "String_Node_Str",geoserverServiceClient.deleteStyle(ServicesTestEnvironment.TEST_STYLE_NAME_MINOR_SUBSAMPLE));
  assertTrue("String_Node_Str",geoserverServiceClient.deleteWorkspace(ServicesTestEnvironment.TEST_WORKSPACE));
}