コード例 #1
0
  public void testLeave() {
    agg.enter(1);
    agg.leave(1);

    try {
      agg.leave(1);
      fail();
    } catch (IllegalStateException ex) {
      // expected
    }
  }
コード例 #2
0
 public void testGetType() {
   assertEquals(Integer.class, agg.getValueType());
 }
コード例 #3
0
  public void testGetValue() {
    assertEquals(0, agg.getValue());

    agg.enter(10);
    assertEquals(10, agg.getValue());

    agg.enter(10);
    assertEquals(10, agg.getValue());

    agg.enter(2);
    assertEquals(12, agg.getValue());

    agg.leave(10);
    assertEquals(12, agg.getValue());

    agg.leave(10);
    assertEquals(2, agg.getValue());

    agg.leave(2);
    assertEquals(0, agg.getValue());
  }
コード例 #4
0
 public void testEnter() {
   agg.enter(1);
   agg.enter(new Integer(10));
   agg.enter(null);
 }