Clover Coverage Report - Pebble 2.5-SNAPSHOT
Coverage timestamp: Sat Jun 12 2010 09:39:29 EST
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
10   64   5   2
0   26   0,5   5
5     1  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  BlogEntryIndexListener       Line # 12 10 0% 5 0 100% 1.0
 
  (180)
 
1    package net.sourceforge.pebble.index;
2   
3    import net.sourceforge.pebble.domain.BlogEntry;
4    import net.sourceforge.pebble.api.event.blogentry.BlogEntryEvent;
5    import net.sourceforge.pebble.api.event.blogentry.BlogEntryListener;
6   
7    /**
8    * Listens to blog entry events and keeps the blog entry index up to date.
9    *
10    * @author Simon Brown
11    */
 
12    public class BlogEntryIndexListener implements BlogEntryListener {
13   
14    /**
15    * Called when a blog entry has been added.
16    *
17    * @param event a BlogEntryEvent instance
18    */
 
19  276 toggle public void blogEntryAdded(BlogEntryEvent event) {
20  276 BlogEntry blogEntry = event.getBlogEntry();
21  276 blogEntry.getBlog().getBlogEntryIndex().index(blogEntry);
22    }
23   
24    /**
25    * Called when a blog entry has been removed.
26    *
27    * @param event a BlogEntryEvent instance
28    */
 
29  18 toggle public void blogEntryRemoved(BlogEntryEvent event) {
30  18 BlogEntry blogEntry = event.getBlogEntry();
31  18 blogEntry.getBlog().getBlogEntryIndex().unindex(blogEntry);
32    }
33   
34    /**
35    * Called when a blog entry has been changed.
36    *
37    * @param event a BlogEntryEvent instance
38    */
 
39  12 toggle public void blogEntryChanged(BlogEntryEvent event) {
40    }
41   
42    /**
43    * Called when a blog entry has been published.
44    *
45    * @param event a BlogEntryEvent instance
46    */
 
47  14 toggle public void blogEntryPublished(BlogEntryEvent event) {
48  14 BlogEntry blogEntry = event.getBlogEntry();
49  14 blogEntry.getBlog().getBlogEntryIndex().unindex(blogEntry);
50  14 blogEntry.getBlog().getBlogEntryIndex().index(blogEntry);
51    }
52   
53    /**
54    * Called when a blog entry has been unpublished.
55    *
56    * @param event a BlogEntryEvent instance
57    */
 
58  4 toggle public void blogEntryUnpublished(BlogEntryEvent event) {
59  4 BlogEntry blogEntry = event.getBlogEntry();
60  4 blogEntry.getBlog().getBlogEntryIndex().unindex(blogEntry);
61  4 blogEntry.getBlog().getBlogEntryIndex().index(blogEntry);
62    }
63   
64    }