static void runTestMapred(Table table) throws IOException {
    org.apache.hadoop.hbase.mapred.TableRecordReader trr =
      new org.apache.hadoop.hbase.mapred.TableRecordReader();
    trr.setStartRow(Bytes.toBytes("aaa"));
    trr.setEndRow(Bytes.toBytes("zzz"));
    trr.setHTable(table);
    trr.setInputColumns(columns);

    trr.init();
    Result r = new Result();
    ImmutableBytesWritable key = new ImmutableBytesWritable();

    boolean more = trr.next(key, r);
    assertTrue(more);
    checkResult(r, key, Bytes.toBytes("aaa"), Bytes.toBytes("value aaa"));

    more = trr.next(key, r);
    assertTrue(more);
    checkResult(r, key, Bytes.toBytes("bbb"), Bytes.toBytes("value bbb"));

    // no more data
    more = trr.next(key, r);
    assertFalse(more);
  }
Create table data and run tests on specified htable using the o.a.h.hbase.mapred API.
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapred/TestTableInputFormat.java