Coverage report

  %line %branch
org.demosys.web.user.action.DeleteUserAction
100% 
100% 

 1  
 /*
 2  
  * Demosys.
 3  
  *
 4  
  * Terms of license - http://opensource.org/licenses/apachepl.php
 5  
  */
 6  
 package org.demosys.web.user.action;
 7  
 import javax.servlet.http.HttpServletRequest;
 8  
 import javax.servlet.http.HttpServletResponse;
 9  
 import org.apache.struts.action.*;
 10  
 import org.demosys.web.ServiceLocator;
 11  
 import org.demosys.web.user.UnknownUserException;
 12  
 import org.demosys.web.user.UserService;
 13  
 /**
 14  
  * Delete a user.
 15  
  */
 16  8
 public class DeleteUserAction extends Action {
 17  
     public ActionForward execute(ActionMapping mapping, ActionForm objForm,
 18  
         HttpServletRequest request, HttpServletResponse res) {
 19  
         // Get user id from request parameter
 20  8
         String id = request.getParameter("id");
 21  
 
 22  
         try {
 23  8
             UserService userService = ServiceLocator.getServiceLocator().getUserService();
 24  8
             userService.deleteUser(id);
 25  4
             return mapping.findForward("success");
 26  
         }
 27  
         catch (UnknownUserException e) {
 28  4
             ActionErrors errors = new ActionErrors();
 29  4
             errors.add("id", new ActionError("user.delete.unknown.user"));
 30  4
             saveErrors(request, errors);
 31  4
             return mapping.findForward("failure");
 32  
         }
 33  
     }
 34  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.