public void testLeave() { agg.enter(1); agg.leave(1); try { agg.leave(1); fail(); } catch (IllegalStateException ex) { // expected } }
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()); }
public void testEnter() { agg.enter(1); agg.enter(new Integer(10)); agg.enter(null); }