View Javadoc

1   /**
2    * Copyright 2011 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.student.krms.termresolver;
17  
18  import org.junit.Before;
19  import org.junit.Ignore;
20  import org.junit.Test;
21  import org.junit.runner.RunWith;
22  import org.kuali.rice.krms.impl.type.KrmsTypeResolver;
23  import org.kuali.student.common.util.krms.RulesExecutionConstants;
24  import org.kuali.student.enrollment.academicrecord.dto.GPAInfo;
25  import org.kuali.student.enrollment.academicrecord.service.AcademicRecordService;
26  import org.kuali.student.enrollment.courseregistration.dto.CourseRegistrationInfo;
27  import org.kuali.student.enrollment.courseregistration.service.CourseRegistrationService;
28  import org.kuali.student.krms.util.KSKRMSExecutionConstants;
29  import org.kuali.student.r2.common.dto.ContextInfo;
30  import org.kuali.student.r2.common.dto.LocaleInfo;
31  import org.springframework.test.context.ContextConfiguration;
32  import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
33  
34  import javax.annotation.Resource;
35  import java.util.HashMap;
36  import java.util.List;
37  import java.util.Map;
38  
39  import static org.junit.Assert.assertNotNull;
40  
41  @RunWith(SpringJUnit4ClassRunner.class)
42  @ContextConfiguration(locations = {"classpath:ks-krms-test-context-mock.xml"})
43  @Ignore
44  public class TestEnrolledLearningObjectivesTermResolver {
45      private KrmsTypeResolver typeResolver;
46  
47      public ContextInfo callContext = null;
48      @Resource(name = "courseRegistrationService")
49      private CourseRegistrationService courseRegistrationService;;
50      private String studentID = "12020303";
51      private String TermId = "1001";
52  
53      @Before
54      public void setUp() {
55          callContext = new ContextInfo();
56      }
57  
58  
59      @Test
60      public void testCourseRegistrationServiceNotNull() {
61          assertNotNull(courseRegistrationService);
62      }
63  
64      @Test
65      public void testResolve() {
66          EnrolledLearningObjectivesTermResolver termResolver = new EnrolledLearningObjectivesTermResolver();
67          termResolver.setCourseRegistrationService(courseRegistrationService);
68          Map<String, Object> resolvedPrereqs = new HashMap<String, Object>();
69          Map<String, String> parameters = new HashMap<String, String>();
70  
71          ContextInfo context = new ContextInfo();
72          context.setLocale(new LocaleInfo());
73          context.setPrincipalId("nina");
74  
75          resolvedPrereqs.put(RulesExecutionConstants.CONTEXT_INFO_TERM_NAME, context);
76          parameters.put(KSKRMSExecutionConstants.PERSON_ID_TERM_PROPERTY, studentID);
77          parameters.put(KSKRMSExecutionConstants.TERM_ID_TERM_PROPERTY, TermId);
78  
79          List<CourseRegistrationInfo> courseRegistrationRecords = termResolver.resolve(resolvedPrereqs, parameters);
80          // TODO Do some assert statements on the expected returned list.
81          assertNotNull(courseRegistrationRecords);
82  
83      }
84  
85  }