本文整理汇总了Java中org.apache.hadoop.cli.util.ComparatorBase类的典型用法代码示例。如果您正苦于以下问题:Java ComparatorBase类的具体用法?Java ComparatorBase怎么用?Java ComparatorBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ComparatorBase类属于org.apache.hadoop.cli.util包,在下文中一共展示了ComparatorBase类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: compareTestOutput
点赞 2
import org.apache.hadoop.cli.util.ComparatorBase; //导入依赖的package包/类
/**
* Compare the actual output with the expected output
* @param compdata
* @return
*/
private boolean compareTestOutput(ComparatorData compdata) {
// Compare the output based on the comparator
String comparatorType = compdata.getComparatorType();
Class<?> comparatorClass = null;
// If testMode is "test", then run the command and compare the output
// If testMode is "nocompare", then run the command and dump the output.
// Do not compare
boolean compareOutput = false;
if (testMode.equals(TESTMODE_TEST)) {
try {
// Initialize the comparator class and run its compare method
comparatorClass = Class.forName("org.apache.hadoop.cli.util." +
comparatorType);
ComparatorBase comp = (ComparatorBase) comparatorClass.newInstance();
compareOutput = comp.compare(CommandExecutor.getLastCommandOutput(),
compdata.getExpectedOutput());
} catch (Exception e) {
LOG.info("Error in instantiating the comparator" + e);
}
}
return compareOutput;
}
开发者ID:rhli,
项目名称:hadoop-EAR,
代码行数:32,
代码来源:TestCLI.java