Clover Coverage Report - Pebble 2.5-SNAPSHOT
Coverage timestamp: Sat Jun 12 2010 09:39:29 EST
../../../../../img/srcFileCovDistChart0.png 48% of files have more coverage
5   46   2   2,5
0   21   0,4   2
2     1  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  ClearMessagesAction       Line # 19 5 0% 2 7 0% 0.0
 
No Tests
 
1    package net.sourceforge.pebble.web.action;
2   
3    import net.sourceforge.pebble.web.controller.RequireSecurityToken;
4    import net.sourceforge.pebble.web.view.View;
5    import net.sourceforge.pebble.web.view.impl.MessagesView;
6    import net.sourceforge.pebble.Constants;
7    import net.sourceforge.pebble.domain.Blog;
8   
9    import javax.servlet.http.HttpServletRequest;
10    import javax.servlet.http.HttpServletResponse;
11    import javax.servlet.ServletException;
12   
13    /**
14    * Allows the user to clear all messages for the current blog.
15    *
16    * @author Simon Brown
17    */
18    @RequireSecurityToken
 
19    public class ClearMessagesAction extends SecureAction {
20   
21    /**
22    * Peforms the processing associated with this action.
23    *
24    * @param request the HttpServletRequest instance
25    * @param response the HttpServletResponse instance
26    * @return the name of the next view
27    */
 
28  0 toggle public View process(HttpServletRequest request, HttpServletResponse response) throws ServletException {
29  0 Blog blog = (Blog)getModel().get(Constants.BLOG_KEY);
30  0 blog.clearMessages();
31  0 getModel().put("messages", blog.getMessages());
32   
33  0 return new MessagesView();
34    }
35   
36    /**
37    * Gets a list of all roles that are allowed to access this action.
38    *
39    * @return an array of Strings representing role names
40    * @param request
41    */
 
42  0 toggle public String[] getRoles(HttpServletRequest request) {
43  0 return new String[]{Constants.BLOG_ADMIN_ROLE, Constants.BLOG_OWNER_ROLE};
44    }
45   
46    }