}
static void runFsck(Configuration conf) throws Exception {
ByteArrayOutputStream bStream = new ByteArrayOutputStream();
PrintStream out = new PrintStream(bStream, true);
int errCode = ToolRunner.run(new DFSck(conf, out),
new String[]{"/", "-files"});
String result = bStream.toString();
System.out.println("output from fsck:\n" + result);
assertEquals(0, errCode);
assertTrue(result.contains("/test1"));