@Test @SuppressWarnings({ "deprecation", "unchecked" }) public void shouldCollectPredefinedTimes() throws IOException { int recordNumber = 999; Result resultMock = mock(Result.class); IdentityTableMap identityTableMap = null; try { Reporter reporterMock = mock(Reporter.class); identityTableMap = new IdentityTableMap(); ImmutableBytesWritable bytesWritableMock = mock(ImmutableBytesWritable.class); OutputCollector<ImmutableBytesWritable, Result> outputCollectorMock = mock(OutputCollector.class); for (int i = 0; i < recordNumber; i++) identityTableMap.map(bytesWritableMock, resultMock, outputCollectorMock, reporterMock); verify(outputCollectorMock, times(recordNumber)).collect( Mockito.any(ImmutableBytesWritable.class), Mockito.any(Result.class)); } finally { if (identityTableMap != null) identityTableMap.close(); } }
public void map(ImmutableBytesWritable key, Result value, OutputCollector<ImmutableBytesWritable,Result> output, Reporter reporter) throws IOException { output.collect(key, value); }
IdentityTableMap extends MapReduceBase implements TableMap<ImmutableBytesWritable, Result> { public void map(ImmutableBytesWritable key, Result value, OutputCollector<ImmutableBytesWritable,Result> output, Reporter reporter) throws IOException { output.collect(key, value); } }
IdentityTableMap extends MapReduceBase implements TableMap<ImmutableBytesWritable, Result> { public void map(ImmutableBytesWritable key, Result value, OutputCollector<ImmutableBytesWritable,Result> output, Reporter reporter) throws IOException { output.collect(key, value); } IdentityTableMap(); }
IdentityTableMap extends MapReduceBase implements TableMap<ImmutableBytesWritable, Result> { public void map(ImmutableBytesWritable key, Result value, OutputCollector<ImmutableBytesWritable,Result> output, Reporter reporter) throws IOException { output.collect(key, value); } IdentityTableMap(); @SuppressWarnings("unchecked") static void initJob(String table, String columns,
    Class<? extends TableMap> mapper, JobConf job); void map(ImmutableBytesWritable key, Result value,
      OutputCollector<ImmutableBytesWritable,Result> output,
      Reporter reporter); }
IdentityTableMap extends MapReduceBase implements TableMap<ImmutableBytesWritable, Result> { public void map(ImmutableBytesWritable key, Result value, OutputCollector<ImmutableBytesWritable,Result> output, Reporter reporter) throws IOException { output.collect(key, value); } IdentityTableMap(); @SuppressWarnings("unchecked") static void initJob(String table, String columns,
    Class<? extends TableMap> mapper, JobConf job); void map(ImmutableBytesWritable key, Result value,
      OutputCollector<ImmutableBytesWritable,Result> output,
      Reporter reporter);  }