use of org.apache.hadoop.fs.shell.find.Find in project hadoop by apache.
the class TestFind method processOptionsPrint0.
// check -print0 is handled correctly
@Test
public void processOptionsPrint0() throws IOException {
Find find = new Find();
find.setConf(conf);
String args = "path -print0";
String expected = "Print0-Print(;)";
find.processOptions(getArgs(args));
Expression expression = find.getRootExpression();
assertEquals(expected, expression.toString());
}
use of org.apache.hadoop.fs.shell.find.Find 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());
}
use of org.apache.hadoop.fs.shell.find.Find 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());
}
use of org.apache.hadoop.fs.shell.find.Find in project hadoop by apache.
the class TestFind method processOptionsFollowLinkFollowArgLink.
// check follow arg link option is recognized
@Test
public void processOptionsFollowLinkFollowArgLink() throws IOException {
Find find = new Find();
String args = "-L -H path";
find.processOptions(getArgs(args));
assertTrue(find.getOptions().isFollowLink());
// follow link option takes precedence over follow arg link
assertFalse(find.getOptions().isFollowArgLink());
}
Aggregations