Examples of initialise()


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

  public void initialise() throws IOException{
    FindOptions options = new FindOptions();
    Depth depth = new Depth();
   
    assertFalse(options.isDepth());
    depth.initialise(options);
    assertTrue(options.isDepth());
  }

  @Test
  public void apply() throws IOException{
View Full Code Here

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

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

  @Test
  public void testFsShellCommand() throws IOException {
    factory.registerCommands(FsCommand.class);
    Exec exec = new Exec();
    exec.addArguments(getArgs("-ls {} ;"));
    exec.initialise(options);
    Command cmd = exec.getCommand();
    assertEquals("org.apache.hadoop.fs.shell.Ls", cmd.getClass().getName());
  }
 
  @Test
View Full Code Here

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

    Mtime mtime = new Mtime();
    addArgument(mtime, "5");
   
    FindOptions options = new FindOptions();
    options.setStartTime(NOW);
    mtime.initialise(options);
   
    assertEquals(Result.FAIL, mtime.apply(fourDays));
    assertEquals(Result.FAIL, mtime.apply(fiveDaysMinus));
    assertEquals(Result.PASS, mtime.apply(fiveDays));
    assertEquals(Result.PASS, mtime.apply(fiveDaysPlus));
View Full Code Here

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

    Deque<Expression> children = new LinkedList<Expression>();
    children.add(child);
    not.addChildren(children);
   
    FindOptions options = mock(FindOptions.class);
    not.initialise(options);
    verify(child).initialise(options);
    verifyNoMoreInteractions(child);
  }
}
View Full Code Here

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

  @Test
  public void applyNumberEquals() throws IOException {
    NumberExpression numberExpr = new NumberExpression(){};
    addArgument(numberExpr, "5");
    numberExpr.initialise(new FindOptions());
    assertEquals(Result.PASS, numberExpr.applyNumber(5));
    assertEquals(Result.FAIL, numberExpr.applyNumber(4));
    assertEquals(Result.FAIL, numberExpr.applyNumber(6));
  }
View Full Code Here

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

    children.add(second);
    children.add(first);
    or.addChildren(children);
   
    FindOptions options = mock(FindOptions.class);
    or.initialise(options);
    verify(first).initialise(options);
    verify(second).initialise(options);
    verifyNoMoreInteractions(first);
    verifyNoMoreInteractions(second);
  }
View Full Code Here

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

  @Test
  public void applyOctalExact() throws IOException {
    Perm perm = new Perm();
    addArgument(perm, "123");
    perm.initialise(new FindOptions());

    assertEquals(Result.FAIL, perm.apply(rwxrwxrwx));
    assertEquals(Result.FAIL, perm.apply(rwx______));
    assertEquals(Result.FAIL, perm.apply(r__r__r__));
    assertEquals(Result.FAIL, perm.apply(rwxr_____));
View Full Code Here

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

  public void testPrint() throws IOException{
    Print print = new Print();
    PrintStream out = mock(PrintStream.class);
    FindOptions options = new FindOptions();
    options.setOut(out);
    print.initialise(options);
   
    String filename = "/one/two/test";
    PathData item = new PathData(filename, conf);
    assertEquals(Result.PASS, print.apply(item));
    verify(out).println(filename);
View Full Code Here

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

  @Test
  public void applyDepth() throws IOException {
    Prune prune = new Prune();
    FindOptions options = new FindOptions();
    options.setDepth(true);
    prune.initialise(options);
    PathData item = mock(PathData.class);
    assertEquals(Result.PASS, prune.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.