Пример #1
0
  @Test
  public void testValidate() {
    Log.info(Log.FAC_TEST, "Starting testValidate");

    Collection cd = new Collection();
    Assert.assertTrue(cd.validate());
    cd.add(lrs[0]);
    Assert.assertTrue(cd.validate());
    cd.remove(0);
    Assert.assertTrue(cd.validate());

    Log.info(Log.FAC_TEST, "Completed testValidate");
  }
Пример #2
0
  @Test
  public void testCollectionData() {
    Log.info(Log.FAC_TEST, "Starting testCollectionData");

    Collection cd = new Collection();
    Assert.assertNotNull(cd);
    Assert.assertTrue(cd.validate());

    Log.info(Log.FAC_TEST, "Completed testCollectionData");
  }
Пример #3
0
  @Test
  public void testContents() {
    Log.info(Log.FAC_TEST, "Starting testContents");

    Collection cd = new Collection();
    Assert.assertTrue(cd.validate());
    for (int i = 0; i < lrs.length; ++i) {
      cd.add(lrs[i]);
    }
    LinkedList<Link> c = cd.contents();
    Assert.assertNotNull(c);
    Assert.assertTrue(c.size() == lrs.length);
    for (int i = 0; i < lrs.length; ++i) {
      Assert.assertEquals(c.get(i), lrs[i]);
    }

    // Test iterator
    int j = 0;
    for (Link l : cd) {
      Assert.assertEquals(l, lrs[j++]);
    }

    Log.info(Log.FAC_TEST, "Completed testContents");
  }