Exemplo n.º 1
0
 @Test(timeout = 500)
 public void testList3() {
   assertTrue("Newly constructed list should be empty", impl.isEmpty());
   assertEquals("Newly constructed list should have size 0", 0, impl.size());
   assertEquals("Appending the list should return itself.", impl, impl.append(5));
   assertEquals("Size should now be 1.", 1, impl.size());
 }
Exemplo n.º 2
0
 @Test(timeout = 500)
 public void testList5() {
   assertEquals("Newly constructed list should have size 0", 0, impl.size());
   assertEquals("Appending the list should return itself.", impl, impl.append(5));
   assertEquals("Size should now be 1.", 1, impl.size());
   impl.append(6).append(7).append(8);
   assertEquals("Size should now be 4.", 4, impl.size());
   assertEquals("First element should be 5.", new Integer(5), impl.get(0));
 }
Exemplo n.º 3
0
 @Test(timeout = 500)
 public void testListUnbounded() {
   for (int i = 0; i < 500000; i++) {
     assertEquals(i, impl.size());
     impl.append(i);
   }
 }
Exemplo n.º 4
0
 @Test(timeout = 500)
 public void testList1() {
   assertTrue("Newly constructed list should be empty", impl.isEmpty());
   assertEquals("Newly constructed list should have size 0", 0, impl.size());
 }