@Test public void testBuildImplicitRawCounters() { TaskAttemptReportPBImpl report = new TaskAttemptReportPBImpl(); org.apache.hadoop.mapreduce.Counters rCounters = MockJobs.newCounters(); report.setRawCounters(rCounters); MRProtos.TaskAttemptReportProto protoVal = report.getProto(); Counters counters = report.getCounters(); assertTrue(protoVal.hasCounters()); }
@Test public void testBuildImplicitRawCounters() { // Create basic class TaskReportPBImpl report = new TaskReportPBImpl(); org.apache.hadoop.mapreduce.Counters rCounters = MockJobs.newCounters(); // Set raw counters report.setRawCounters(rCounters); // Verify getProto method implicitly converts/sets real counters MRProtos.TaskReportProto protoVal = report.getProto(); assertTrue(protoVal.hasCounters()); }