*/
public class CountedUrlComparatorTest extends TestCase {
public void testCompare() {
CountedUrlByCountComparator comp = new CountedUrlByCountComparator();
CountedUrl c1 = new Referer("http://www.google.com");
CountedUrl c2 = new Referer("http://www.yahoo.com");
assertTrue(comp.compare(c1, c1) == 0);
assertTrue(comp.compare(c1, c2) < 0);
assertTrue(comp.compare(c2, c1) > 0);
c1.addLogEntry(new LogEntry());
assertTrue(comp.compare(c1, c2) < 0);
assertTrue(comp.compare(c2, c1) > 0);
c2.addLogEntry(new LogEntry());
c2.addLogEntry(new LogEntry());
assertTrue(comp.compare(c1, c2) > 0);
assertTrue(comp.compare(c2, c1) < 0);
}