Package no.priv.garshol.duke

Examples of no.priv.garshol.duke.Link


               all.iterator().next());
  }

  @Test
  public void testOverride() {
    Link l1 = new Link("1", "2", LinkStatus.ASSERTED, LinkKind.SAME, 1.0);
    linkdb.assertLink(l1);

    Record r1 = makeRecord("id", "1");
    Record r2 = makeRecord("id", "2");

    listener.startProcessing();
    listener.batchReady(1);
    listener.matches(r1, r2, 1.0);
    listener.batchDone();
    listener.endProcessing();

    Collection<Link> all = linkdb.getAllLinks();
    assertEquals(1, all.size());
    verifySame(new Link("1", "2", LinkStatus.ASSERTED, LinkKind.SAME, 1.0),
               all.iterator().next());
  }
View Full Code Here


               all.iterator().next());
  }

  @Test
  public void testOverride2() {
    Link l1 = new Link("1", "2", LinkStatus.ASSERTED, LinkKind.DIFFERENT, 1.0);
    linkdb.assertLink(l1);

    Record r1 = makeRecord("id", "1");
    Record r2 = makeRecord("id", "2");

    listener.startProcessing();
    listener.batchReady(1);
    listener.matches(r1, r2, 1.0);
    listener.batchDone();
    listener.endProcessing();

    Collection<Link> all = linkdb.getAllLinks();
    assertEquals(1, all.size());
    verifySame(new Link("1", "2", LinkStatus.ASSERTED, LinkKind.DIFFERENT, 1.0),
               all.iterator().next());
  }
View Full Code Here

    listener.matches(r3, r1, 1.0); // need to repeat this one
    listener.matches(r3, r4, 1.0);
    listener.batchDone();
    listener.endProcessing();

    Link l1 = new Link("1", "3", LinkStatus.INFERRED, LinkKind.SAME, 1.0);
    Link l2 = new Link("3", "4", LinkStatus.INFERRED, LinkKind.SAME, 1.0);

    Collection<Link> all = linkdb.getAllLinks();
    assertEquals(2, all.size());
    assertTrue(all.contains(l1));
    assertTrue(all.contains(l2));
View Full Code Here

    listener.batchDone();
    listener.endProcessing();

    Collection<Link> all = linkdb.getAllLinks();
    assertEquals(1, all.size());
    Link original = all.iterator().next();
    verifySame(new Link("1", "2", LinkStatus.INFERRED, LinkKind.SAME, 0.95),
               original);

    listener.startProcessing();
    listener.batchReady(1);
    listener.matches(r1, r2, 0.947);
    listener.batchDone();
    listener.endProcessing();

    all = linkdb.getAllLinks();
    assertEquals(1, all.size());
    Link newlink = all.iterator().next();

    verifySame(new Link("1", "2", LinkStatus.INFERRED, LinkKind.SAME, 0.95),
               newlink);

    assertEquals(original.getTimestamp(), newlink.getTimestamp());
  }
View Full Code Here

TOP

Related Classes of no.priv.garshol.duke.Link

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.