if (System.getProperty("compile.c++") == null) {
LOG.info("compile.c++ is not defined, so skipping TestPipes");
return;
}
MiniDFSCluster dfs = null;
MiniMRCluster mr = null;
FileSystem fs = null;
Path cppExamples = new Path(System.getProperty("install.c++.examples"));
Path inputPath = new Path("/testing/in");
Path outputPath = new Path("/testing/out");
try {
final int numSlaves = 2;
Configuration conf = new Configuration();
dfs = new MiniDFSCluster(conf, numSlaves, true, null);
fs = dfs.getFileSystem();
mr = new MiniMRCluster(numSlaves, fs.getName(), 1);
writeInputFile(fs, inputPath);
runProgram(mr, fs, new Path(cppExamples, "bin/wordcount-simple"),
inputPath, outputPath, 3, 2, twoSplitOutput);
FileUtil.fullyDelete(fs, outputPath);
assertFalse("output not cleaned up", fs.exists(outputPath));
runProgram(mr, fs, new Path(cppExamples, "bin/wordcount-simple"),
inputPath, outputPath, 3, 0, noSortOutput);
FileUtil.fullyDelete(fs, outputPath);
assertFalse("output not cleaned up", fs.exists(outputPath));
runProgram(mr, fs, new Path(cppExamples, "bin/wordcount-part"),
inputPath, outputPath, 3, 2, fixedPartitionOutput);
runNonPipedProgram(mr, fs, new Path(cppExamples, "bin/wordcount-nopipe"));
mr.waitUntilIdle();
} finally {
mr.shutdown();
dfs.shutdown();
}
}