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

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


  @Test
  public void testIsDirectory() throws IOException{
    Type type = new Type();
    addArgument(type, "d");
    type.initialise(new FindOptions());
   
    when(mockFstat.isDirectory()).thenReturn(true);
    PathData item = new PathData("/one/two/test", conf);

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


  @Test
  public void testIsNotDirectory() throws IOException{
    Type type = new Type();
    addArgument(type, "d");
    type.initialise(new FindOptions());
   
    when(mockFstat.isDirectory()).thenReturn(false);
    PathData item = new PathData("/one/two/test", conf);

    assertEquals(Result.FAIL, type.apply(item));
View Full Code Here

  @Test
  public void testIsSymlink() throws IOException{
    Type type = new Type();
    addArgument(type, "l");
    type.initialise(new FindOptions());
   
    when(mockFstat.isSymlink()).thenReturn(true);
    PathData item = new PathData("/one/two/test", conf);

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

  @Test
  public void testIsNotSymlink() throws IOException{
    Type type = new Type();
    addArgument(type, "l");
    type.initialise(new FindOptions());
   
    when(mockFstat.isSymlink()).thenReturn(false);
    PathData item = new PathData("/one/two/test", conf);

    assertEquals(Result.FAIL, type.apply(item));
View Full Code Here

  @Test
  public void testIsFile() throws IOException{
    Type type = new Type();
    addArgument(type, "f");
    type.initialise(new FindOptions());
   
    when(mockFstat.isFile()).thenReturn(true);
    PathData item = new PathData("/one/two/test", conf);

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

  @Test
  public void testIsNotFile() throws IOException{
    Type type = new Type();
    addArgument(type, "f");
    type.initialise(new FindOptions());
   
    when(mockFstat.isFile()).thenReturn(false);
    PathData item = new PathData("/one/two/test", conf);

    assertEquals(Result.FAIL, type.apply(item));
View Full Code Here

  @Test
  public void testInvalidType() throws IOException {
    Type type = new Type();
    addArgument(type, "a");
    try {
      type.initialise(new FindOptions());
      fail("Invalid file type not caught");
    }
    catch (IOException e) {}
  }
}
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.