@Test
public void testStriper() throws Exception {

  final Random r = new Random();
  final Configuration conf = new Configuration();
  final FileSystem fs = FileSystem.getLocal(conf).getRaw();
  conf.setLong(FilePool.GRIDMIX_MIN_FILE, 3 * 1024);
  final FilePool pool = new FilePool(conf, base) {
    @Override
    public BlockLocation[] locationsFor(FileStatus stat, long start, long len)
        throws IOException {
      return new BlockLocation[] { new BlockLocation() };
    }
  };
  pool.refresh();
  final int expectedPoolSize = (NFILES / 2 * (NFILES / 2 + 1) - 6) * 1024;
  final InputStriper striper = new InputStriper(pool, expectedPoolSize);
  int last = 0;
  for (int i = 0; i < expectedPoolSize;
      last = Math.min(expectedPoolSize - i, r.nextInt(expectedPoolSize))) {
    checkSplitEq(fs, striper.splitFor(pool, last, 0), last);
    i += last;
  }
  final InputStriper striper2 = new InputStriper(pool, expectedPoolSize);
  checkSplitEq(fs, striper2.splitFor(pool, expectedPoolSize, 0),
      expectedPoolSize);
}