コード例 #1
0
  @Test
  public void test1() {
    ListDistributor d = new ListDistributor(1, 1);
    assertEquals(1, d.getNumThreads());

    assertEquals(0, d.getFromListIndex(0));
    assertEquals(1, d.getToListIndex(0));
  }
コード例 #2
0
  @Test
  public void test5() {
    ListDistributor d = new ListDistributor(3, 10);
    assertEquals(3, d.getNumThreads());

    assertEquals(0, d.getFromListIndex(0));
    assertEquals(3, d.getToListIndex(0));

    assertEquals(3, d.getFromListIndex(1));
    assertEquals(6, d.getToListIndex(1));

    assertEquals(6, d.getFromListIndex(2));
    assertEquals(10, d.getToListIndex(2));
  }