| 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 |
|
|
| 11 |
|
|
| 12 |
|
@author |
| 13 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0,14 |
|
| 14 |
|
public class SearchHitByDateComparatorTest extends SingleBlogTestCase { |
| 15 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0,14 |
1
PASS
|
|
| 16 |
2
|
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 |
|
} |