Coverage Report - org.kuali.student.enrollment.class2.acal.service.impl.HolidayCalendarLookupableImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
HolidayCalendarLookupableImpl
0%
0/19
0%
0/2
4
 
 1  
 package org.kuali.student.enrollment.class2.acal.service.impl;
 2  
 
 3  
 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
 4  
 import org.kuali.rice.krad.lookup.LookupableImpl;
 5  
 import org.kuali.rice.krad.web.form.LookupForm;
 6  
 import org.kuali.student.enrollment.acal.constants.AcademicCalendarServiceConstants;
 7  
 import org.kuali.student.enrollment.acal.dto.HolidayCalendarInfo;
 8  
 import org.kuali.student.enrollment.acal.service.AcademicCalendarService;
 9  
 import org.kuali.student.r2.common.dto.ContextInfo;
 10  
 import org.kuali.student.r2.common.exceptions.*;
 11  
 
 12  
 import javax.xml.namespace.QName;
 13  
 import java.util.ArrayList;
 14  
 import java.util.List;
 15  
 import java.util.Map;
 16  
 
 17  0
 public class HolidayCalendarLookupableImpl  extends LookupableImpl {
 18  
 
 19  
     public final static String ACADEMIC_CALENDAR_YEAR_KEY = "year";
 20  
     private transient AcademicCalendarService academicCalendarService;
 21  
 
 22  
 
 23  
     @Override
 24  
     protected List<?> getSearchResults(LookupForm lookupForm, Map<String, String> fieldValues, boolean unbounded) {
 25  
 
 26  0
         List<HolidayCalendarInfo> holidayCalendarInfoList = new ArrayList<HolidayCalendarInfo>();
 27  
 
 28  0
         Integer academicCalendarYear = new Integer("2011");
 29  0
         ContextInfo context = new ContextInfo();
 30  
         try{
 31  0
             holidayCalendarInfoList = getAcademicCalendarService().getHolidayCalendarsByStartYear(academicCalendarYear, context);
 32  0
             return holidayCalendarInfoList;
 33  0
         }catch (InvalidParameterException ipe){
 34  0
             System.out.println("call getAcademicCalendarService().getHolidayCalendarsByStartYear(startYear, context), and get InvalidParameterException:  "+ipe.toString());
 35  0
         }catch (MissingParameterException mpe){
 36  0
             System.out.println("call getAcademicCalendarService().getHolidayCalendarsByStartYear(startYear, context), and get MissingParameterException:  "+mpe.toString());
 37  0
         }catch (OperationFailedException ofe){
 38  0
             System.out.println("call getAcademicCalendarService().getHolidayCalendarsByStartYear(startYear, context), and get OperationFailedException:  "+ofe.toString());
 39  0
         }catch (PermissionDeniedException pde){
 40  0
             System.out.println("call getAcademicCalendarService().getHolidayCalendarsByStartYear(startYear, context), and get PermissionDeniedException:  "+pde.toString());
 41  0
         }
 42  0
         return null;
 43  
 
 44  
     }
 45  
 
 46  
     protected AcademicCalendarService getAcademicCalendarService() {
 47  0
         if(academicCalendarService == null) {
 48  0
             academicCalendarService = (AcademicCalendarService) GlobalResourceLoader.getService(new QName(AcademicCalendarServiceConstants.NAMESPACE, AcademicCalendarServiceConstants.SERVICE_NAME_LOCAL_PART));
 49  
         }
 50  
 
 51  0
         return academicCalendarService;
 52  
     }
 53  
 }
 54  
 
 55