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

Examples of org.apache.hadoop.fs.shell.find.FindOptions


  @Test
  public void applyLessThanBytes() throws IOException {
    Size size = new Size();
    addArgument(size, "-" + (5 * 512) + "c");
    size.initialise(new FindOptions());

    assertEquals(Result.FAIL, size.apply(fiveBlocks));
    assertEquals(Result.FAIL, size.apply(sixBlocks));
    assertEquals(Result.PASS, size.apply(fourBlocks));
    assertEquals(Result.FAIL, size.apply(fiveBlocksPlus));
View Full Code Here


    fs = new MockFileSystem();
    conf = fs.getConf();

    name = new Name.Iname();
    addArgument(name, "name");
    name.initialise(new FindOptions());
  }
View Full Code Here

    out = mock(PrintStream.class);
    err = mock(PrintStream.class);

    factory = new CommandFactory(conf);
    factory.registerCommands(TestCommand.class);
    options = new FindOptions();
    options.setCommandFactory(factory);
    options.setOut(out);
   
    String pathname = "/one/two/test";
   
View Full Code Here

  @Test
  public void applyEquals() throws IOException {
    Blocksize blocksize = new Blocksize();
    addArgument(blocksize, "3");
    blocksize.initialise(new FindOptions());

    assertEquals(Result.FAIL, blocksize.apply(one));
    assertEquals(Result.FAIL, blocksize.apply(two));
    assertEquals(Result.PASS, blocksize.apply(three));
    assertEquals(Result.FAIL, blocksize.apply(four));
View Full Code Here

  @Test
  public void applyGreaterThan() throws IOException {
    Blocksize blocksize = new Blocksize();
    addArgument(blocksize, "+3");
    blocksize.initialise(new FindOptions());

    assertEquals(Result.FAIL, blocksize.apply(one));
    assertEquals(Result.FAIL, blocksize.apply(two));
    assertEquals(Result.FAIL, blocksize.apply(three));
    assertEquals(Result.PASS, blocksize.apply(four));
View Full Code Here

  @Test
  public void applyLessThan() throws IOException {
    Blocksize blocksize = new Blocksize();
    addArgument(blocksize, "-3");
    blocksize.initialise(new FindOptions());

    assertEquals(Result.PASS, blocksize.apply(one));
    assertEquals(Result.PASS, blocksize.apply(two));
    assertEquals(Result.FAIL, blocksize.apply(three));
    assertEquals(Result.FAIL, blocksize.apply(four));
View Full Code Here

    fs = new MockFileSystem();
    conf = fs.getConf();

    name = new Name();
    addArgument(name, "name");
    name.initialise(new FindOptions());
  }
View Full Code Here

  @Test
  public void testExact() throws IOException {
    Atime atime = new Atime();
    addArgument(atime, "5");
   
    FindOptions options = new FindOptions();
    options.setStartTime(NOW);
    atime.initialise(options);
   
    assertEquals(Result.FAIL, atime.apply(fourDays));
    assertEquals(Result.FAIL, atime.apply(fiveDaysMinus));
    assertEquals(Result.PASS, atime.apply(fiveDays));
View Full Code Here

  @Test
  public void testGreater() throws IOException {
    Atime atime = new Atime();
    addArgument(atime, "+5");

    FindOptions options = new FindOptions();
    options.setStartTime(NOW);
    atime.initialise(options);
    assertEquals(Result.FAIL, atime.apply(fourDays));
    assertEquals(Result.FAIL, atime.apply(fiveDaysMinus));
    assertEquals(Result.FAIL, atime.apply(fiveDays));
View Full Code Here

  @Test
  public void testLess() throws IOException {
    Atime atime = new Atime();
    addArgument(atime, "-5");
   
    FindOptions options = new FindOptions();
    options.setStartTime(NOW);
    atime.initialise(options);
    assertEquals(Result.PASS, atime.apply(fourDays));
    assertEquals(Result.PASS, atime.apply(fiveDaysMinus));
    assertEquals(Result.FAIL, atime.apply(fiveDays));
View Full Code Here

TOP

Related Classes of org.apache.hadoop.fs.shell.find.FindOptions

Copyright © 2018 www.massapicom. 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.