private String runTool(Configuration conf, String[] args, boolean success)
throws Exception {
ByteArrayOutputStream o = new ByteArrayOutputStream();
PrintStream out = new PrintStream(o, true);
try {
int ret = ToolRunner.run(new GetConf(conf, out, out), args);
assertEquals(success, ret == 0);
return o.toString();
} finally {
o.close();
out.close();