Coverage Report - org.kuali.student.enrollment.class2.acal.controller.AcademicTermController
 
Classes in this File Line Coverage Branch Coverage Complexity
AcademicTermController
0%
0/15
N/A
2.333
 
 1  
 package org.kuali.student.enrollment.class2.acal.controller;
 2  
 
 3  
 import org.kuali.rice.krad.util.GlobalVariables;
 4  
 import org.kuali.rice.krad.web.controller.UifControllerBase;
 5  
 import org.kuali.rice.krad.web.form.UifFormBase;
 6  
 import org.kuali.student.enrollment.acal.dto.TermInfo;
 7  
 import org.kuali.student.enrollment.class2.acal.form.AcademicCalendarForm;
 8  
 import org.kuali.student.enrollment.class2.acal.form.AcademicTermForm;
 9  
 import org.kuali.student.enrollment.class2.acal.service.AcademicTermEditViewHelperService;
 10  
 import org.kuali.student.r2.common.dto.ContextInfo;
 11  
 import org.kuali.student.test.utilities.TestHelper;
 12  
 import org.springframework.stereotype.Controller;
 13  
 import org.springframework.validation.BindingResult;
 14  
 import org.springframework.web.bind.annotation.ModelAttribute;
 15  
 import org.springframework.web.bind.annotation.RequestMapping;
 16  
 import org.springframework.web.servlet.ModelAndView;
 17  
 
 18  
 import javax.servlet.http.HttpServletRequest;
 19  
 import javax.servlet.http.HttpServletResponse;
 20  
 
 21  
 @Controller
 22  
 @RequestMapping(value = "/academicTerm")
 23  0
 public class AcademicTermController extends UifControllerBase {
 24  
 
 25  
 
 26  
     @Override
 27  
     protected UifFormBase createInitialForm(HttpServletRequest request) {
 28  0
         return new AcademicTermForm();
 29  
     }
 30  
 
 31  
     @RequestMapping(params = "methodToCall=editTerm")
 32  
     public ModelAndView editTerm(@ModelAttribute("KualiForm") AcademicTermForm academicTermForm, BindingResult result,
 33  
             HttpServletRequest request, HttpServletResponse response) {
 34  
 
 35  0
         String termId = request.getParameter("termId");
 36  
         //TODO:Build real context.
 37  0
         ContextInfo context = TestHelper.getContext1();
 38  
         try{
 39  0
             ((AcademicTermEditViewHelperService)academicTermForm.getView().getViewHelperService()).buildTerm(termId,academicTermForm,context);
 40  0
         }catch (Exception e){
 41  0
             throw new RuntimeException(e);
 42  0
         }
 43  
 
 44  0
         return getUIFModelAndView(academicTermForm);
 45  
     }
 46  
 
 47  
     /**
 48  
      * Method used to save AcademicCalendar
 49  
      */
 50  
     @RequestMapping(params = "methodToCall=save")
 51  
     public ModelAndView save(@ModelAttribute("KualiForm") AcademicTermForm academicTermForm, BindingResult result,
 52  
                              HttpServletRequest request, HttpServletResponse response) {
 53  
 
 54  
         //TODO:Build real context.
 55  0
         ContextInfo context = TestHelper.getContext1();
 56  
 
 57  
         try{
 58  0
             ((AcademicTermEditViewHelperService)academicTermForm.getView().getViewHelperService()).saveTerm(academicTermForm, context);
 59  0
         }catch (Exception e){
 60  
             //TODO:For now, throw RTE, have to look into proper way of handling exceptions.
 61  0
            throw new RuntimeException(e);
 62  0
         }
 63  
 
 64  0
         return getUIFModelAndView(academicTermForm);
 65  
     }
 66  
 }