Package org.apache.hadoop.fs.shell.find

Examples of org.apache.hadoop.fs.shell.find.Empty.initialise()


    when(fileStatus.getLen()).thenReturn(0l);
    fs.setFileStatus("emptyFile", fileStatus);
    PathData item = new PathData("emptyFile", fs.getConf());
   
    Empty empty = new Empty();
    empty.initialise(new FindOptions());

    assertEquals(Result.PASS, empty.apply(item));
  }
 
  @Test
View Full Code Here


    when(fileStatus.getLen()).thenReturn(1l);
    fs.setFileStatus("notEmptyFile", fileStatus);
    PathData item = new PathData("notEmptyFile", fs.getConf());
   
    Empty empty = new Empty();
    empty.initialise(new FindOptions());

    assertEquals(Result.FAIL, empty.apply(item));
  }

  @Test
View Full Code Here

    fs.setFileStatus("emptyDirectory", fileStatus);
    fs.setListStatus("emptyDirectory", new FileStatus[0]);
    PathData item = new PathData("emptyDirectory", fs.getConf());
   
    Empty empty = new Empty();
    empty.initialise(new FindOptions());

    assertEquals(Result.PASS, empty.apply(item));
  }

  @Test
View Full Code Here

    fs.setFileStatus("notEmptyDirectory", fileStatus);
    fs.setListStatus("notEmptyDirectory", new FileStatus[] {mock(FileStatus.class)});
    PathData item = new PathData("notEmptyDirectory", fs.getConf());
   
    Empty empty = new Empty();
    empty.initialise(new FindOptions());

    assertEquals(Result.PASS, empty.apply(item));
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.