コード例 #1
0
  @Test
  public void linesAreCalculatedFromTheSameFile() throws Exception {
    IdSetterReducer reducer = new IdSetterReducer();
    IdSetterKey key = new IdSetterKey("f2", 20, 0);

    TreeMap<String, Long> counters = new TreeMap<String, Long>();
    counters.put("f2_4", 40L);

    assertEquals(40, reducer.calculatePreviousLinesInFile(key, counters));
  }
コード例 #2
0
  @Test
  public void zeroLinesAreCalculatedFromAnotherFile() throws Exception {
    IdSetterReducer reducer = new IdSetterReducer();
    IdSetterKey key = new IdSetterKey("f2", 20, 0);

    TreeMap<String, Long> counters = new TreeMap<String, Long>();
    counters.put("f1_0", 10L);

    assertEquals(10, reducer.calculatePreviousLinesInFile(key, counters));
  }