  @Test
  public void testPopulateTrashPaths() throws Exception {

    FileStatus[] status = new FileStatus[10];
    String[] expectedstatus = new String[10];
    
    status[0] = new FileStatus(20, false, 3, 23823, 2438232, new Path(
        "/databus/data/test1/testcluster1/test1-2012-08-29-07-09_00000"));
    status[1] = new FileStatus(20, false, 3, 23823, 2438232, new Path(
        "/databus/data/test1/testcluster1/test1-2012-08-29-07-04_00000"));
    status[2] = new FileStatus(20, false, 3, 23823, 2438232, new Path(
        "/databus/data/test2/testcluster1/test2-2012-08-29-07-09_00003"));
    status[3] = new FileStatus(20, false, 3, 23823, 2438232, new Path(
        "/databus/data/test1/testcluster2/test1-2012-08-13-07-09_00000"));
    status[4] = new FileStatus(20, false, 3, 23823, 2438232, new Path(
        "/databus/data/test1/testcluster1/test1-2012-08-29-07-09_00009"));
    status[5] = new FileStatus(20, false, 3, 23823, 2438232, new Path(
        "/databus/data/test1/testcluster1/test1-2012-08-29-07-12_00000"));
    status[6] = new FileStatus(20, false, 3, 23823, 2438232, new Path(
        "/databus/data/test1/testcluster1/test1-2012-08-29-07-10_00000"));
    status[7] = new FileStatus(20, false, 3, 23823, 2438232, new Path(
        "/databus/data/test2/testcluster1/test2-2012-08-29-07-45_00000"));
    status[8] = new FileStatus(20, false, 3, 23823, 2438232, new Path(
        "/databus/data/test1/testcluster2/test1-2012-08-29-07-09_00078"));
    status[9] = new FileStatus(20, false, 3, 23823, 2438232, new Path(
        "/databus/data/test1/testcluster2/test1-2012-08-29-07-04_00034"));
    
    expectedstatus[0] = "/databus/data/test1/testcluster1/test1-2012-08-29-07-04_00000";
    expectedstatus[1] = "/databus/data/test1/testcluster1/test1-2012-08-29-07-09_00000";
    expectedstatus[2] = "/databus/data/test1/testcluster1/test1-2012-08-29-07-09_00009";
    expectedstatus[3] = "/databus/data/test1/testcluster1/test1-2012-08-29-07-10_00000";
    expectedstatus[4] = "/databus/data/test1/testcluster1/test1-2012-08-29-07-12_00000";
    
    expectedstatus[5] = "/databus/data/test1/testcluster2/test1-2012-08-13-07-09_00000";
    expectedstatus[6] = "/databus/data/test1/testcluster2/test1-2012-08-29-07-04_00034";
    expectedstatus[7] = "/databus/data/test1/testcluster2/test1-2012-08-29-07-09_00078";
    
    
    expectedstatus[8] = "/databus/data/test2/testcluster1/test2-2012-08-29-07-09_00003";
    expectedstatus[9] = "/databus/data/test2/testcluster1/test2-2012-08-29-07-45_00000";

    Set<FileStatus> trashSet = new HashSet<FileStatus>();
    for (int i = 0; i < 10; ++i) {
      trashSet.add(status[i]);
    }
    
    Cluster cluster = ClusterTest.buildLocalCluster();
    TestLocalStreamService service = new TestLocalStreamService(
        buildTestDatabusConfig(), cluster, new FSCheckpointProvider(
            cluster.getCheckpointDir()));
    
    Map<Path, Path> trashCommitPaths = service
        .populateTrashCommitPaths(trashSet);

    Set<Path> srcPaths = trashCommitPaths.keySet();
    
    Iterator<Path> it = srcPaths.iterator();
    int i = 0;
    
    while (it.hasNext()) {
      String actualPath = it.next().toString();
      String expectedPath = expectedstatus[i];
      
      LOG.debug("Comparing Trash Paths Actual [" + actualPath + "] Expected ["
          + expectedPath + "]");
      Assert.assertEquals(actualPath, expectedPath);
      
      i++;
    }
  }