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

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


public class TestNumberExpression extends TestExpression {

  @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


    assertEquals(Result.FAIL, numberExpr.applyNumber(6));
  }

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

    assertEquals(Result.PASS, numberExpr.applyNumber(6));
  }

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

TOP

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

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.