Search in sources :

Example 16 with Expression

use of org.apache.hadoop.fs.shell.find.Expression in project hadoop by apache.

the class TestFind method processOptionsPrint.

// check -print is handled correctly
@Test
public void processOptionsPrint() throws IOException {
    Find find = new Find();
    find.setConf(conf);
    String args = "path -print";
    String expected = "Print(;)";
    find.processOptions(getArgs(args));
    Expression expression = find.getRootExpression();
    assertEquals(expected, expression.toString());
}
Also used : BaseExpression(org.apache.hadoop.fs.shell.find.BaseExpression) Expression(org.apache.hadoop.fs.shell.find.Expression) Find(org.apache.hadoop.fs.shell.find.Find) Test(org.junit.Test)

Example 17 with Expression

use of org.apache.hadoop.fs.shell.find.Expression in project hadoop by apache.

the class TestFind method processOptionsNoExpression.

// check print is used as the default expression
@Test
public void processOptionsNoExpression() throws IOException {
    Find find = new Find();
    find.setConf(conf);
    String args = "path";
    String expected = "Print(;)";
    find.processOptions(getArgs(args));
    Expression expression = find.getRootExpression();
    assertEquals(expected, expression.toString());
}
Also used : BaseExpression(org.apache.hadoop.fs.shell.find.BaseExpression) Expression(org.apache.hadoop.fs.shell.find.Expression) Find(org.apache.hadoop.fs.shell.find.Find) Test(org.junit.Test)

Aggregations

BaseExpression (org.apache.hadoop.fs.shell.find.BaseExpression)17 Expression (org.apache.hadoop.fs.shell.find.Expression)17 Find (org.apache.hadoop.fs.shell.find.Find)17 Test (org.junit.Test)17 PrintStream (java.io.PrintStream)9 PathData (org.apache.hadoop.fs.shell.PathData)9 InOrder (org.mockito.InOrder)9