コード例 #1
0
 /** Test size */
 @Test
 public void testAddAndSize() {
   assertEquals(1, history.size());
   history.add(new BuildHistoryItem("second"));
   assertEquals(2, history.size());
   history.add(new BuildHistoryItem("third"));
   assertEquals(3, history.size());
 }
コード例 #2
0
  /** Test history list does not exceed the max size */
  @Test
  public void testHistoryListDoesNotExceedMaxSize() {

    while (history.size() < BuildHistory.SIZE) {
      history.add(new BuildHistoryItem("test"));
    }

    assertEquals(BuildHistory.SIZE, history.size());

    history.add(new BuildHistoryItem("one more"));
    assertEquals(BuildHistory.SIZE, history.size());
  }
コード例 #3
0
 /** Test clear */
 @Test
 public void testClear() {
   assertNotSame(0, history.size());
   history.clear();
   assertEquals(0, history.size());
 }