Clover Coverage Report - Pebble 2.5-SNAPSHOT
Coverage timestamp: Sat Jun 12 2010 09:39:29 EST
7   28   1   7
0   16   0,14   1
1     1  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  SearchHitByDateComparatorTest       Line # 14 7 0% 1 0 100% 1.0
 
  (2)
 
1    package net.sourceforge.pebble.comparator;
2   
3    import net.sourceforge.pebble.domain.SingleBlogTestCase;
4    import net.sourceforge.pebble.search.SearchHit;
5   
6    import java.util.Comparator;
7    import java.util.Date;
8   
9    /**
10    * Tests for the SearchHitByDateComparator class.
11    *
12    * @author Simon Brown
13    */
 
14    public class SearchHitByDateComparatorTest extends SingleBlogTestCase {
15   
 
16  2 toggle public void testCompare() {
17  2 Comparator comp = new SearchHitByDateComparator();
18   
19  2 SearchHit h1 = new SearchHit(null, "", "", "", "", new Date(321), 1.0F);
20  2 SearchHit h2 = new SearchHit(null, "", "", "", "", new Date(123), 1.0F);
21   
22  2 assertTrue(comp.compare(h1, h1) == 0);
23  2 assertTrue(comp.compare(h1, h2) != 0);
24  2 assertTrue(comp.compare(h1, h2) < 0);
25  2 assertTrue(comp.compare(h2, h1) > 0);
26    }
27   
28    }