| 1 |
|
package net.sourceforge.pebble.event.response; |
| 2 |
|
|
| 3 |
|
import net.sourceforge.pebble.domain.SingleBlogTestCase; |
| 4 |
|
import net.sourceforge.pebble.domain.Comment; |
| 5 |
|
import net.sourceforge.pebble.domain.TrackBack; |
| 6 |
|
import net.sourceforge.pebble.domain.BlogEntry; |
| 7 |
|
import net.sourceforge.pebble.api.event.comment.CommentEvent; |
| 8 |
|
import net.sourceforge.pebble.api.event.trackback.TrackBackEvent; |
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
@author |
| 14 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 3 |
Complexity Density: 0,25 |
|
| 15 |
|
public class MarkApprovedListenerTest extends SingleBlogTestCase { |
| 16 |
|
|
| 17 |
|
private MarkApprovedListener listener; |
| 18 |
|
private Comment comment; |
| 19 |
|
private CommentEvent commentEvent; |
| 20 |
|
private TrackBack trackBack; |
| 21 |
|
private TrackBackEvent trackBackEvent; |
| 22 |
|
|
| 23 |
|
|
| 24 |
|
|
| 25 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0,17 |
|
| 26 |
4
|
protected void setUp() throws Exception {... |
| 27 |
4
|
super.setUp(); |
| 28 |
|
|
| 29 |
4
|
listener = new MarkApprovedListener(); |
| 30 |
4
|
comment = new BlogEntry(blog).createComment("Title", "Body", "Author", "me@somedomain.com", "http://www.google.com", "127.0.0.1"); |
| 31 |
4
|
commentEvent = new CommentEvent(comment, CommentEvent.COMMENT_ADDED); |
| 32 |
4
|
trackBack = new BlogEntry(blog).createTrackBack("Title", "Excerpt", "url", "blogName", "127.0.0.1"); |
| 33 |
4
|
trackBackEvent = new TrackBackEvent(trackBack, TrackBackEvent.TRACKBACK_ADDED); |
| 34 |
|
} |
| 35 |
|
|
| 36 |
|
|
| 37 |
|
|
| 38 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0,33 |
1
PASS
|
|
| 39 |
2
|
public void testCommentAdded() {... |
| 40 |
2
|
assertTrue(comment.isApproved()); |
| 41 |
2
|
listener.commentAdded(commentEvent); |
| 42 |
2
|
assertTrue(comment.isApproved()); |
| 43 |
|
} |
| 44 |
|
|
| 45 |
|
|
| 46 |
|
|
| 47 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0,33 |
1
PASS
|
|
| 48 |
2
|
public void testTrackBackAdded() {... |
| 49 |
2
|
assertTrue(trackBack.isApproved()); |
| 50 |
2
|
listener.trackBackAdded(trackBackEvent); |
| 51 |
2
|
assertTrue(trackBack.isApproved()); |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
} |