/** * Test pluggable error reporter. It can be plugged in * from system property or configuration. */ @Test (timeout=180000) public void testErrorReporter() throws Exception { try { MockErrorReporter.calledCount = 0; doFsck(conf, false); assertEquals(MockErrorReporter.calledCount, 0); conf.set("hbasefsck.errorreporter", MockErrorReporter.class.getName()); doFsck(conf, false); assertTrue(MockErrorReporter.calledCount > 20); } finally { conf.set("hbasefsck.errorreporter", PrintingErrorReporter.class.getName()); MockErrorReporter.calledCount = 0; } }
/** * Test pluggable error reporter. It can be plugged in * from system property or configuration. */ @Test public void testErrorReporter() throws Exception { try { MockErrorReporter.calledCount = 0; doFsck(conf, false); assertEquals(MockErrorReporter.calledCount, 0); conf.set("hbasefsck.errorreporter", MockErrorReporter.class.getName()); doFsck(conf, false); assertTrue(MockErrorReporter.calledCount > 20); } finally { conf.set("hbasefsck.errorreporter", PrintingErrorReporter.class.getName()); MockErrorReporter.calledCount = 0; } }