Examples of Referer


Examples of net.sourceforge.pebble.logging.Referer

*/
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);
  }
View Full Code Here

Examples of net.sourceforge.pebble.logging.Referer

  /**
   * Tests that a list of referers is filtered correctly.
   */
  public void testFilter() {
    List referers = new ArrayList();
    Referer url1 = new Referer("http://www.google.com");
    referers.add(url1);
    Referer url2 = new Referer("http://www.test.com");
    referers.add(url2);
    Referer url3 = new Referer("http://www.yahoo.com");
    referers.add(url3);
    assertEquals(3, referers.size());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.