Program: 61243
Project: 61243
Buggy source:
/** 
 * Story: User can produce final point clustering using a Hadoop map/reduce job and a EuclideanDistanceMeasure.
 */
@Test public void testCanopyEuclideanMRJob() throws Exception {
  Path input=getTestTempDirPath("String_Node_Str");
  Configuration conf=new Configuration();
  FileSystem fs=FileSystem.get(input.toUri(),conf);
  Collection<VectorWritable> points=new ArrayList<VectorWritable>();
  for (  Vector v : raw) {
    points.add(new VectorWritable(v));
  }
  ClusteringTestUtils.writePointsToFile(points,getTestTempFilePath("String_Node_Str"),fs,conf);
  ClusteringTestUtils.writePointsToFile(points,getTestTempFilePath("String_Node_Str"),fs,conf);
  Path output=getTestTempDirPath("String_Node_Str");
  String[] args={optKey(DefaultOptionCreator.INPUT_OPTION),getTestTempDirPath("String_Node_Str").toString(),optKey(DefaultOptionCreator.OUTPUT_OPTION),output.toString(),optKey(DefaultOptionCreator.DISTANCE_MEASURE_OPTION),EuclideanDistanceMeasure.class.getName(),optKey(DefaultOptionCreator.T1_OPTION),"String_Node_Str",optKey(DefaultOptionCreator.T2_OPTION),"String_Node_Str",optKey(DefaultOptionCreator.CLUSTERING_OPTION),optKey(DefaultOptionCreator.MAX_ITERATIONS_OPTION),"String_Node_Str",optKey(DefaultOptionCreator.CONVERGENCE_DELTA_OPTION),"String_Node_Str",optKey(DefaultOptionCreator.OVERWRITE_OPTION)};
  new MeanShiftCanopyDriver().run(args);
  Path outPart=new Path(output,"String_Node_Str");
  SequenceFile.Reader reader=new SequenceFile.Reader(fs,outPart,conf);
  Writable key=new Text();
  Writable value=new MeanShiftCanopy();
  int count=0;
  while (reader.next(key,value)) {
    count++;
  }
  reader.close();
  assertEquals("String_Node_Str",3,count);
}

Fixed version (ground truth):
/** 
 * Story: User can produce final point clustering using a Hadoop map/reduce job and a EuclideanDistanceMeasure.
 */
@Test public void testCanopyEuclideanMRJob() throws Exception {
  Path input=getTestTempDirPath("String_Node_Str");
  Configuration conf=new Configuration();
  FileSystem fs=FileSystem.get(input.toUri(),conf);
  Collection<VectorWritable> points=new ArrayList<VectorWritable>();
  for (  Vector v : raw) {
    points.add(new VectorWritable(v));
  }
  ClusteringTestUtils.writePointsToFile(points,getTestTempFilePath("String_Node_Str"),fs,conf);
  ClusteringTestUtils.writePointsToFile(points,getTestTempFilePath("String_Node_Str"),fs,conf);
  Path output=getTestTempDirPath("String_Node_Str");
  String[] args={optKey(DefaultOptionCreator.INPUT_OPTION),getTestTempDirPath("String_Node_Str").toString(),optKey(DefaultOptionCreator.OUTPUT_OPTION),output.toString(),optKey(DefaultOptionCreator.DISTANCE_MEASURE_OPTION),EuclideanDistanceMeasure.class.getName(),optKey(DefaultOptionCreator.T1_OPTION),"String_Node_Str",optKey(DefaultOptionCreator.T2_OPTION),"String_Node_Str",optKey(DefaultOptionCreator.CLUSTERING_OPTION),optKey(DefaultOptionCreator.MAX_ITERATIONS_OPTION),"String_Node_Str",optKey(DefaultOptionCreator.CONVERGENCE_DELTA_OPTION),"String_Node_Str",optKey(DefaultOptionCreator.OVERWRITE_OPTION)};
  ToolRunner.run(conf,new MeanShiftCanopyDriver(),args);
  Path outPart=new Path(output,"String_Node_Str");
  SequenceFile.Reader reader=new SequenceFile.Reader(fs,outPart,conf);
  Writable key=new Text();
  Writable value=new MeanShiftCanopy();
  int count=0;
  while (reader.next(key,value)) {
    count++;
  }
  reader.close();
  assertEquals("String_Node_Str",3,count);
}