예제 #1
0
  @Test
  public void testRemoveLink() {
    Log.info(Log.FAC_TEST, "Starting testRemoveLink");

    Collection cd = new Collection();
    for (int i = 0; i < lrs.length; ++i) {
      cd.add(lrs[i]);
    }
    cd.remove(lrs[0]);
    Assert.assertEquals(cd.get(0), lrs[1]);
    LinkAuthenticator la2alt =
        new LinkAuthenticator(pubID2, null, null, SignedInfo.ContentType.DATA, contenthash1);

    Link lr2alt = new Link(name3, la2alt);
    cd.remove(lr2alt);
    Assert.assertEquals(cd.get(1), lrs[3]);

    Log.info(Log.FAC_TEST, "Completed testRemoveLink");
  }
예제 #2
0
  @Test
  public void testRemoveInt() {
    Log.info(Log.FAC_TEST, "Starting testRemoveInt");

    Collection cd = new Collection();
    for (int i = 0; i < lrs.length; ++i) {
      cd.add(lrs[i]);
    }
    cd.remove(0);
    Assert.assertEquals(cd.get(0), lrs[1]);

    Log.info(Log.FAC_TEST, "Completed testRemoveInt");
  }
예제 #3
0
  @Test
  public void testAddGet() {
    Log.info(Log.FAC_TEST, "Starting testAddGet");

    Collection cd = new Collection();
    for (int i = 0; i < lrs.length; ++i) {
      cd.add(lrs[i]);
    }
    for (int i = 0; i < lrs.length; ++i) {
      Assert.assertEquals(cd.get(i), lrs[i]);
    }

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