Coverage Report - org.kuali.student.enrollment.class2.grading.keyvalue.CourseOfferingKeyValues
 
Classes in this File Line Coverage Branch Coverage Complexity
CourseOfferingKeyValues
0%
0/22
0%
0/4
11
 
 1  
 package org.kuali.student.enrollment.class2.grading.keyvalue;
 2  
 
 3  
 /*
 4  
  * Copyright 2007 The Kuali Foundation
 5  
  *
 6  
  * Licensed under the Educational Community License, Version 1.0 (the "License");
 7  
  * you may not use this file except in compliance with the License.
 8  
  * You may obtain a copy of the License at
 9  
  *
 10  
  * http://www.opensource.org/licenses/ecl1.php
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing, software
 13  
  * distributed under the License is distributed on an "AS IS" BASIS,
 14  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15  
  * See the License for the specific language governing permissions and
 16  
  * limitations under the License.
 17  
  */
 18  
 
 19  
 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
 20  
 import org.kuali.rice.core.util.ConcreteKeyValue;
 21  
 import org.kuali.rice.kns.lookup.keyvalues.KeyValuesBase;
 22  
 import org.kuali.rice.kns.util.ErrorMessage;
 23  
 import org.kuali.rice.kns.util.GlobalVariables;
 24  
 import org.kuali.student.enrollment.acal.service.AcademicCalendarService;
 25  
 import org.kuali.student.enrollment.classII.grading.service.GradingServiceMockImpl;
 26  
 import org.kuali.student.enrollment.grading.dto.GradeRosterInfo;
 27  
 import org.kuali.student.enrollment.grading.service.GradingService;
 28  
 import org.kuali.student.r2.common.dto.ContextInfo;
 29  
 import org.kuali.student.r2.common.exceptions.*;
 30  
 import org.kuali.student.test.utilities.TestHelper;
 31  
 
 32  
 import javax.xml.namespace.QName;
 33  
 import java.util.ArrayList;
 34  
 import java.util.List;
 35  
 
 36  0
 public class CourseOfferingKeyValues extends KeyValuesBase {
 37  
 
 38  
     public List getKeyValues() {
 39  0
         List keyValues = new ArrayList();
 40  
 
 41  0
         ContextInfo context = TestHelper.getContext1();
 42  
 
 43  0
         GradingService gradingService = (GradingService) GlobalResourceLoader.getService(new QName("http://student.kuali.org/wsdl/grading", "GradingService"));
 44  
 
 45  
         try {
 46  0
             List<GradeRosterInfo> gradeRosterInfoList = gradingService.getGradeRostersByGraderAndTerm("Grader1", "201108", context);
 47  0
             keyValues.add(new ConcreteKeyValue("", ""));
 48  0
             if (gradeRosterInfoList != null){
 49  0
                 List courseOfferingList = new ArrayList();
 50  0
                 for (GradeRosterInfo rosterInfo : gradeRosterInfoList){
 51  0
                     keyValues.add(new ConcreteKeyValue(rosterInfo.getCourseOfferingId(), rosterInfo.getName()));
 52  
                 }
 53  
             }
 54  0
         } catch (DoesNotExistException e) {
 55  0
             keyValues.add(new ConcreteKeyValue("", ""));
 56  0
         } catch (InvalidParameterException e) {
 57  0
             throw new RuntimeException(e);
 58  0
         } catch (MissingParameterException e) {
 59  0
             throw new RuntimeException(e);
 60  0
         } catch (OperationFailedException e) {
 61  0
             throw new RuntimeException(e);
 62  0
         } catch (PermissionDeniedException e) {
 63  0
             GlobalVariables.getMessageList().add(new ErrorMessage("test",e.getMessage()));
 64  0
         }
 65  
 
 66  0
         return keyValues;
 67  
     }
 68  
 
 69  
 }