1
2
3
4
5
6
7
8
9
10
11
12
13
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.krms.util.KSKRMSExecutionConstants;
27 import org.kuali.student.r2.common.dto.ContextInfo;
28 import org.kuali.student.r2.common.dto.LocaleInfo;
29 import org.springframework.test.context.ContextConfiguration;
30 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
31
32 import javax.annotation.Resource;
33 import java.util.HashMap;
34 import java.util.Map;
35 import static org.junit.Assert.assertNotNull;
36 import static org.junit.Assert.assertNull;
37
38 @RunWith(SpringJUnit4ClassRunner.class)
39 @ContextConfiguration(locations = {"classpath:ks-krms-test-context.xml"})
40 @Ignore
41 public class TestFreeTextTermResolver {
42 private KrmsTypeResolver typeResolver;
43 private String studentID = "12020303";
44 private String CalcTypeID = "222";
45
46 public ContextInfo callContext = null;
47 @Resource(name = "acadRecordService")
48 private AcademicRecordService academicRecordService;
49
50 @Before
51 public void setUp() {
52 callContext = new ContextInfo();
53 }
54
55
56 @Test
57 public void testAcadRecordServiceNotNull() {
58 assertNotNull(academicRecordService);
59 }
60
61 @Test
62 public void testResolve() {
63
64 FreeTextTermResolver termResolver = new FreeTextTermResolver();
65 Map<String, Object> resolvedPrereqs = new HashMap<String, Object>();
66 Map<String, String> parameters = new HashMap<String, String>();
67
68 ContextInfo context = new ContextInfo();
69 context.setLocale(new LocaleInfo());
70 context.setPrincipalId("nina");
71
72 resolvedPrereqs.put(RulesExecutionConstants.CONTEXT_INFO_TERM_NAME, context);
73
74 parameters.put(KSKRMSExecutionConstants.PERSON_ID_TERM_PROPERTY, studentID);
75 parameters.put(KSKRMSExecutionConstants.CALC_TYPE_KEY_TERM_PROPERTY, CalcTypeID) ;
76
77 String result = termResolver.resolve(resolvedPrereqs,parameters ) ;
78 assertNull(result);
79 }
80
81
82
83 }