HBASE-14728 TestRowCounter is broken in master (Abhishek Singh Chouhan) -- REAPPLY

This commit is contained in:
stack 2015-11-02 08:08:01 -08:00
parent 950050e9d6
commit 6c5da91b18
1 changed files with 7 additions and 3 deletions

View File

@ -38,6 +38,8 @@ import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.LauncherSecurityManager;
import org.apache.hadoop.mapreduce.Counter;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.util.ToolRunner;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@ -203,9 +205,11 @@ public class TestRowCounter {
* @throws Exception
*/
private void runRowCount(String[] args, int expectedCount) throws Exception {
final RowCounter counter = new RowCounter();
assertEquals("job failed either due to failure or miscount (see log output).", 0,
ToolRunner.run(TEST_UTIL.getConfiguration(), counter, args));
Job job = RowCounter.createSubmittableJob(TEST_UTIL.getConfiguration(), args);
job.waitForCompletion(true);
assertTrue(job.isSuccessful());
Counter counter = job.getCounters().findCounter(RowCounter.RowCounterMapper.Counters.ROWS);
assertEquals(expectedCount, counter.getValue());
}
/**