1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.student.lum.statement.service.impl; |
17 |
|
|
18 |
|
import static org.junit.Assert.assertEquals; |
19 |
|
|
20 |
|
import org.junit.BeforeClass; |
21 |
|
import org.junit.Test; |
22 |
|
import org.junit.runner.RunWith; |
23 |
|
import org.kuali.student.core.exceptions.DoesNotExistException; |
24 |
|
import org.kuali.student.core.exceptions.InvalidParameterException; |
25 |
|
import org.kuali.student.core.exceptions.MissingParameterException; |
26 |
|
import org.kuali.student.core.exceptions.OperationFailedException; |
27 |
|
import org.kuali.student.core.statement.service.StatementService; |
28 |
|
import org.springframework.beans.factory.annotation.Autowired; |
29 |
|
import org.springframework.test.context.ContextConfiguration; |
30 |
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
31 |
|
|
32 |
|
@RunWith(SpringJUnit4ClassRunner.class) |
33 |
|
@ContextConfiguration(locations={"classpath:statement-additional-context.xml"}) |
|
|
| 100% |
Uncovered Elements: 0 (73) |
Complexity: 25 |
Complexity Density: 0.52 |
|
34 |
|
public class TestStatementServiceImplForProgram { |
35 |
|
|
36 |
|
@Autowired |
37 |
|
public StatementService statementService; |
38 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
39 |
1
|
@BeforeClass... |
40 |
|
public static void beforeClass() { |
41 |
|
} |
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
46 |
1
|
@Test... |
47 |
|
public void testTranslateReqComponent_Completed1ofProgram() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
48 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-101", "KUALI.RULE", "en"); |
49 |
1
|
assertEquals("Must have successfully completed a minimum of 1 program from (Sociology, Geology) programs", nl); |
50 |
|
} |
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
55 |
1
|
@Test... |
56 |
|
public void testTranslateReqComponent_Completed2ofProgram() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
57 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-105", "KUALI.RULE", "en"); |
58 |
1
|
assertEquals("Must have successfully completed a minimum of 2 programs from (Sociology, Geology) programs", nl); |
59 |
|
} |
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
64 |
1
|
@Test... |
65 |
|
public void testTranslateReqComponent_NotCompletedAnyOfProgram() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
66 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-102", "KUALI.RULE", "en"); |
67 |
1
|
assertEquals("Must not have successfully completed any of (Sociology, Geology) programs", nl); |
68 |
|
} |
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
73 |
1
|
@Test... |
74 |
|
public void testTranslateReqComponent_NotCompletedProgram() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
75 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-108", "KUALI.RULE", "en"); |
76 |
1
|
assertEquals("Must not have successfully completed Sociology program", nl); |
77 |
|
} |
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
82 |
1
|
@Test... |
83 |
|
public void testTranslateReqComponent_CompletedAllProgram() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
84 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-103", "KUALI.RULE", "en"); |
85 |
1
|
assertEquals("Must have successfully completed all of (Sociology, Geology) programs", nl); |
86 |
|
} |
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
91 |
1
|
@Test... |
92 |
|
public void testTranslateReqComponent_CompletedSingleProgram() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
93 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-107", "KUALI.RULE", "en"); |
94 |
1
|
assertEquals("Must have successfully completed Sociology program", nl); |
95 |
|
} |
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
100 |
1
|
@Test... |
101 |
|
public void testTranslateReqComponent_1CourseCompletedFromPrograms() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
102 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-104", "KUALI.RULE", "en"); |
103 |
1
|
assertEquals("Must have successfully completed a minimum of 1 course from (Sociology, Geology) programs", nl); |
104 |
|
} |
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
109 |
1
|
@Test... |
110 |
|
public void testTranslateReqComponent_2CourseCompletedFromPrograms() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
111 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-106", "KUALI.RULE", "en"); |
112 |
1
|
assertEquals("Must have successfully completed a minimum of 2 courses from (Sociology, Geology) programs", nl); |
113 |
|
} |
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
118 |
1
|
@Test... |
119 |
|
public void testTranslateReqComponent_2CourseCompletedFrom1Program() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
120 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-109", "KUALI.RULE", "en"); |
121 |
1
|
assertEquals("Must have successfully completed a minimum of 2 courses from Sociology program", nl); |
122 |
|
} |
123 |
|
|
124 |
|
|
125 |
|
|
126 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
127 |
1
|
@Test... |
128 |
|
public void testTranslateReqComponent_admittedCreditsProgram() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
129 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-110", "KUALI.RULE", "en"); |
130 |
1
|
assertEquals("Must be admitted to program prior to earning 5 credits", nl); |
131 |
|
} |
132 |
|
|
133 |
|
|
134 |
|
|
135 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
136 |
1
|
@Test... |
137 |
|
public void testTranslateReqComponent_minTotalCredits_1Credit() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
138 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-111", "KUALI.RULE", "en"); |
139 |
1
|
assertEquals("Must have earned a minimum of 1 total credit", nl); |
140 |
|
} |
141 |
|
|
142 |
|
|
143 |
|
|
144 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
145 |
1
|
@Test... |
146 |
|
public void testTranslateReqComponent_minTotalCredits_120Credits() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
147 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-112", "KUALI.RULE", "en"); |
148 |
1
|
assertEquals("Must have earned a minimum of 120 total credits", nl); |
149 |
|
} |
150 |
|
|
151 |
|
|
152 |
|
|
153 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
154 |
1
|
@Test... |
155 |
|
public void testTranslateReqComponent_maxTotalCredits_130Credits() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
156 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-113", "KUALI.RULE", "en"); |
157 |
1
|
assertEquals("Must not have earned more than 130 credits", nl); |
158 |
|
} |
159 |
|
|
160 |
|
|
161 |
|
|
162 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
163 |
1
|
@Test... |
164 |
|
public void testTranslateReqComponent_CompletionDuration_10Credits() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
165 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-114", "KUALI.RULE", "en"); |
166 |
1
|
assertEquals("Must not exceed 10 semesters without completing program", nl); |
167 |
|
} |
168 |
|
|
169 |
|
|
170 |
|
|
171 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
172 |
1
|
@Test... |
173 |
|
public void testTranslateReqComponent_CandidateStatusDuration_3Credits() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
174 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-115", "KUALI.RULE", "en"); |
175 |
1
|
assertEquals("Must attain candidate status within 3 semesters after program entry term", nl); |
176 |
|
} |
177 |
|
|
178 |
|
|
179 |
|
|
180 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
181 |
1
|
@Test... |
182 |
|
public void testTranslateReqComponent_CompletionDurationAfterEntry_3Credits() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
183 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-116", "KUALI.RULE", "en"); |
184 |
1
|
assertEquals("Must complete program within 10 semesters after program entry term", nl); |
185 |
|
} |
186 |
|
|
187 |
|
|
188 |
|
|
189 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
190 |
1
|
@Test... |
191 |
|
public void testTranslateStatementTree() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
192 |
1
|
String nl = statementService.getNaturalLanguageForStatement("STMT-TV-1", "KUALI.RULE", "en"); |
193 |
1
|
assertEquals("Must have successfully completed all courses from (MATH152, MATH180) " + |
194 |
|
"and Must have earned a minimum GPA of 3.5 in (MATH152, MATH180) " + |
195 |
|
"and (Must have successfully completed a minimum of 1 course from (MATH152, MATH180) " + |
196 |
|
"or Permission of instructor required)", nl); |
197 |
|
} |
198 |
|
|
199 |
|
|
200 |
|
|
201 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
202 |
1
|
@Test... |
203 |
|
public void testTranslateReqComponent_kuali_reqComponent_type_program_residence_credits_final() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
204 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-117", "KUALI.RULE", "en"); |
205 |
1
|
assertEquals("Sociology students must take their final 30 credits in residence", nl); |
206 |
|
} |
207 |
|
|
208 |
|
|
209 |
|
|
210 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
211 |
1
|
@Test... |
212 |
|
public void testTranslateReqComponent_kuali_reqComponent_type_program_enrolled_credits_final() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
213 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-118", "KUALI.RULE", "en"); |
214 |
1
|
assertEquals("Sociology students must be enrolled in their graduation major for the final 30 credits taken", nl); |
215 |
|
} |
216 |
|
|
217 |
|
|
218 |
|
|
219 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
220 |
1
|
@Test... |
221 |
|
public void testTranslateReqComponent_kuali_reqComponent_type_program_minors_nof() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
222 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-119", "KUALI.RULE", "en"); |
223 |
1
|
assertEquals("Must earn no more than 2 minors as part of a program", nl); |
224 |
|
} |
225 |
|
|
226 |
|
|
227 |
|
|
228 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
229 |
1
|
@Test... |
230 |
|
public void testTranslateReqComponent_kuali_reqComponent_type_program_minor_admitted_classstanding() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
231 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-120", "KUALI.RULE", "en"); |
232 |
1
|
assertEquals("Must be admitted to a minor program only if they have junior or senior class standing", nl); |
233 |
|
} |
234 |
|
|
235 |
|
|
236 |
|
|
237 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
238 |
1
|
@Test... |
239 |
|
public void testGetNaturalLanguageForReqComponentType_kuali_reqComponent_type_course_courseset_completed_max() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
240 |
|
|
241 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-121", "KUALI.RULE", "en"); |
242 |
1
|
assertEquals("Must have successfully completed no more than 2 courses from (MATH152, MATH180)", nl); |
243 |
|
} |
244 |
|
|
245 |
|
|
246 |
|
|
247 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
248 |
1
|
@Test... |
249 |
|
public void testGetNaturalLanguageForReqComponentType_kuali_reqComponent_type_program_cumulative_gpa_min() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
250 |
|
|
251 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-122", "KUALI.RULE", "en"); |
252 |
1
|
assertEquals("Must have earned a minimum cumulative GPA of 2.5", nl); |
253 |
|
} |
254 |
|
|
255 |
|
|
256 |
|
|
257 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
258 |
1
|
@Test... |
259 |
|
public void testGetNaturalLanguageForReqComponentType_kuali_reqComponent_type_program_duration_gpa_min() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
260 |
|
|
261 |
1
|
String nl = statementService.getNaturalLanguageForReqComponent("REQCOMP-NL-123", "KUALI.RULE", "en"); |
262 |
1
|
assertEquals("Must have earned a minimum semester GPA of 3.0", nl); |
263 |
|
} |
264 |
|
} |