Program: 113071
Project: 113071
Buggy source:
@Test public void testExamplesIngest() throws IOException, SchemaException, URISyntaxException {
  BasicAccumuloOperations bao=null;
  try {
    bao=new BasicAccumuloOperations(zookeeper,accumuloInstance,accumuloUser,accumuloPassword,TEST_NAMESPACE);
  }
 catch (  final AccumuloException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
catch (  final AccumuloSecurityException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
  final AccumuloDataStore ds=new AccumuloDataStore(bao);
  final SimpleFeatureType sft=SimpleIngest.createPointFeatureType();
  final PrimaryIndex idx=SimpleIngest.createSpatialIndex();
  final FeatureDataAdapter fda=SimpleIngest.createDataAdapter(sft);
  final List<SimpleFeature> features=SimpleIngest.getGriddedFeatures(new SimpleFeatureBuilder(sft),8675309);
  LOGGER.info(String.format("String_Node_Str",features.size()));
  int ingestedFeatures=0;
  final int featuresPer5Percent=features.size() / 20;
  try (IndexWriter writer=ds.createIndexWriter(idx,DataStoreUtils.DEFAULT_VISIBILITY)){
    for (    final SimpleFeature feat : features) {
      writer.write(fda,feat);
      ingestedFeatures++;
      if ((ingestedFeatures % featuresPer5Percent) == 0) {
        LOGGER.info(String.format("String_Node_Str",(ingestedFeatures / featuresPer5Percent) * 5));
      }
    }
  }
   Assert.assertTrue(geoserverServiceClient.createWorkspace(WORKSPACE));
  Assert.assertTrue(geoserverServiceClient.publishDatastore(new AccumuloStoreFactoryFamily().getName(),getAccumuloConfig(),TEST_NAMESPACE,null,null,null,null,WORKSPACE));
  Assert.assertTrue(geoserverServiceClient.publishLayer(TEST_NAMESPACE,"String_Node_Str",SimpleIngest.FEATURE_NAME,WORKSPACE));
  final BufferedImage bi=getWMSSingleTile(-180,180,-90,90,"String_Node_Str","String_Node_Str",920,360,null);
  BufferedImage ref=null;
  final String geoserverVersion=(System.getProperty("String_Node_Str") != null) ? System.getProperty("String_Node_Str") : "String_Node_Str";
  Assert.assertNotNull(geoserverVersion);
  if (geoserverVersion.startsWith("String_Node_Str") || geoserverVersion.equals("String_Node_Str") || geoserverVersion.equals("String_Node_Str")) {
    ref=ImageIO.read(new File(REFERENCE_25_WMS_IMAGE_PATH));
  }
 else {
    ref=ImageIO.read(new File(REFERENCE_26_WMS_IMAGE_PATH));
  }
  Assert.assertNotNull(ref);
  Assert.assertEquals(ref.getWidth(),bi.getWidth());
  Assert.assertEquals(ref.getHeight(),bi.getHeight());
  for (int x=0; x < ref.getWidth(); x++) {
    for (int y=0; y < ref.getHeight(); y++) {
      if (!(bi.getRGB(x,y) == ref.getRGB(x,y))) {
        Assert.fail(String.format("String_Node_Str",x,y,ref.getRGB(x,y),bi.getRGB(x,y)));
      }
    }
  }
}

Fixed version (ground truth):
@Test public void testExamplesIngest() throws IOException, SchemaException, URISyntaxException {
  BasicAccumuloOperations bao=null;
  try {
    bao=new BasicAccumuloOperations(zookeeper,accumuloInstance,accumuloUser,accumuloPassword,TEST_NAMESPACE);
  }
 catch (  final AccumuloException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
catch (  final AccumuloSecurityException e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
  final AccumuloDataStore ds=new AccumuloDataStore(bao);
  final SimpleFeatureType sft=SimpleIngest.createPointFeatureType();
  final PrimaryIndex idx=SimpleIngest.createSpatialIndex();
  final FeatureDataAdapter fda=SimpleIngest.createDataAdapter(sft);
  final List<SimpleFeature> features=SimpleIngest.getGriddedFeatures(new SimpleFeatureBuilder(sft),8675309);
  LOGGER.info(String.format("String_Node_Str",features.size()));
  int ingestedFeatures=0;
  final int featuresPer5Percent=features.size() / 20;
  try (IndexWriter writer=ds.createIndexWriter(idx,DataStoreUtils.DEFAULT_VISIBILITY)){
    for (    final SimpleFeature feat : features) {
      writer.write(fda,feat);
      ingestedFeatures++;
      if ((ingestedFeatures % featuresPer5Percent) == 0) {
        LOGGER.info(String.format("String_Node_Str",(ingestedFeatures / featuresPer5Percent) * 5));
      }
    }
  }
   Assert.assertTrue("String_Node_Str",geoserverServiceClient.createWorkspace(WORKSPACE));
  Assert.assertTrue("String_Node_Str",geoserverServiceClient.publishDatastore(new AccumuloStoreFactoryFamily().getName(),getAccumuloConfig(),TEST_NAMESPACE,null,null,null,null,WORKSPACE));
  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_SLD_MINOR_SUBSAMPLE_FILE + "String_Node_Str",geoserverServiceClient.publishStyle(new File[]{new File(TEST_SLD_MINOR_SUBSAMPLE_FILE)}));
  assertTrue("String_Node_Str" + TEST_SLD_MAJOR_SUBSAMPLE_FILE + "String_Node_Str",geoserverServiceClient.publishStyle(new File[]{new File(TEST_SLD_MAJOR_SUBSAMPLE_FILE)}));
  Assert.assertTrue("String_Node_Str" + SimpleIngest.FEATURE_NAME + "String_Node_Str",geoserverServiceClient.publishLayer(TEST_NAMESPACE,"String_Node_Str",SimpleIngest.FEATURE_NAME,WORKSPACE));
  final BufferedImage biDirectRender=getWMSSingleTile(-180,180,-90,90,SimpleIngest.FEATURE_NAME,"String_Node_Str",920,360,null);
  BufferedImage ref=null;
  final String geoserverVersion=(System.getProperty("String_Node_Str") != null) ? System.getProperty("String_Node_Str") : "String_Node_Str";
  Assert.assertNotNull(geoserverVersion);
  if (geoserverVersion.startsWith("String_Node_Str") || geoserverVersion.equals("String_Node_Str") || geoserverVersion.equals("String_Node_Str")) {
    ref=ImageIO.read(new File(REFERENCE_25_WMS_IMAGE_PATH));
  }
 else {
    ref=ImageIO.read(new File(REFERENCE_26_WMS_IMAGE_PATH));
  }
  testTileAgainstReference(biDirectRender,ref,0,0);
  final BufferedImage biSubsamplingWithoutError=getWMSSingleTile(-180,180,-90,90,SimpleIngest.FEATURE_NAME,TEST_STYLE_NAME_NO_DIFFERENCE,920,360,null);
  Assert.assertNotNull(ref);
  testTileAgainstReference(biSubsamplingWithoutError,ref,0,0);
  final BufferedImage biSubsamplingWithExpectedError=getWMSSingleTile(-180,180,-90,90,SimpleIngest.FEATURE_NAME,TEST_STYLE_NAME_MINOR_SUBSAMPLE,920,360,null);
  testTileAgainstReference(biSubsamplingWithExpectedError,ref,0.05,0.1);
  final BufferedImage biSubsamplingWithLotsOfError=getWMSSingleTile(-180,180,-90,90,SimpleIngest.FEATURE_NAME,TEST_STYLE_NAME_MAJOR_SUBSAMPLE,920,360,null);
  testTileAgainstReference(biSubsamplingWithLotsOfError,ref,0.3,0.35);
  assertTrue("String_Node_Str" + SimpleIngest.FEATURE_NAME + "String_Node_Str",geoserverServiceClient.deleteLayer(SimpleIngest.FEATURE_NAME));
  assertTrue("String_Node_Str" + TEST_NAMESPACE + "String_Node_Str",geoserverServiceClient.deleteDatastore(TEST_NAMESPACE,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" + TEST_STYLE_NAME_MAJOR_SUBSAMPLE + "String_Node_Str",geoserverServiceClient.deleteStyle(TEST_STYLE_NAME_MAJOR_SUBSAMPLE));
}