Clover Coverage Report - Kuali Student 1.2-M4-SNAPSHOT (Aggregated)
Coverage timestamp: Wed Jul 20 2011 11:14:35 EDT
48   264   25   1.92
0   145   0.52   25
25     1  
1    
 
  TestStatementServiceImplForProgram       Line # 34 48 0% 25 0 100% 1.0
 
  (24)
 
1    /**
2    * Copyright 2010 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.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.common.exceptions.DoesNotExistException;
24    import org.kuali.student.common.exceptions.InvalidParameterException;
25    import org.kuali.student.common.exceptions.MissingParameterException;
26    import org.kuali.student.common.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"})
 
34    public class TestStatementServiceImplForProgram {
35   
36    @Autowired
37    public StatementService statementService;
38   
 
39  1 toggle @BeforeClass
40    public static void beforeClass() {
41    }
42   
43    /**
44    * Requirement component type: kuali.reqComponent.type.program.programset.completed.nof
45    */
 
46  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.programset.completed.nof
54    */
 
55  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.programset.notcompleted.nof
63    */
 
64  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.programset.notcompleted.nof
72    */
 
73  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.programset.completed.all
81    */
 
82  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.programset.completed.all
90    */
 
91  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.programset.coursecompleted.nof
99    */
 
100  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.programset.coursecompleted.nof
108    */
 
109  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.programset.coursecompleted.nof
117    */
 
118  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.admitted.credits
126    */
 
127  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.credits.min
135    */
 
136  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.credits.min
144    */
 
145  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.credits.max
153    */
 
154  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.completion.duration
162    */
 
163  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.candidate.status.duration
171    */
 
172  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.completion.duration.afterentry
180    */
 
181  1 toggle @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    * Statement type: kuali.statement.type.program.entrance
189    */
 
190  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.residence.credits.final
201    */
 
202  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.enrolled.credits.final
210    */
 
211  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.minors.nof
219    */
 
220  1 toggle @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    * Requirement component type: kuali.reqComponent.type.program.minor.admitted.classstanding
228    */
 
229  1 toggle @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    * Requirement component type: kuali.reqComponent.type.course.courseset.completed.max
237    */
 
238  1 toggle @Test
239    public void testGetNaturalLanguageForReqComponentType_kuali_reqComponent_type_course_courseset_completed_max() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {
240    //req. type: 'kuali.reqComponent.type.course.courseset.completed.max'
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    * Requirement component type: kuali.reqComponent.type.program.cumulative.gpa.min
247    */
 
248  1 toggle @Test
249    public void testGetNaturalLanguageForReqComponentType_kuali_reqComponent_type_program_cumulative_gpa_min() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {
250    //req. type: 'kuali.reqComponent.type.program.cumulative.gpa.min'
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    * Requirement component type: kuali.reqComponent.type.program.duration.gpa.min
257    */
 
258  1 toggle @Test
259    public void testGetNaturalLanguageForReqComponentType_kuali_reqComponent_type_program_duration_gpa_min() throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException {
260    //req. type: 'kuali.reqComponent.type.program.duration.gpa.min'
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    }