/** 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()); }
/** 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()); }
/** Test clear */ @Test public void testClear() { assertNotSame(0, history.size()); history.clear(); assertEquals(0, history.size()); }