How to use passed method of Requirement Package

Best Spectus_ruby code snippet using Requirement.passed

GenerateProgressSummaryTest.java

Source:GenerateProgressSummaryTest.java Github

copy

Full Screen

1package edu.umn.csci5801.test;2import static org.junit.Assert.assertEquals;3import static org.junit.Assert.fail;4import java.io.FileNotFoundException;5import java.util.ArrayList;6import java.util.List;7import edu.umn.csci5801.studentrecord.transcript.*;8import org.junit.Before;9import org.junit.Test;10import edu.umn.csci5801.GRADS;11import edu.umn.csci5801.access.AccessDeniedException;12import edu.umn.csci5801.db.DatabaseAccessException;13import edu.umn.csci5801.session.InvalidUserException;14import edu.umn.csci5801.session.Student;15import edu.umn.csci5801.studentrecord.program.Degree;16import edu.umn.csci5801.studentrecord.program.Department;17import edu.umn.csci5801.studentrecord.requirements.Milestone;18import edu.umn.csci5801.studentrecord.requirements.MilestoneSet;19import edu.umn.csci5801.studentrecord.requirements.RequirementCheckResult;20/**21 */22public class GenerateProgressSummaryTest {23 private static GRADS grads;24 /**25 * Init Grads for usage26 */27 @Before28 public void initGrad() throws Exception {29 // creating test files30 StudentRecordFactory.instantiateTestDb();31 // init Grads32 if(grads == null){33 grads = new GRADS("GRADS_Materials/Data/TestStudents.txt", "GRADS_Materials/Data/courses.txt", "GRADS_Materials/Data/TestUsers.txt");34 }35 }36 private CheckResultDetails newCheckResultDetails(float gpa, List<CourseTaken> courses,List<String> other){37 CheckResultDetails details = new CheckResultDetails();38 details.setGPA(gpa);39 details.setCourses(courses);40 details.setOther(other);41 return details;42 }43 /**44 * testing if generatateProgressSummary() would return the correct result45 * @throws Exception46 */47 @Test48 public void testGenerateProgressSummary_PHDStudent() throws Exception {49 grads.setUser("nguy0621");50 ProgressSummary progressSummary = grads.generateProgressSummary("nguy0621");51 // Create a parallel Progress Summary52 assertEquals(new Student("Luan", "Nguyen", "nguy0621"), progressSummary.getStudent());53 assertEquals(Department.COMPUTER_SCIENCE, progressSummary.getDepartment());54 assertEquals(Degree.PHD, progressSummary.getDegreeSought());55 assertEquals(new Term(Semester.SPRING, 2008), progressSummary.getTermBegan());56 assertEquals(StudentRecordFactory.LuanAdvisors(),progressSummary.getAdvisors());57 assertEquals(StudentRecordFactory.LuanCommittee(), progressSummary.getCommittee());58 assertEquals(StudentRecordFactory.notes(), progressSummary.getNotes());59 List<RequirementCheckResult> requirementCheckResultsList = progressSummary.getRequirementCheckResults();60 List<String> others = new ArrayList<String>();61 List<String> errorM = new ArrayList<String>();62 // 063 CheckResultDetails details = newCheckResultDetails((float) 4.0, StudentRecordFactory.LuanCoursesTaken(), others);64 RequirementCheckResult requirementCheckResult = new RequirementCheckResult("Theory and Algorithms",false,details);65 requirementCheckResult.setErrorMsgs(errorM);66 assertEquals(requirementCheckResultsList.get(0).getName(), requirementCheckResult.getName());67// assertEquals(requirementCheckResultsList.get(0).isPassed(), requirementCheckResult.isPassed());68// assertEquals(requirementCheckResultsList.get(0).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());69 // 170 details = newCheckResultDetails((float) 3.0, StudentRecordFactory.LuanCoursesTaken(), others);71 requirementCheckResult = new RequirementCheckResult("Architecture, Systems, and Software",false,details);72 requirementCheckResult.setErrorMsgs(errorM);73 // Name, GPA, Pass74 assertEquals(requirementCheckResultsList.get(1).getName(), requirementCheckResult.getName());75// assertEquals(requirementCheckResultsList.get(1).isPassed(), requirementCheckResult.isPassed());76// assertEquals(requirementCheckResultsList.get(1).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());77 // 278 details = newCheckResultDetails((float) 0.0, StudentRecordFactory.LuanCoursesTaken(), others);79 requirementCheckResult = new RequirementCheckResult("Applications",false,details);80 requirementCheckResult.setErrorMsgs(errorM);81 assertEquals(requirementCheckResultsList.get(2).getName(), requirementCheckResult.getName());82// assertEquals(requirementCheckResultsList.get(2).isPassed(), requirementCheckResult.isPassed());83// assertEquals(requirementCheckResultsList.get(2).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());84 // 385 details = newCheckResultDetails((float) 3.6666667, StudentRecordFactory.LuanCoursesTaken(), others);86 requirementCheckResult = new RequirementCheckResult("Breadth Requirement",false,details);87 requirementCheckResult.setErrorMsgs(errorM);88 assertEquals(requirementCheckResultsList.get(3).getName(), requirementCheckResult.getName());89 assertEquals(requirementCheckResultsList.get(3).isPassed(), requirementCheckResult.isPassed());90 assertEquals(requirementCheckResultsList.get(3).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());91 // 492 details = newCheckResultDetails((float) 0.0, StudentRecordFactory.LuanCoursesTaken(), others);93 requirementCheckResult = new RequirementCheckResult("Thesis PHD",false,details);94 requirementCheckResult.setErrorMsgs(errorM);95 assertEquals(requirementCheckResultsList.get(4).getName(), requirementCheckResult.getName());96 assertEquals(requirementCheckResultsList.get(4).isPassed(), requirementCheckResult.isPassed());97 assertEquals(requirementCheckResultsList.get(4).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());98 // 599 details = newCheckResultDetails((float) 0.0, StudentRecordFactory.LuanCoursesTaken(), others);100 requirementCheckResult = new RequirementCheckResult("Colloquium",false,details);101 requirementCheckResult.setErrorMsgs(errorM);102 assertEquals(requirementCheckResultsList.get(5).getName(), requirementCheckResult.getName());103 assertEquals(requirementCheckResultsList.get(5).isPassed(), requirementCheckResult.isPassed());104 assertEquals(requirementCheckResultsList.get(5).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());105 // 6106 details = newCheckResultDetails((float) 0.0, StudentRecordFactory.LuanCoursesTaken(), others);107 requirementCheckResult = new RequirementCheckResult("Out of Department",false,details);108 requirementCheckResult.setErrorMsgs(errorM);109 assertEquals(requirementCheckResultsList.get(6).getName(), requirementCheckResult.getName());110 assertEquals(requirementCheckResultsList.get(6).isPassed(), requirementCheckResult.isPassed());111 assertEquals(requirementCheckResultsList.get(6).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());112 // 7113 details = newCheckResultDetails((float) 0.0, StudentRecordFactory.LuanCoursesTaken(), others);114 requirementCheckResult = new RequirementCheckResult("Introduction to Research",false,details);115 requirementCheckResult.setErrorMsgs(errorM);116 assertEquals(requirementCheckResultsList.get(7).getName(), requirementCheckResult.getName());117 assertEquals(requirementCheckResultsList.get(7).isPassed(), requirementCheckResult.isPassed());118 assertEquals(requirementCheckResultsList.get(7).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());119 // 8120 details = newCheckResultDetails((float) 3.6666667, StudentRecordFactory.LuanCoursesTaken(), others);121 requirementCheckResult = new RequirementCheckResult("16 csci Credits",false,details);122 requirementCheckResult.setErrorMsgs(errorM);123 assertEquals(requirementCheckResultsList.get(8).getName(), requirementCheckResult.getName());124 assertEquals(requirementCheckResultsList.get(8).isPassed(), requirementCheckResult.isPassed());125 assertEquals(requirementCheckResultsList.get(8).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());126 // 9127 details = newCheckResultDetails((float) 3.6666667, StudentRecordFactory.LuanCoursesTaken(), others);128 requirementCheckResult = new RequirementCheckResult("Total Credits",false,details);129 requirementCheckResult.setErrorMsgs(errorM);130 assertEquals(requirementCheckResultsList.get(9).getName(), requirementCheckResult.getName());131 assertEquals(requirementCheckResultsList.get(9).isPassed(), requirementCheckResult.isPassed());132 assertEquals(requirementCheckResultsList.get(9).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());133 // 10134 details = newCheckResultDetails((float) 3.6666667, StudentRecordFactory.LuanCoursesTaken(), others);135 requirementCheckResult = new RequirementCheckResult("Other Course Requirements",false,details);136 requirementCheckResult.setErrorMsgs(errorM);137 assertEquals(requirementCheckResultsList.get(10).getName(), requirementCheckResult.getName());138 assertEquals(requirementCheckResultsList.get(10).isPassed(), requirementCheckResult.isPassed());139 assertEquals(requirementCheckResultsList.get(10).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());140 // 11141 details = newCheckResultDetails((float) 3.6666667, StudentRecordFactory.LuanCoursesTaken(), others);142 requirementCheckResult = new RequirementCheckResult("Overall GPA",true,details);143 requirementCheckResult.setErrorMsgs(errorM);144 assertEquals(requirementCheckResultsList.get(11).getName(), requirementCheckResult.getName());145 assertEquals(requirementCheckResultsList.get(11).isPassed(), requirementCheckResult.isPassed());146 assertEquals(requirementCheckResultsList.get(11).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());147 // 12148 details = newCheckResultDetails((float) 3.6666667, StudentRecordFactory.LuanCoursesTaken(), others);149 requirementCheckResult = new RequirementCheckResult("In Program GPA",true,details);150 requirementCheckResult.setErrorMsgs(errorM);151 assertEquals(requirementCheckResultsList.get(12).getName(), requirementCheckResult.getName());152 assertEquals(requirementCheckResultsList.get(12).isPassed(), requirementCheckResult.isPassed());153 assertEquals(requirementCheckResultsList.get(12).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());154 // 13155 details = newCheckResultDetails((float) 3.6666667, StudentRecordFactory.LuanCoursesTaken(), others);156 requirementCheckResult = new RequirementCheckResult("Other GPA Requirements",true,details);157 requirementCheckResult.setErrorMsgs(errorM);158 assertEquals(requirementCheckResultsList.get(13).getName(), requirementCheckResult.getName());159 assertEquals(requirementCheckResultsList.get(13).isPassed(), requirementCheckResult.isPassed());160 assertEquals(requirementCheckResultsList.get(13).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());161 // 14162 details = newCheckResultDetails((float) 0.0, StudentRecordFactory.LuanCoursesTaken(), others);163 requirementCheckResult = new RequirementCheckResult("Milestones",false,details);164 requirementCheckResult.setErrorMsgs(errorM);165 assertEquals(requirementCheckResultsList.get(14).getName(), requirementCheckResult.getName());166 assertEquals(requirementCheckResultsList.get(14).isPassed(), requirementCheckResult.isPassed());167 }168 /**169 * testing if generatateProgressSummary() would return the correct result170 * @throws Exception171 */172 @Test173 public void testGenerateProgressSummary_PHDStudent_SomeRequirementsCompleted() throws Exception {174 grads.setUser("phd333");175 ProgressSummary progressSummary = grads.generateProgressSummary("phd333");176 // Create a parallel Progress Summary177 assertEquals(new Student("PHD", "Student", "phd333"), progressSummary.getStudent());178 assertEquals(Department.COMPUTER_SCIENCE, progressSummary.getDepartment());179 assertEquals(Degree.PHD, progressSummary.getDegreeSought());180 assertEquals(new Term(Semester.SPRING, 2008), progressSummary.getTermBegan());181 assertEquals(StudentRecordFactory.LuanAdvisors(),progressSummary.getAdvisors());182 assertEquals(StudentRecordFactory.LuanCommittee(), progressSummary.getCommittee());183 assertEquals(StudentRecordFactory.notes(), progressSummary.getNotes());184 List<RequirementCheckResult> requirementCheckResultsList = progressSummary.getRequirementCheckResults();185 List<String> others = new ArrayList<String>();186 List<String> errorM = new ArrayList<String>();187 List<CourseTaken> courseTaken= StudentRecordFactory.PHDCoursesTaken();188 // 0189 CheckResultDetails details = newCheckResultDetails((float) 3.5, StudentRecordFactory.LuanCoursesTaken(), others);190 RequirementCheckResult requirementCheckResult = new RequirementCheckResult("Theory and Algorithms",false,details);191 requirementCheckResult.setErrorMsgs(errorM);192 assertEquals(requirementCheckResultsList.get(0).getName(), requirementCheckResult.getName());193// assertEquals(requirementCheckResultsList.get(0).isPassed(), requirementCheckResult.isPassed());194 //assertEquals(requirementCheckResultsList.get(0).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());195 // 1196 details = newCheckResultDetails((float) 3.5, courseTaken, others);197 requirementCheckResult = new RequirementCheckResult("Architecture, Systems, and Software",false,details);198 requirementCheckResult.setErrorMsgs(errorM);199 // Name, GPA, Pass200 assertEquals(requirementCheckResultsList.get(1).getName(), requirementCheckResult.getName());201// assertEquals(requirementCheckResultsList.get(1).isPassed(), requirementCheckResult.isPassed());202 //assertEquals(requirementCheckResultsList.get(1).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());203 // 2204 details = newCheckResultDetails((float) 4.0, courseTaken, others);205 requirementCheckResult = new RequirementCheckResult("Applications",false,details);206 requirementCheckResult.setErrorMsgs(errorM);207 assertEquals(requirementCheckResultsList.get(2).getName(), requirementCheckResult.getName());208// assertEquals(requirementCheckResultsList.get(2).isPassed(), requirementCheckResult.isPassed());209 //assertEquals(requirementCheckResultsList.get(2).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());210 // 3211 details = newCheckResultDetails((float) 3.6, courseTaken, others);212 requirementCheckResult = new RequirementCheckResult("Breadth Requirement",true,details);213 requirementCheckResult.setErrorMsgs(errorM);214 assertEquals(requirementCheckResultsList.get(3).getName(), requirementCheckResult.getName());215 assertEquals(requirementCheckResultsList.get(3).isPassed(), requirementCheckResult.isPassed());216 assertEquals(requirementCheckResultsList.get(3).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());217 // 4218 details = newCheckResultDetails((float) 0.0, courseTaken, others);219 requirementCheckResult = new RequirementCheckResult("Thesis PHD",false,details);220 requirementCheckResult.setErrorMsgs(errorM);221 assertEquals(requirementCheckResultsList.get(4).getName(), requirementCheckResult.getName());222 assertEquals(requirementCheckResultsList.get(4).isPassed(), requirementCheckResult.isPassed());223 assertEquals(requirementCheckResultsList.get(4).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());224 // 5225 details = newCheckResultDetails((float) 4.0, courseTaken, others);226 requirementCheckResult = new RequirementCheckResult("Colloquium",true,details);227 requirementCheckResult.setErrorMsgs(errorM);228 assertEquals(requirementCheckResultsList.get(5).getName(), requirementCheckResult.getName());229 assertEquals(requirementCheckResultsList.get(5).isPassed(), requirementCheckResult.isPassed());230 // 6231 details = newCheckResultDetails((float) 0.0, courseTaken, others);232 requirementCheckResult = new RequirementCheckResult("Out of Department",false,details);233 requirementCheckResult.setErrorMsgs(errorM);234 assertEquals(requirementCheckResultsList.get(6).getName(), requirementCheckResult.getName());235 assertEquals(requirementCheckResultsList.get(6).isPassed(), requirementCheckResult.isPassed());236 assertEquals(requirementCheckResultsList.get(6).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());237 // 7238 details = newCheckResultDetails((float) 4.0, courseTaken, others);239 requirementCheckResult = new RequirementCheckResult("Introduction to Research",true,details);240 requirementCheckResult.setErrorMsgs(errorM);241 assertEquals(requirementCheckResultsList.get(7).getName(), requirementCheckResult.getName());242 assertEquals(requirementCheckResultsList.get(7).isPassed(), requirementCheckResult.isPassed());243 // 8244 details = newCheckResultDetails((float) 3.6, courseTaken, others);245 requirementCheckResult = new RequirementCheckResult("16 csci Credits",true,details);246 requirementCheckResult.setErrorMsgs(errorM);247 assertEquals(requirementCheckResultsList.get(8).getName(), requirementCheckResult.getName());248 assertEquals(requirementCheckResultsList.get(8).isPassed(), requirementCheckResult.isPassed());249 assertEquals(requirementCheckResultsList.get(8).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());250 // 9251 details = newCheckResultDetails((float) 3.6, courseTaken, others);252 requirementCheckResult = new RequirementCheckResult("Total Credits",false,details);253 requirementCheckResult.setErrorMsgs(errorM);254 assertEquals(requirementCheckResultsList.get(9).getName(), requirementCheckResult.getName());255 assertEquals(requirementCheckResultsList.get(9).isPassed(), requirementCheckResult.isPassed());256 assertEquals(requirementCheckResultsList.get(9).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());257 // 10258 details = newCheckResultDetails((float) 3.6, courseTaken, others);259 requirementCheckResult = new RequirementCheckResult("Other Course Requirements",false,details);260 requirementCheckResult.setErrorMsgs(errorM);261 assertEquals(requirementCheckResultsList.get(10).getName(), requirementCheckResult.getName());262 assertEquals(requirementCheckResultsList.get(10).isPassed(), requirementCheckResult.isPassed());263 assertEquals(requirementCheckResultsList.get(10).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());264 // 11265 details = newCheckResultDetails((float) 3.6, courseTaken, others);266 requirementCheckResult = new RequirementCheckResult("Overall GPA",true,details);267 requirementCheckResult.setErrorMsgs(errorM);268 assertEquals(requirementCheckResultsList.get(11).getName(), requirementCheckResult.getName());269 assertEquals(requirementCheckResultsList.get(11).isPassed(), requirementCheckResult.isPassed());270 assertEquals(requirementCheckResultsList.get(11).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());271 // 12272 details = newCheckResultDetails((float) 3.6, courseTaken, others);273 requirementCheckResult = new RequirementCheckResult("In Program GPA",true,details);274 requirementCheckResult.setErrorMsgs(errorM);275 assertEquals(requirementCheckResultsList.get(12).getName(), requirementCheckResult.getName());276 assertEquals(requirementCheckResultsList.get(12).isPassed(), requirementCheckResult.isPassed());277 assertEquals(requirementCheckResultsList.get(12).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());278 // 13279 details = newCheckResultDetails((float) 3.6, courseTaken, others);280 requirementCheckResult = new RequirementCheckResult("Other GPA Requirements",true,details);281 requirementCheckResult.setErrorMsgs(errorM);282 assertEquals(requirementCheckResultsList.get(13).getName(), requirementCheckResult.getName());283 assertEquals(requirementCheckResultsList.get(13).isPassed(), requirementCheckResult.isPassed());284 assertEquals(requirementCheckResultsList.get(13).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());285 // 14286 details = newCheckResultDetails((float) 0.0, courseTaken, others);287 requirementCheckResult = new RequirementCheckResult("Milestones",false,details);288 requirementCheckResult.setErrorMsgs(errorM);289 assertEquals(requirementCheckResultsList.get(14).getName(), requirementCheckResult.getName());290 assertEquals(requirementCheckResultsList.get(14).isPassed(), requirementCheckResult.isPassed());291 }292 /**293 * testing if generatateProgressSummary() would return the correct result294 * @throws Exception295 */296 @Test297 public void testGenerateProgressSummary_MS_A() throws Exception {298 grads.setUser("gayxx067");299 ProgressSummary progressSummary = grads.generateProgressSummary("gayxx067");300 // Create a parallel Progress Summary301 assertEquals(new Student("Gregory", "Gay", "gayxx067").getId(), progressSummary.getStudent().getId());302 assertEquals(Department.COMPUTER_SCIENCE, progressSummary.getDepartment());303 assertEquals(Degree.MS_A, progressSummary.getDegreeSought());304 assertEquals(new Term(Semester.SPRING, 2009), progressSummary.getTermBegan());305 assertEquals(StudentRecordFactory.GregAdvisors(),progressSummary.getAdvisors());306 assertEquals(StudentRecordFactory.GregCommittee(), progressSummary.getCommittee());307 assertEquals(StudentRecordFactory.notes(), progressSummary.getNotes());308 List<RequirementCheckResult> requirementCheckResultsList = progressSummary.getRequirementCheckResults();309 List<String> others = new ArrayList<String>();310 List<String> errorM = new ArrayList<String>();311 List<CourseTaken> courseTaken= StudentRecordFactory.GregCoursesTaken();312 // 0313 CheckResultDetails details = newCheckResultDetails((float) 0.0, courseTaken, others);314 RequirementCheckResult requirementCheckResult = new RequirementCheckResult("Theory and Algorithms",false,details);315 requirementCheckResult.setErrorMsgs(errorM);316 assertEquals(requirementCheckResultsList.get(0).getName(), requirementCheckResult.getName());317// assertEquals(requirementCheckResultsList.get(0).isPassed(), requirementCheckResult.isPassed());318 //assertEquals(requirementCheckResultsList.get(0).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());319 // 1320 details = newCheckResultDetails((float) 3.5, courseTaken , others);321 requirementCheckResult = new RequirementCheckResult("Architecture, Systems, and Software",false,details);322 requirementCheckResult.setErrorMsgs(errorM);323 // Name, GPA, Pass324 assertEquals(requirementCheckResultsList.get(1).getName(), requirementCheckResult.getName());325// assertEquals(requirementCheckResultsList.get(1).isPassed(), requirementCheckResult.isPassed());326 //assertEquals(requirementCheckResultsList.get(1).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());327 // 2328 details = newCheckResultDetails((float) 2.0, courseTaken, others);329 requirementCheckResult = new RequirementCheckResult("Applications",false,details);330 requirementCheckResult.setErrorMsgs(errorM);331 assertEquals(requirementCheckResultsList.get(2).getName(), requirementCheckResult.getName());332// assertEquals(requirementCheckResultsList.get(2).isPassed(), requirementCheckResult.isPassed());333 //assertEquals(requirementCheckResultsList.get(2).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());334 // 3335 details = newCheckResultDetails((float) 3.0, courseTaken, others);336 requirementCheckResult = new RequirementCheckResult("Breadth Requirement",false,details);337 requirementCheckResult.setErrorMsgs(errorM);338 assertEquals(requirementCheckResultsList.get(3).getName(), requirementCheckResult.getName());339 assertEquals(requirementCheckResultsList.get(3).isPassed(), requirementCheckResult.isPassed());340 assertEquals(requirementCheckResultsList.get(3).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());341 // 4342 details = newCheckResultDetails((float) 0.0, courseTaken, others);343 requirementCheckResult = new RequirementCheckResult("Thesis MS",false,details);344 requirementCheckResult.setErrorMsgs(errorM);345 assertEquals(requirementCheckResultsList.get(4).getName(), requirementCheckResult.getName());346 assertEquals(requirementCheckResultsList.get(4).isPassed(), requirementCheckResult.isPassed());347 assertEquals(requirementCheckResultsList.get(4).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());348 // 5349 details = newCheckResultDetails((float) 0.0, courseTaken, others);350 requirementCheckResult = new RequirementCheckResult("Colloquium",false,details);351 requirementCheckResult.setErrorMsgs(errorM);352 assertEquals(requirementCheckResultsList.get(5).getName(), requirementCheckResult.getName());353 assertEquals(requirementCheckResultsList.get(5).isPassed(), requirementCheckResult.isPassed());354 assertEquals(requirementCheckResultsList.get(5).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());355 // 6356 details = newCheckResultDetails((float) 0.0, courseTaken, others);357 requirementCheckResult = new RequirementCheckResult("PHD Level Courses",false,details);358 requirementCheckResult.setErrorMsgs(errorM);359 assertEquals(requirementCheckResultsList.get(6).getName(), requirementCheckResult.getName());360 assertEquals(requirementCheckResultsList.get(6).isPassed(), requirementCheckResult.isPassed());361 assertEquals(requirementCheckResultsList.get(6).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());362 // 7363 details = newCheckResultDetails((float) 3.0, courseTaken, others);364 requirementCheckResult = new RequirementCheckResult("Total Credits",false,details);365 requirementCheckResult.setErrorMsgs(errorM);366 assertEquals(requirementCheckResultsList.get(7).getName(), requirementCheckResult.getName());367 assertEquals(requirementCheckResultsList.get(7).isPassed(), requirementCheckResult.isPassed());368 assertEquals(requirementCheckResultsList.get(7).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());369 // 8370 details = newCheckResultDetails((float) 3.0, courseTaken, others);371 requirementCheckResult = new RequirementCheckResult("16 csci Credits",false,details);372 requirementCheckResult.setErrorMsgs(errorM);373 assertEquals(requirementCheckResultsList.get(8).getName(), requirementCheckResult.getName());374 assertEquals(requirementCheckResultsList.get(8).isPassed(), requirementCheckResult.isPassed());375 assertEquals(requirementCheckResultsList.get(8).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());376 // 9377 details = newCheckResultDetails((float) 3.0, courseTaken, others);378 requirementCheckResult = new RequirementCheckResult("22 Course Credits",false,details);379 requirementCheckResult.setErrorMsgs(errorM);380 assertEquals(requirementCheckResultsList.get(9).getName(), requirementCheckResult.getName());381 assertEquals(requirementCheckResultsList.get(9).isPassed(), requirementCheckResult.isPassed());382 assertEquals(requirementCheckResultsList.get(9).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());383 // 10384 details = newCheckResultDetails((float) 3.0, courseTaken, others);385 requirementCheckResult = new RequirementCheckResult("Course Credits",false,details);386 requirementCheckResult.setErrorMsgs(errorM);387 assertEquals(requirementCheckResultsList.get(10).getName(), requirementCheckResult.getName());388 assertEquals(requirementCheckResultsList.get(10).isPassed(), requirementCheckResult.isPassed());389 // 11390 details = newCheckResultDetails((float) 3.0, courseTaken, others);391 requirementCheckResult = new RequirementCheckResult("Other Course Requirements",false,details);392 requirementCheckResult.setErrorMsgs(errorM);393 assertEquals(requirementCheckResultsList.get(11).getName(), requirementCheckResult.getName());394 assertEquals(requirementCheckResultsList.get(11).isPassed(), requirementCheckResult.isPassed());395 // 12396 details = newCheckResultDetails((float) 3.0, courseTaken, others);397 requirementCheckResult = new RequirementCheckResult("Overall GPA",false,details);398 requirementCheckResult.setErrorMsgs(errorM);399 assertEquals(requirementCheckResultsList.get(12).getName(), requirementCheckResult.getName());400 assertEquals(requirementCheckResultsList.get(12).isPassed(), requirementCheckResult.isPassed());401 assertEquals(requirementCheckResultsList.get(12).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());402 // 13403 details = newCheckResultDetails((float) 3.0, courseTaken, others);404 requirementCheckResult = new RequirementCheckResult("In Program GPA",false,details);405 requirementCheckResult.setErrorMsgs(errorM);406 assertEquals(requirementCheckResultsList.get(13).getName(), requirementCheckResult.getName());407 assertEquals(requirementCheckResultsList.get(13).isPassed(), requirementCheckResult.isPassed());408 assertEquals(requirementCheckResultsList.get(13).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());409 // 14410 details = newCheckResultDetails((float) 3.0, courseTaken, others);411 requirementCheckResult = new RequirementCheckResult("Other GPA Requirements",false,details);412 requirementCheckResult.setErrorMsgs(errorM);413 assertEquals(requirementCheckResultsList.get(14).getName(), requirementCheckResult.getName());414 assertEquals(requirementCheckResultsList.get(14).isPassed(), requirementCheckResult.isPassed());415 assertEquals(requirementCheckResultsList.get(14).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());416 // 15417 details = newCheckResultDetails((float) 0.0, courseTaken, others);418 requirementCheckResult = new RequirementCheckResult("Milestones",false,details);419 requirementCheckResult.setErrorMsgs(errorM);420 assertEquals(requirementCheckResultsList.get(15).getName(), requirementCheckResult.getName());421 assertEquals(requirementCheckResultsList.get(15).isPassed(), requirementCheckResult.isPassed());422 }423 /**424 * testing if generatateProgressSummary() would return the correct result425 * @throws Exception426 */427 @Test428 public void testGenerateProgressSummary_MS_B() throws Exception {429 grads.setUser("desil1337");430 ProgressSummary progressSummary = grads.generateProgressSummary("desil1337");431 // Create a parallel Progress Summary432 assertEquals(new Student("Ian", "De Silva", "desil1337"), progressSummary.getStudent());433 assertEquals(Department.COMPUTER_SCIENCE, progressSummary.getDepartment());434 assertEquals(Degree.MS_B, progressSummary.getDegreeSought());435 assertEquals(new Term(Semester.SPRING, 2010), progressSummary.getTermBegan());436 assertEquals(StudentRecordFactory.IanAdvisors(),progressSummary.getAdvisors());437 assertEquals(StudentRecordFactory.IanCommittee(), progressSummary.getCommittee());438 assertEquals(StudentRecordFactory.notes(), progressSummary.getNotes());439 List<RequirementCheckResult> requirementCheckResultsList = progressSummary.getRequirementCheckResults();440 List<String> others = new ArrayList<String>();441 List<String> errorM = new ArrayList<String>();442 List<CourseTaken> courseTaken= StudentRecordFactory.IanCoursesTaken();443 // 0444 CheckResultDetails details = newCheckResultDetails((float) 4.0, courseTaken, others);445 RequirementCheckResult requirementCheckResult = new RequirementCheckResult("Theory and Algorithms",false,details);446 requirementCheckResult.setErrorMsgs(errorM);447 assertEquals(requirementCheckResultsList.get(0).getName(), requirementCheckResult.getName());448// assertEquals(requirementCheckResultsList.get(0).isPassed(), requirementCheckResult.isPassed());449// assertEquals(requirementCheckResultsList.get(0).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());450 // 1451 details = newCheckResultDetails((float) 3.0, courseTaken , others);452 requirementCheckResult = new RequirementCheckResult("Architecture, Systems, and Software",false,details);453 requirementCheckResult.setErrorMsgs(errorM);454 // Name, GPA, Pass455 assertEquals(requirementCheckResultsList.get(1).getName(), requirementCheckResult.getName());456// assertEquals(requirementCheckResultsList.get(1).isPassed(), requirementCheckResult.isPassed());457// assertEquals(requirementCheckResultsList.get(1).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());458 // 2459 details = newCheckResultDetails((float) 3.0, courseTaken, others);460 requirementCheckResult = new RequirementCheckResult("Applications",false,details);461 requirementCheckResult.setErrorMsgs(errorM);462 assertEquals(requirementCheckResultsList.get(2).getName(), requirementCheckResult.getName());463// assertEquals(requirementCheckResultsList.get(2).isPassed(), requirementCheckResult.isPassed());464// assertEquals(requirementCheckResultsList.get(2).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());465 // 3466 details = newCheckResultDetails((float) 3.3333333, courseTaken, others);467 requirementCheckResult = new RequirementCheckResult("Breadth Requirement",true,details);468 requirementCheckResult.setErrorMsgs(errorM);469 assertEquals(requirementCheckResultsList.get(3).getName(), requirementCheckResult.getName());470 assertEquals(requirementCheckResultsList.get(3).isPassed(), requirementCheckResult.isPassed());471 assertEquals(requirementCheckResultsList.get(3).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());472 // 4473 details = newCheckResultDetails((float) 4.0, courseTaken, others);474 requirementCheckResult = new RequirementCheckResult("Plan B Project",true,details);475 requirementCheckResult.setErrorMsgs(errorM);476 assertEquals(requirementCheckResultsList.get(4).getName(), requirementCheckResult.getName());477 assertEquals(requirementCheckResultsList.get(4).isPassed(), requirementCheckResult.isPassed());478 assertEquals(requirementCheckResultsList.get(4).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());479 // 5480 details = newCheckResultDetails((float) 4.0, courseTaken, others);481 requirementCheckResult = new RequirementCheckResult("Colloquium",true,details);482 requirementCheckResult.setErrorMsgs(errorM);483 assertEquals(requirementCheckResultsList.get(5).getName(), requirementCheckResult.getName());484 assertEquals(requirementCheckResultsList.get(5).isPassed(), requirementCheckResult.isPassed());485// assertEquals(requirementCheckResultsList.get(5).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());486 // 6487 details = newCheckResultDetails((float) 0.0, courseTaken, others);488 requirementCheckResult = new RequirementCheckResult("PHD Level Courses",false,details);489 requirementCheckResult.setErrorMsgs(errorM);490 assertEquals(requirementCheckResultsList.get(6).getName(), requirementCheckResult.getName());491 assertEquals(requirementCheckResultsList.get(6).isPassed(), requirementCheckResult.isPassed());492 assertEquals(requirementCheckResultsList.get(6).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());493 // 7494 details = newCheckResultDetails((float) 3.5384615, courseTaken, others);495 requirementCheckResult = new RequirementCheckResult("16 csci Credits",false,details);496 requirementCheckResult.setErrorMsgs(errorM);497 assertEquals(requirementCheckResultsList.get(7).getName(), requirementCheckResult.getName());498 assertEquals(requirementCheckResultsList.get(7).isPassed(), requirementCheckResult.isPassed());499 assertEquals(requirementCheckResultsList.get(7).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());500 // 8501 details = newCheckResultDetails((float) 3.5384615, courseTaken, others);502 requirementCheckResult = new RequirementCheckResult("31 Course Credits",false,details);503 requirementCheckResult.setErrorMsgs(errorM);504 assertEquals(requirementCheckResultsList.get(8).getName(), requirementCheckResult.getName());505 assertEquals(requirementCheckResultsList.get(8).isPassed(), requirementCheckResult.isPassed());506 assertEquals(requirementCheckResultsList.get(8).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());507 // 9508 details = newCheckResultDetails((float) 3.5384615, courseTaken, others);509 requirementCheckResult = new RequirementCheckResult("Total Credits",false,details);510 requirementCheckResult.setErrorMsgs(errorM);511 assertEquals(requirementCheckResultsList.get(9).getName(), requirementCheckResult.getName());512 assertEquals(requirementCheckResultsList.get(9).isPassed(), requirementCheckResult.isPassed());513 assertEquals(requirementCheckResultsList.get(9).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());514 // 10515 details = newCheckResultDetails((float) 3.5384615, courseTaken, others);516 requirementCheckResult = new RequirementCheckResult("Other Course Requirements",false,details);517 requirementCheckResult.setErrorMsgs(errorM);518 assertEquals(requirementCheckResultsList.get(10).getName(), requirementCheckResult.getName());519 assertEquals(requirementCheckResultsList.get(10).isPassed(), requirementCheckResult.isPassed());520 // 11521 details = newCheckResultDetails((float) 3.5384615, courseTaken, others);522 requirementCheckResult = new RequirementCheckResult("Overall GPA",false,details);523 requirementCheckResult.setErrorMsgs(errorM);524 assertEquals(requirementCheckResultsList.get(11).getName(), requirementCheckResult.getName());525 assertEquals(requirementCheckResultsList.get(11).isPassed(), requirementCheckResult.isPassed());526 assertEquals(requirementCheckResultsList.get(11).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());527 // 12528 details = newCheckResultDetails((float) 3.5384615, courseTaken, others);529 requirementCheckResult = new RequirementCheckResult("In Program GPA",false,details);530 requirementCheckResult.setErrorMsgs(errorM);531 assertEquals(requirementCheckResultsList.get(12).getName(), requirementCheckResult.getName());532 assertEquals(requirementCheckResultsList.get(12).isPassed(), requirementCheckResult.isPassed());533 assertEquals(requirementCheckResultsList.get(12).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());534 // 13535 details = newCheckResultDetails((float) 3.5384615, courseTaken, others);536 requirementCheckResult = new RequirementCheckResult("Other GPA Requirements",false,details);537 requirementCheckResult.setErrorMsgs(errorM);538 assertEquals(requirementCheckResultsList.get(13).getName(), requirementCheckResult.getName());539 assertEquals(requirementCheckResultsList.get(13).isPassed(), requirementCheckResult.isPassed());540 assertEquals(requirementCheckResultsList.get(13).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());541 // 14542 details = newCheckResultDetails((float) 0.0, courseTaken, others);543 requirementCheckResult = new RequirementCheckResult("Milestones",false,details);544 requirementCheckResult.setErrorMsgs(errorM);545 assertEquals(requirementCheckResultsList.get(14).getName(), requirementCheckResult.getName());546 assertEquals(requirementCheckResultsList.get(14).isPassed(), requirementCheckResult.isPassed());547 }548 /**549 * testing if generatateProgressSummary() would return the correct result550 * @throws Exception551 */552 @Test553 public void testGenerateProgressSummary_MS_C() throws Exception {554 grads.setUser("1111");555 ProgressSummary progressSummary = grads.generateProgressSummary("1111");556 // Create a parallel Progress Summary557 assertEquals(new Student("Catherine", "Reed", "1111"), progressSummary.getStudent());558 assertEquals(Department.COMPUTER_SCIENCE, progressSummary.getDepartment());559 assertEquals(Degree.MS_C, progressSummary.getDegreeSought());560 assertEquals(new Term(Semester.SPRING, 2011), progressSummary.getTermBegan());561 assertEquals(StudentRecordFactory.CatherineAdvisors(),progressSummary.getAdvisors());562 assertEquals(StudentRecordFactory.CatherineCommittee(), progressSummary.getCommittee());563 assertEquals(StudentRecordFactory.notes(), progressSummary.getNotes());564 List<RequirementCheckResult> requirementCheckResultsList = progressSummary.getRequirementCheckResults();565 List<String> others = new ArrayList<String>();566 List<String> errorM = new ArrayList<String>();567 List<CourseTaken> courseTaken= StudentRecordFactory.CatherineCoursesTaken();568 // 0 Take all Theory Class569 CheckResultDetails details = newCheckResultDetails((float) 3.5, courseTaken, others);570 RequirementCheckResult requirementCheckResult = new RequirementCheckResult("Theory and Algorithms",false,details);571 requirementCheckResult.setErrorMsgs(errorM);572 assertEquals(requirementCheckResultsList.get(0).getName(), requirementCheckResult.getName());573// assertEquals(requirementCheckResultsList.get(0).isPassed(), requirementCheckResult.isPassed());574 //assertEquals(requirementCheckResultsList.get(0).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());575 // 1576 details = newCheckResultDetails((float) 0.0, courseTaken , others);577 requirementCheckResult = new RequirementCheckResult("Architecture, Systems, and Software",false,details);578 requirementCheckResult.setErrorMsgs(errorM);579 // Name, GPA, Pass580 assertEquals(requirementCheckResultsList.get(1).getName(), requirementCheckResult.getName());581// assertEquals(requirementCheckResultsList.get(1).isPassed(), requirementCheckResult.isPassed());582 //assertEquals(requirementCheckResultsList.get(1).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());583 // 2584 details = newCheckResultDetails((float) 4.0, courseTaken, others);585 requirementCheckResult = new RequirementCheckResult("Applications",false,details);586 requirementCheckResult.setErrorMsgs(errorM);587 assertEquals(requirementCheckResultsList.get(2).getName(), requirementCheckResult.getName());588// assertEquals(requirementCheckResultsList.get(2).isPassed(), requirementCheckResult.isPassed());589 //assertEquals(requirementCheckResultsList.get(2).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());590 // 3 //Only calculate for top class in each category591 details = newCheckResultDetails((float) 3.6666667, courseTaken, others);592 requirementCheckResult = new RequirementCheckResult("Breadth Requirement",false,details);593 requirementCheckResult.setErrorMsgs(errorM);594 assertEquals(requirementCheckResultsList.get(3).getName(), requirementCheckResult.getName());595 assertEquals(requirementCheckResultsList.get(3).isPassed(), requirementCheckResult.isPassed());596 assertEquals(requirementCheckResultsList.get(3).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());597 // 4598 details = newCheckResultDetails((float) 0.0, courseTaken, others);599 requirementCheckResult = new RequirementCheckResult("PHD Level Courses - Plan C",false,details);600 requirementCheckResult.setErrorMsgs(errorM);601 assertEquals(requirementCheckResultsList.get(5).getName(), requirementCheckResult.getName());602 assertEquals(requirementCheckResultsList.get(5).isPassed(), requirementCheckResult.isPassed());603 assertEquals(requirementCheckResultsList.get(5).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());604 // 5605 details = newCheckResultDetails((float) 0.0, courseTaken, others);606 requirementCheckResult = new RequirementCheckResult("Colloquium",false,details);607 requirementCheckResult.setErrorMsgs(errorM);608 assertEquals(requirementCheckResultsList.get(5).getName(), requirementCheckResult.getName());609 assertEquals(requirementCheckResultsList.get(5).isPassed(), requirementCheckResult.isPassed());610 assertEquals(requirementCheckResultsList.get(5).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());611 // 6612 details = newCheckResultDetails((float) 3.6666667, courseTaken, others);613 requirementCheckResult = new RequirementCheckResult("16 csci Credits",false,details);614 requirementCheckResult.setErrorMsgs(errorM);615 assertEquals(requirementCheckResultsList.get(6).getName(), requirementCheckResult.getName());616 assertEquals(requirementCheckResultsList.get(6).isPassed(), requirementCheckResult.isPassed());617 assertEquals(requirementCheckResultsList.get(6).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());618 // 7619 details = newCheckResultDetails((float) 3.6666667, courseTaken, others);620 requirementCheckResult = new RequirementCheckResult("31 Course Credits",false,details);621 requirementCheckResult.setErrorMsgs(errorM);622 assertEquals(requirementCheckResultsList.get(7).getName(), requirementCheckResult.getName());623 assertEquals(requirementCheckResultsList.get(7).isPassed(), requirementCheckResult.isPassed());624 assertEquals(requirementCheckResultsList.get(7).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());625 // 8626 details = newCheckResultDetails((float) 3.6666667, courseTaken, others);627 requirementCheckResult = new RequirementCheckResult("Total Credits",false,details);628 requirementCheckResult.setErrorMsgs(errorM);629 assertEquals(requirementCheckResultsList.get(8).getName(), requirementCheckResult.getName());630 assertEquals(requirementCheckResultsList.get(8).isPassed(), requirementCheckResult.isPassed());631 assertEquals(requirementCheckResultsList.get(8).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());632 // 9633 details = newCheckResultDetails((float) 3.6666667, courseTaken, others);634 requirementCheckResult = new RequirementCheckResult("Other Course Requirements",false,details);635 requirementCheckResult.setErrorMsgs(errorM);636 assertEquals(requirementCheckResultsList.get(9).getName(), requirementCheckResult.getName());637 assertEquals(requirementCheckResultsList.get(9).isPassed(), requirementCheckResult.isPassed());638 // 10639 details = newCheckResultDetails((float) 3.5384615, courseTaken, others);640 requirementCheckResult = new RequirementCheckResult("Overall GPA",false,details);641 requirementCheckResult.setErrorMsgs(errorM);642 assertEquals(requirementCheckResultsList.get(10).getName(), requirementCheckResult.getName());643 assertEquals(requirementCheckResultsList.get(10).isPassed(), requirementCheckResult.isPassed());644 assertEquals(requirementCheckResultsList.get(10).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());645 // 11646 details = newCheckResultDetails((float) 3.6666667, courseTaken, others);647 requirementCheckResult = new RequirementCheckResult("In Program GPA",false,details);648 requirementCheckResult.setErrorMsgs(errorM);649 assertEquals(requirementCheckResultsList.get(11).getName(), requirementCheckResult.getName());650 assertEquals(requirementCheckResultsList.get(11).isPassed(), requirementCheckResult.isPassed());651 assertEquals(requirementCheckResultsList.get(11).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());652 // 12653 details = newCheckResultDetails((float) 3.6666667, courseTaken, others);654 requirementCheckResult = new RequirementCheckResult("Other GPA Requirements",false,details);655 requirementCheckResult.setErrorMsgs(errorM);656 assertEquals(requirementCheckResultsList.get(12).getName(), requirementCheckResult.getName());657 assertEquals(requirementCheckResultsList.get(12).isPassed(), requirementCheckResult.isPassed());658 assertEquals(requirementCheckResultsList.get(12).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());659 // 13660 details = newCheckResultDetails((float) 0.0, courseTaken, others);661 requirementCheckResult = new RequirementCheckResult("Milestones",false,details);662 requirementCheckResult.setErrorMsgs(errorM);663 assertEquals(requirementCheckResultsList.get(13).getName(), requirementCheckResult.getName());664 assertEquals(requirementCheckResultsList.get(13).isPassed(), requirementCheckResult.isPassed());665 }666 /* checking to see if a class exists in the list of RequirementCheckResults667 * @param courseName668 * @param results669 * @return670 */671 private boolean checkForCourseName(String courseName, List< RequirementCheckResult > results) {672 for(RequirementCheckResult r : results) {673 if(courseName.equals(r.getName())) {674 return true;675 }676 }677 return false;678 }679 /**680 * testing if the method would handle InvalidUser681 * @throws DatabaseAccessException682 * @throws AccessDeniedException683 */684 @Test685 public void testGenerateProgressSummary_InvalidStudent_AsGPC() throws FileNotFoundException, AccessDeniedException, InvalidUserException {686 try {687 grads.setUser("smith0001");688 } catch (DatabaseAccessException e) {689 e.printStackTrace();690 }691 try {692 ProgressSummary progressSummary = grads.generateProgressSummary("InvalidUser");693 fail();694 } catch ( DatabaseAccessException d) {695 }696 }697 /**698 * Test that the student can get their Progress Summary699 * @throws Exception700 */701 @Test702 public void testGenerateProgressSummary_Own_AsStudent() throws InvalidUserException, FileNotFoundException, DatabaseAccessException {703 grads.setUser("gayxx067");704 try {705 ProgressSummary actual = grads.generateProgressSummary("gayxx067");706 } catch (AccessDeniedException e) {707 fail();708 }709 }710 /**711 * Checks that a GPC cannot generate a progress summary for a student outside of their dept.712 */713 @Test714 public void testGenerateProgressSummary_OutDept_AsGPC() throws FileNotFoundException, DatabaseAccessException, InvalidUserException {715 grads.setUser("smith0001");716 try {717 grads.generateProgressSummary("nguy0621");718 fail();719 } catch (AccessDeniedException ex) {720 //do nothing721 }722 }723 /**724 * Checks that student cannot generate a progress summary for another student725 * @throws FileNotFoundException726 * @throws DatabaseAccessException727 */728 @Test729 public void testGenerateProgress_OtherStudent_AsStudent() throws FileNotFoundException, DatabaseAccessException, InvalidUserException {730 //TODO: Add inputs testID, Expected Progress Summary;731 grads.setUser("gayxx067");732 try {733 grads.generateProgressSummary("nguy0261");734 fail();735 } catch (AccessDeniedException ex) {736 //do nothing737 }738 }739 /**740 * Checks that GPC can generate a progress summary for a student in their dept.741 * @throws AccessDeniedException 742 * @throws Exception743 */744 @Test745 public void testGenerateProgressSummary_InDept_AsGPC() throws FileNotFoundException, DatabaseAccessException, InvalidUserException, AccessDeniedException {746 //TODO: Add inputs testID, Expected Progress Summary747 grads.setUser("tolas9999");748 try {749 ProgressSummary actual = grads.generateProgressSummary("nguy0621");750 // Create a parallel Progress Summary751 assertEquals(new Student("Luan", "Nguyen", "nguy0621"), actual.getStudent());752 assertEquals(Department.COMPUTER_SCIENCE, actual.getDepartment());753 assertEquals(Degree.PHD, actual.getDegreeSought());754 assertEquals(new Term(Semester.SPRING, 2008), actual.getTermBegan());755 assertEquals(StudentRecordFactory.LuanAdvisors(), actual.getAdvisors());756 assertEquals(StudentRecordFactory.LuanCommittee(), actual.getCommittee());757 assertEquals(StudentRecordFactory.notes(), actual.getNotes());758 List<RequirementCheckResult> requirementCheckResultsList = actual.getRequirementCheckResults();759 List<String> others = new ArrayList<String>();760 List<String> errorM = new ArrayList<String>();761 // 0762 CheckResultDetails details = newCheckResultDetails((float) 4.0, StudentRecordFactory.LuanCoursesTaken(), others);763 RequirementCheckResult requirementCheckResult = new RequirementCheckResult("Theory and Algorithms",false,details);764 requirementCheckResult.setErrorMsgs(errorM);765 assertEquals(requirementCheckResultsList.get(0).getName(), requirementCheckResult.getName());766// assertEquals(requirementCheckResultsList.get(0).isPassed(), requirementCheckResult.isPassed());767// assertEquals(requirementCheckResultsList.get(0).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());768 // 1769 details = newCheckResultDetails((float) 3.0, StudentRecordFactory.LuanCoursesTaken(), others);770 requirementCheckResult = new RequirementCheckResult("Architecture, Systems, and Software",false,details);771 requirementCheckResult.setErrorMsgs(errorM);772 // Name, GPA, Pass773 assertEquals(requirementCheckResultsList.get(1).getName(), requirementCheckResult.getName());774// assertEquals(requirementCheckResultsList.get(1).isPassed(), requirementCheckResult.isPassed());775// assertEquals(requirementCheckResultsList.get(1).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());776 // 2777 details = newCheckResultDetails((float) 0.0, StudentRecordFactory.LuanCoursesTaken(), others);778 requirementCheckResult = new RequirementCheckResult("Applications",false,details);779 requirementCheckResult.setErrorMsgs(errorM);780 assertEquals(requirementCheckResultsList.get(2).getName(), requirementCheckResult.getName());781// assertEquals(requirementCheckResultsList.get(2).isPassed(), requirementCheckResult.isPassed());782// assertEquals(requirementCheckResultsList.get(2).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());783 // 3784 details = newCheckResultDetails((float) 3.6666667, StudentRecordFactory.LuanCoursesTaken(), others);785 requirementCheckResult = new RequirementCheckResult("Breadth Requirement",false,details);786 requirementCheckResult.setErrorMsgs(errorM);787 assertEquals(requirementCheckResultsList.get(3).getName(), requirementCheckResult.getName());788 assertEquals(requirementCheckResultsList.get(3).isPassed(), requirementCheckResult.isPassed());789 assertEquals(requirementCheckResultsList.get(3).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());790 // 4791 details = newCheckResultDetails((float) 0.0, StudentRecordFactory.LuanCoursesTaken(), others);792 requirementCheckResult = new RequirementCheckResult("Thesis PHD",false,details);793 requirementCheckResult.setErrorMsgs(errorM);794 assertEquals(requirementCheckResultsList.get(4).getName(), requirementCheckResult.getName());795 assertEquals(requirementCheckResultsList.get(4).isPassed(), requirementCheckResult.isPassed());796 assertEquals(requirementCheckResultsList.get(4).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());797 // 5798 details = newCheckResultDetails((float) 0.0, StudentRecordFactory.LuanCoursesTaken(), others);799 requirementCheckResult = new RequirementCheckResult("Colloquium",false,details);800 requirementCheckResult.setErrorMsgs(errorM);801 assertEquals(requirementCheckResultsList.get(5).getName(), requirementCheckResult.getName());802 assertEquals(requirementCheckResultsList.get(5).isPassed(), requirementCheckResult.isPassed());803 assertEquals(requirementCheckResultsList.get(5).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());804 // 6805 details = newCheckResultDetails((float) 0.0, StudentRecordFactory.LuanCoursesTaken(), others);806 requirementCheckResult = new RequirementCheckResult("Out of Department",false,details);807 requirementCheckResult.setErrorMsgs(errorM);808 assertEquals(requirementCheckResultsList.get(6).getName(), requirementCheckResult.getName());809 assertEquals(requirementCheckResultsList.get(6).isPassed(), requirementCheckResult.isPassed());810 assertEquals(requirementCheckResultsList.get(6).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());811 // 7812 details = newCheckResultDetails((float) 0.0, StudentRecordFactory.LuanCoursesTaken(), others);813 requirementCheckResult = new RequirementCheckResult("Introduction to Research",false,details);814 requirementCheckResult.setErrorMsgs(errorM);815 assertEquals(requirementCheckResultsList.get(7).getName(), requirementCheckResult.getName());816 assertEquals(requirementCheckResultsList.get(7).isPassed(), requirementCheckResult.isPassed());817 assertEquals(requirementCheckResultsList.get(7).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());818 // 8819 details = newCheckResultDetails((float) 3.6666667, StudentRecordFactory.LuanCoursesTaken(), others);820 requirementCheckResult = new RequirementCheckResult("16 csci Credits",false,details);821 requirementCheckResult.setErrorMsgs(errorM);822 assertEquals(requirementCheckResultsList.get(8).getName(), requirementCheckResult.getName());823 assertEquals(requirementCheckResultsList.get(8).isPassed(), requirementCheckResult.isPassed());824 assertEquals(requirementCheckResultsList.get(8).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());825 // 9826 details = newCheckResultDetails((float) 3.6666667, StudentRecordFactory.LuanCoursesTaken(), others);827 requirementCheckResult = new RequirementCheckResult("Total Credits",false,details);828 requirementCheckResult.setErrorMsgs(errorM);829 assertEquals(requirementCheckResultsList.get(9).getName(), requirementCheckResult.getName());830 assertEquals(requirementCheckResultsList.get(9).isPassed(), requirementCheckResult.isPassed());831 assertEquals(requirementCheckResultsList.get(9).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());832 // 10833 details = newCheckResultDetails((float) 3.6666667, StudentRecordFactory.LuanCoursesTaken(), others);834 requirementCheckResult = new RequirementCheckResult("Other Course Requirements",false,details);835 requirementCheckResult.setErrorMsgs(errorM);836 assertEquals(requirementCheckResultsList.get(10).getName(), requirementCheckResult.getName());837 assertEquals(requirementCheckResultsList.get(10).isPassed(), requirementCheckResult.isPassed());838 assertEquals(requirementCheckResultsList.get(10).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());839 // 11840 details = newCheckResultDetails((float) 3.6666667, StudentRecordFactory.LuanCoursesTaken(), others);841 requirementCheckResult = new RequirementCheckResult("Overall GPA",true,details);842 requirementCheckResult.setErrorMsgs(errorM);843 assertEquals(requirementCheckResultsList.get(11).getName(), requirementCheckResult.getName());844 assertEquals(requirementCheckResultsList.get(11).isPassed(), requirementCheckResult.isPassed());845 assertEquals(requirementCheckResultsList.get(11).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());846 // 12847 details = newCheckResultDetails((float) 3.6666667, StudentRecordFactory.LuanCoursesTaken(), others);848 requirementCheckResult = new RequirementCheckResult("In Program GPA",true,details);849 requirementCheckResult.setErrorMsgs(errorM);850 assertEquals(requirementCheckResultsList.get(12).getName(), requirementCheckResult.getName());851 assertEquals(requirementCheckResultsList.get(12).isPassed(), requirementCheckResult.isPassed());852 assertEquals(requirementCheckResultsList.get(12).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());853 // 13854 details = newCheckResultDetails((float) 3.6666667, StudentRecordFactory.LuanCoursesTaken(), others);855 requirementCheckResult = new RequirementCheckResult("Other GPA Requirements",true,details);856 requirementCheckResult.setErrorMsgs(errorM);857 assertEquals(requirementCheckResultsList.get(13).getName(), requirementCheckResult.getName());858 assertEquals(requirementCheckResultsList.get(13).isPassed(), requirementCheckResult.isPassed());859 assertEquals(requirementCheckResultsList.get(13).getDetails().getGPA(), requirementCheckResult.getDetails().getGPA());860 // 14861 details = newCheckResultDetails((float) 0.0, StudentRecordFactory.LuanCoursesTaken(), others);862 requirementCheckResult = new RequirementCheckResult("Milestones",false,details);863 requirementCheckResult.setErrorMsgs(errorM);864 assertEquals(requirementCheckResultsList.get(14).getName(), requirementCheckResult.getName());865 assertEquals(requirementCheckResultsList.get(14).isPassed(), requirementCheckResult.isPassed());866 } catch (AccessDeniedException e) {867 }868 }869}...

Full Screen

Full Screen

GRADSTest.java

Source:GRADSTest.java Github

copy

Full Screen

...275 grads.setUser(userGPAID);276 ProgressSummary summary = grads.generateProgressSummary("mhunt");277 Assert.assertEquals(7, summary.requirementCheckResults.size());278 Assert.assertEquals("CORE_COURSES_PHD", summary.requirementCheckResults.get(0).name);279 Assert.assertTrue(summary.requirementCheckResults.get(0).passed);280 Assert.assertEquals("ADDITIONAL_CREDITS_PHD", summary.requirementCheckResults.get(1).name);281 Assert.assertTrue(summary.requirementCheckResults.get(1).passed);282 Assert.assertEquals("DEGREE_BASED_CREDITS_PHD", summary.requirementCheckResults.get(2).name);283 Assert.assertTrue(summary.requirementCheckResults.get(2).passed);284 Assert.assertEquals("THESIS_CREDITS_PHD", summary.requirementCheckResults.get(3).name);285 Assert.assertTrue(summary.requirementCheckResults.get(3).passed);286 Assert.assertEquals("TIME_LIMIT_PHD", summary.requirementCheckResults.get(4).name);287 Assert.assertTrue(summary.requirementCheckResults.get(4).passed);288 Assert.assertEquals("GPA", summary.requirementCheckResults.get(5).name);289 Assert.assertTrue(summary.requirementCheckResults.get(5).passed);290 Assert.assertEquals("MILESTONES_PHD", summary.requirementCheckResults.get(6).name);291 Assert.assertTrue(summary.requirementCheckResults.get(6).passed);292 }293 @Test294 public void testGenerateProgressSummaryPHDRequirementsAreNotMet() throws Exception295 {296 StudentRecord studentRecord1 = createStudentRecord();297 String studentId = studentRecord1.student.id;298 String degreeSought = studentRecord1.degreeSought.name.toString();299 addStudentRecordToDB(studentRecord1);300 // Create a progress summary object301 ProgressSummary progressSummary1 = new ProgressSummary();302 progressSummary1.student = studentRecord1.student;303 progressSummary1.department = studentRecord1.department;304 progressSummary1.termBegan = studentRecord1.termBegan;305 progressSummary1.degreeSought = studentRecord1.degreeSought;306 progressSummary1.advisors = studentRecord1.advisors;307 progressSummary1.committee = studentRecord1.committee;308 List<RequirementCheckResult> requirementCheckResults = new ArrayList<>();309 RequirementDetails details = new RequirementDetails();310 List<String> notes = new ArrayList<>();311 // Add core courses312 RequirementCheckResult result = new RequirementCheckResult();313 result.name = "CORE_COURSES_" + degreeSought;314 result.passed = false;315 details.notes = new ArrayList<>();316 details.notes.add("Core courses [csce791, csce551, csce750, csce531, csce513] are left to be taken.");317 result.details = details;318 requirementCheckResults.add (result);319 // Add Additional credits320 result = new RequirementCheckResult();321 details = new RequirementDetails();322 details.notes = new ArrayList<>();323 result.name = "ADDITIONAL_CREDITS_" + degreeSought;324 result.passed = false;325 details.notes.add("Must pass 14 more hours of CSCE courses numbered above 700 that are not core courses.");326 result.details = details;327 requirementCheckResults.add (result);328 // Add degree based credits329 result = new RequirementCheckResult();330 details = new RequirementDetails();331 details.notes = new ArrayList<>();332 result.name = "DEGREE_BASED_CREDITS_" + degreeSought;333 result.passed = false;334 details.courses = studentRecord1.coursesTaken;335 details.notes.add("Must pass 42 more hours of graduate courses.");336 details.notes.add("Must pass 18 more hours of CSCE courses numbered above 700.");337 result.details = details;338 requirementCheckResults.add (result);339 // Add thesis credits340 result = new RequirementCheckResult();341 details = new RequirementDetails();342 details.notes = new ArrayList<>();343 result.name = "THESIS_CREDITS_" + degreeSought;344 result.passed = false;345 details.notes.add("Must pass 12 more hours of csce899.");346 result.details = details;347 requirementCheckResults.add (result);348 // Add time limit349 result = new RequirementCheckResult();350 details = new RequirementDetails();351 details.notes = new ArrayList<>();352 result.name = "TIME_LIMIT_" + degreeSought;353 result.passed = false;354 requirementCheckResults.add (result);355 // Add GPA356 result = new RequirementCheckResult();357 details = new RequirementDetails();358 result.name = "GPA";359 result.passed = false;360 details.gpa = (float) 2.5;361 details.notes = new ArrayList<>();362 details.notes.add("Must have GPA >= 3.0");363 details.notes.add("Must have 7xx classes GPA >= 3.0");364 result.details = details;365 requirementCheckResults.add (result);366 // Add milestones367 result = new RequirementCheckResult();368 details = new RequirementDetails();369 details.notes = new ArrayList<>();370 result.name = "MILESTONES_" + degreeSought;371 result.passed = false;372 details.notes.add("Missing milestone QUALIFYING_EXAM_PASSED");373 details.notes.add("Missing milestone PROGRAM_OF_STUDY_SUBMITTED");374 details.notes.add("Missing milestone DISSERTATION_DEFENSE_PASSED");375 details.notes.add("Missing milestone DISSERTATION_ADVISOR_SELECTED");376 details.notes.add("Missing milestone DISSERTATION_PROPOSAL_SCHEDULED");377 details.notes.add("Missing milestone DISSERTATION_SUBMITTED");378 details.notes.add("Missing milestone COMPREHENSIVE_EXAM_PASSED");379 details.notes.add("Missing milestone DISSERTATION_DEFENSE_SCHEDULED");380 details.notes.add("Missing milestone DISSERTATION_COMMITTEE_FORMED");381 result.details = details;382 requirementCheckResults.add (result);383 // Add the requirement check result384 progressSummary1.requirementCheckResults = requirementCheckResults;385 grads.loadRecords("students.txt");386 grads.loadUsers("users.txt");387 grads.loadCourses("courses.txt");388 grads.setUser(userGPAID);389 ProgressSummary progressSummary2 = grads.generateProgressSummary(studentId);390 assertReflectionEquals(progressSummary1, progressSummary2, ReflectionComparatorMode.LENIENT_ORDER);391 }392 @Test393 public void testGenerateProgressSummaryMSERequirementsAreMet() throws Exception394 {395 grads.loadRecords("students.txt");396 grads.loadUsers("users.txt");397 grads.loadCourses("courses.txt");398 grads.setUser(userGPAID);399 ProgressSummary summaryMSETest1 = grads.generateProgressSummary("khilton");400 Assert.assertEquals(6, summaryMSETest1.requirementCheckResults.size());401 Assert.assertEquals("CORE_COURSES_MSE", summaryMSETest1.requirementCheckResults.get(0).name);402 Assert.assertTrue(summaryMSETest1.requirementCheckResults.get(0).passed);403 Assert.assertEquals("ADDITIONAL_CREDITS_MSE", summaryMSETest1.requirementCheckResults.get(1).name);404 Assert.assertTrue(summaryMSETest1.requirementCheckResults.get(1).passed);405 Assert.assertEquals("TIME_LIMIT", summaryMSETest1.requirementCheckResults.get(2).name);406 Assert.assertTrue(summaryMSETest1.requirementCheckResults.get(2).passed);407 Assert.assertEquals("GPA", summaryMSETest1.requirementCheckResults.get(3).name);408 Assert.assertTrue(summaryMSETest1.requirementCheckResults.get(3).passed);409 Assert.assertEquals("MILESTONES_MSE", summaryMSETest1.requirementCheckResults.get(4).name);410 Assert.assertTrue(summaryMSETest1.requirementCheckResults.get(4).passed);411 Assert.assertEquals("WORK_EXPERIENCE_CHECK", summaryMSETest1.requirementCheckResults.get(5).name);412 Assert.assertTrue(summaryMSETest1.requirementCheckResults.get(5).passed);413 Assert.assertTrue(summaryMSETest1.requirementCheckResults.get(3).details.gpa > 3.0);414 }415 @Test416 public void testGenerateProgressSummaryMSERequirementsAreNotMet() throws Exception417 {418 grads.loadRecords("students.txt");419 grads.loadUsers("users.txt");420 grads.loadCourses("courses.txt");421 grads.setUser(userGPAID);422 ProgressSummary summaryMSETest1 = grads.generateProgressSummary("tcrumb");423 Assert.assertEquals(6, summaryMSETest1.requirementCheckResults.size());424 Assert.assertEquals("CORE_COURSES_MSE", summaryMSETest1.requirementCheckResults.get(0).name);425 Assert.assertTrue(summaryMSETest1.requirementCheckResults.get(0).passed);426 Assert.assertEquals("ADDITIONAL_CREDITS_MSE", summaryMSETest1.requirementCheckResults.get(1).name);427 Assert.assertFalse(summaryMSETest1.requirementCheckResults.get(1).passed);428 Assert.assertEquals("TIME_LIMIT", summaryMSETest1.requirementCheckResults.get(2).name);429 Assert.assertTrue(summaryMSETest1.requirementCheckResults.get(2).passed);430 Assert.assertEquals("GPA", summaryMSETest1.requirementCheckResults.get(3).name);431 Assert.assertTrue(summaryMSETest1.requirementCheckResults.get(3).passed);432 Assert.assertEquals("MILESTONES_MSE", summaryMSETest1.requirementCheckResults.get(4).name);433 Assert.assertFalse(summaryMSETest1.requirementCheckResults.get(4).passed);434 Assert.assertEquals("WORK_EXPERIENCE_CHECK", summaryMSETest1.requirementCheckResults.get(5).name);435 Assert.assertTrue(summaryMSETest1.requirementCheckResults.get(5).passed);436 }437 @Test438 public void testGenerateProgressSummaryMSRequirementsAreMet() throws Exception439 {440 grads.loadRecords("students_testProgressSummaryMSRequirementsPassed.txt");441 grads.loadUsers("users.txt");442 grads.loadCourses("courses.txt");443 grads.setUser(userGPAID);444 ProgressSummary summary = grads.generateProgressSummary("aclyde");445 Assert.assertEquals(7, summary.requirementCheckResults.size());446 Assert.assertEquals("CORE_COURSES_MS", summary.requirementCheckResults.get(0).name);447 Assert.assertTrue(summary.requirementCheckResults.get(0).passed);448 Assert.assertEquals("ADDITIONAL_CREDITS_MS", summary.requirementCheckResults.get(1).name);449 Assert.assertTrue(summary.requirementCheckResults.get(1).passed);450 Assert.assertEquals("DEGREE_BASED_CREDITS_MS", summary.requirementCheckResults.get(2).name);451 Assert.assertTrue(summary.requirementCheckResults.get(2).passed);452 Assert.assertEquals("THESIS_CREDITS_MS", summary.requirementCheckResults.get(3).name);453 Assert.assertTrue(summary.requirementCheckResults.get(3).passed);454 Assert.assertEquals("TIME_LIMIT", summary.requirementCheckResults.get(4).name);455 Assert.assertTrue(summary.requirementCheckResults.get(4).passed);456 Assert.assertEquals("GPA", summary.requirementCheckResults.get(5).name);457 Assert.assertTrue(summary.requirementCheckResults.get(5).passed);458 Assert.assertEquals("MILESTONES_MS", summary.requirementCheckResults.get(6).name);459 Assert.assertTrue(summary.requirementCheckResults.get(6).passed);460 }461 @Test462 public void testGenerateProgressSummaryMSRequirementsAreNotMet() throws Exception463 {464 grads.loadRecords("students_testProgressSummaryMSRequirementsFail.txt");465 grads.loadUsers("users.txt");466 grads.loadCourses("courses.txt");467 grads.setUser(userGPAID);468 ProgressSummary summary = grads.generateProgressSummary("aclyde");469 Assert.assertEquals(7, summary.requirementCheckResults.size());470 Assert.assertEquals("CORE_COURSES_MS", summary.requirementCheckResults.get(0).name);471 Assert.assertFalse(summary.requirementCheckResults.get(0).passed);472 Assert.assertEquals("ADDITIONAL_CREDITS_MS", summary.requirementCheckResults.get(1).name);473 Assert.assertFalse(summary.requirementCheckResults.get(1).passed);474 Assert.assertEquals("DEGREE_BASED_CREDITS_MS", summary.requirementCheckResults.get(2).name);475 Assert.assertFalse(summary.requirementCheckResults.get(2).passed);476 Assert.assertEquals("THESIS_CREDITS_MS", summary.requirementCheckResults.get(3).name);477 Assert.assertFalse(summary.requirementCheckResults.get(3).passed);478 Assert.assertEquals("TIME_LIMIT", summary.requirementCheckResults.get(4).name);479 Assert.assertFalse(summary.requirementCheckResults.get(4).passed);480 Assert.assertEquals("GPA", summary.requirementCheckResults.get(5).name);481 Assert.assertFalse(summary.requirementCheckResults.get(5).passed);482 Assert.assertTrue(summary.requirementCheckResults.get(5).details.gpa < 3.0);483 Assert.assertEquals("MILESTONES_MS", summary.requirementCheckResults.get(6).name);484 Assert.assertFalse(summary.requirementCheckResults.get(6).passed);485 }486 @Test487 public void testGenerateProgressSummaryMENGRequirementsAreMet() throws Exception488 {489 grads.loadRecords("students_testProgressSummaryMENGRequirementsPassed.txt");490 grads.loadUsers("users.txt");491 grads.loadCourses("courses.txt");492 grads.setUser(userGPAID);493 ProgressSummary summaryMENGTest1 = grads.generateProgressSummary("jbluff");494 Assert.assertEquals(6, summaryMENGTest1.requirementCheckResults.size());495 Assert.assertEquals("CORE_COURSES_MENG", summaryMENGTest1.requirementCheckResults.get(0).name);496 Assert.assertTrue(summaryMENGTest1.requirementCheckResults.get(0).passed);497 Assert.assertEquals("ADDITIONAL_CREDITS_MENG", summaryMENGTest1.requirementCheckResults.get(1).name);498 Assert.assertTrue(summaryMENGTest1.requirementCheckResults.get(1).passed);499 Assert.assertEquals("DEGREE_BASED_CREDITS_MENG", summaryMENGTest1.requirementCheckResults.get(2).name);500 Assert.assertTrue(summaryMENGTest1.requirementCheckResults.get(2).passed);501 Assert.assertEquals("TIME_LIMIT", summaryMENGTest1.requirementCheckResults.get(3).name);502 Assert.assertTrue(summaryMENGTest1.requirementCheckResults.get(3).passed);503 Assert.assertEquals("GPA", summaryMENGTest1.requirementCheckResults.get(4).name);504 Assert.assertTrue(summaryMENGTest1.requirementCheckResults.get(4).passed);505 Assert.assertTrue(summaryMENGTest1.requirementCheckResults.get(4).details.gpa >=3.0);506 Assert.assertEquals("MILESTONES_MENG", summaryMENGTest1.requirementCheckResults.get(5).name);507 Assert.assertTrue(summaryMENGTest1.requirementCheckResults.get(5).passed);508 }509 @Test510 public void testGenerateProgressSummaryMENGRequirementsAreNotMet() throws Exception511 {512 grads.loadRecords("students_testProgressSummaryMENGRequirementsFail.txt");513 grads.loadUsers("users.txt");514 grads.loadCourses("courses.txt");515 grads.setUser(userGPAID);516 ProgressSummary summaryMENGTest2 = grads.generateProgressSummary("jbluff");517 Assert.assertEquals(6, summaryMENGTest2.requirementCheckResults.size());518 Assert.assertEquals("CORE_COURSES_MENG", summaryMENGTest2.requirementCheckResults.get(0).name);519 Assert.assertTrue(summaryMENGTest2.requirementCheckResults.get(0).passed);520 Assert.assertEquals("ADDITIONAL_CREDITS_MENG", summaryMENGTest2.requirementCheckResults.get(1).name);521 Assert.assertTrue(summaryMENGTest2.requirementCheckResults.get(1).passed);522 Assert.assertEquals("DEGREE_BASED_CREDITS_MENG", summaryMENGTest2.requirementCheckResults.get(2).name);523 Assert.assertFalse(summaryMENGTest2.requirementCheckResults.get(2).passed);524 Assert.assertEquals("TIME_LIMIT", summaryMENGTest2.requirementCheckResults.get(3).name);525 Assert.assertTrue(summaryMENGTest2.requirementCheckResults.get(3).passed);526 Assert.assertEquals("GPA", summaryMENGTest2.requirementCheckResults.get(4).name);527 Assert.assertTrue(summaryMENGTest2.requirementCheckResults.get(4).passed);528 Assert.assertFalse(summaryMENGTest2.requirementCheckResults.get(4).details.gpa < 3.0);529 Assert.assertEquals("MILESTONES_MENG", summaryMENGTest2.requirementCheckResults.get(5).name);530 Assert.assertFalse(summaryMENGTest2.requirementCheckResults.get(5).passed);531 }532 @Test533 public void testGenerateProgressSummaryINFASRequirementsAreMet() throws Exception534 {535 grads.loadRecords("students_testProgressSummaryINFASRequirementsPassed.txt");536 grads.loadUsers("users.txt");537 grads.loadCourses("courses.txt");538 grads.setUser(userGPAID);539 ProgressSummary summaryINFASTest1 = grads.generateProgressSummary("acarson");540 Assert.assertEquals("CORE_COURSES_MENG", summaryINFASTest1.requirementCheckResults.get(0).name);541 Assert.assertTrue(summaryINFASTest1.requirementCheckResults.get(0).passed);542 Assert.assertEquals("ADDITIONAL_CREDITS_MENG", summaryINFASTest1.requirementCheckResults.get(1).name);543 Assert.assertTrue(summaryINFASTest1.requirementCheckResults.get(1).passed);544 Assert.assertEquals("DEGREE_BASED_CREDITS_MENG", summaryINFASTest1.requirementCheckResults.get(2).name);545 Assert.assertTrue(summaryINFASTest1.requirementCheckResults.get(2).passed);546 Assert.assertEquals("TIME_LIMIT", summaryINFASTest1.requirementCheckResults.get(3).name);547 Assert.assertTrue(summaryINFASTest1.requirementCheckResults.get(3).passed);548 Assert.assertEquals("GPA", summaryINFASTest1.requirementCheckResults.get(4).name);549 Assert.assertTrue(summaryINFASTest1.requirementCheckResults.get(4).passed);550 Assert.assertEquals("MILESTONES_MENG", summaryINFASTest1.requirementCheckResults.get(5).name);551 Assert.assertTrue(summaryINFASTest1.requirementCheckResults.get(5).passed);552 Assert.assertEquals("CORE_COURSES_INFAS", summaryINFASTest1.requirementCheckResults.get(6).name);553 Assert.assertTrue(summaryINFASTest1.requirementCheckResults.get(6).passed);554 Assert.assertEquals("ADDITIONAL_CREDITS_INFAS", summaryINFASTest1.requirementCheckResults.get(7).name);555 Assert.assertTrue(summaryINFASTest1.requirementCheckResults.get(7).passed);556 Assert.assertEquals("DEGREE_BASED_CREDITS_INFAS", summaryINFASTest1.requirementCheckResults.get(8).name);557 Assert.assertTrue(summaryINFASTest1.requirementCheckResults.get(8).passed);558 Assert.assertEquals("TIME_LIMIT_INFAS", summaryINFASTest1.requirementCheckResults.get(9).name);559 Assert.assertTrue(summaryINFASTest1.requirementCheckResults.get(9).passed);560 Assert.assertTrue(summaryINFASTest1.requirementCheckResults.get(10).details.gpa >= 3.0);561 }562 @Test563 public void testGenerateProgressSummaryINFASRequirementsAreNotMet() throws Exception564 {565 grads.loadRecords("students_testProgressSummaryINFASRequirementsFail.txt");566 grads.loadUsers("users.txt");567 grads.loadCourses("courses.txt");568 grads.setUser(userGPAID);569 ProgressSummary summaryINFASTest2 = grads.generateProgressSummary("acarson");570 Assert.assertEquals("CORE_COURSES_MENG", summaryINFASTest2.requirementCheckResults.get(0).name);571 Assert.assertTrue(summaryINFASTest2.requirementCheckResults.get(0).passed);572 Assert.assertEquals("ADDITIONAL_CREDITS_MENG", summaryINFASTest2.requirementCheckResults.get(1).name);573 Assert.assertTrue(summaryINFASTest2.requirementCheckResults.get(1).passed);574 Assert.assertEquals("DEGREE_BASED_CREDITS_MENG", summaryINFASTest2.requirementCheckResults.get(2).name);575 Assert.assertTrue(summaryINFASTest2.requirementCheckResults.get(2).passed);576 Assert.assertEquals("TIME_LIMIT", summaryINFASTest2.requirementCheckResults.get(3).name);577 Assert.assertTrue(summaryINFASTest2.requirementCheckResults.get(3).passed);578 Assert.assertEquals("GPA", summaryINFASTest2.requirementCheckResults.get(4).name);579 Assert.assertTrue(summaryINFASTest2.requirementCheckResults.get(4).passed);580 Assert.assertEquals("MILESTONES_MENG", summaryINFASTest2.requirementCheckResults.get(5).name);581 Assert.assertTrue(summaryINFASTest2.requirementCheckResults.get(5).passed);582 Assert.assertEquals("CORE_COURSES_INFAS", summaryINFASTest2.requirementCheckResults.get(6).name);583 Assert.assertFalse(summaryINFASTest2.requirementCheckResults.get(6).passed);584 Assert.assertEquals("ADDITIONAL_CREDITS_INFAS", summaryINFASTest2.requirementCheckResults.get(7).name);585 Assert.assertTrue(summaryINFASTest2.requirementCheckResults.get(7).passed);586 Assert.assertEquals("DEGREE_BASED_CREDITS_INFAS", summaryINFASTest2.requirementCheckResults.get(8).name);587 Assert.assertTrue(summaryINFASTest2.requirementCheckResults.get(8).passed);588 Assert.assertEquals("TIME_LIMIT_INFAS", summaryINFASTest2.requirementCheckResults.get(9).name);589 Assert.assertTrue(summaryINFASTest2.requirementCheckResults.get(9).passed);590 }591 @Test592 public void testSimulateCoursesSuccess() throws Exception {593 grads.loadRecords("students_testSimulateCourses.txt");594 grads.loadUsers("users.txt");595 grads.loadCourses("courses.txt");596 CourseTaken courseTaken1 = new CourseTaken();597 Course course1 = new Course();598 // Created simulated courses with csce750599 course1.name = "Analysis of Algorithms";600 course1.id = "csce750";601 course1.numCredits = "3";602 courseTaken1.course = course1;603 courseTaken1.term = new Term(2015, Term.Season.FALL);604 courseTaken1.grade = CourseTaken.Grade.B;605 List<CourseTaken> simulateListed = new ArrayList<>();606 grads.setUser(userGPAID);607 simulateListed.add(courseTaken1);608 ProgressSummary summary = grads.generateProgressSummary("mhunt");609 Assert.assertEquals("CORE_COURSES_PHD", summary.requirementCheckResults.get(0).name);610 Assert.assertFalse(summary.requirementCheckResults.get(0).passed);611 summary = grads.simulateCourses("mhunt", simulateListed);612 Assert.assertEquals("CORE_COURSES_PHD", summary.requirementCheckResults.get(0).name);613 Assert.assertTrue(summary.requirementCheckResults.get(0).passed);614 }615 @Test616 public void testSimulateCoursesFail() throws Exception {617 String otherStudentId = "ggay";618 grads.loadRecords("students.txt");619 grads.loadUsers("users.txt");620 grads.loadCourses("courses.txt");621 grads.setUser(userGPAID);622 grads.setUser(otherStudentId);623 try {624 grads.simulateCourses("aclyde",null);625 Assert.assertTrue(false);626 } catch (UserHasInsufficientPrivilegeException ex) {627 }...

Full Screen

Full Screen

DegreePlan.java

Source:DegreePlan.java Github

copy

Full Screen

...44 this.department = department;45 this.degree = degree;46 }47 /**48 * Checks if the student passed the degree plan, given the courses taken.49 *50 * @param coursesTaken the courses that the students has taken.51 * @param milestonesPassed milestones that the student has passed.52 * @return true if the student passed all requirements. Otherwise returns false.53 */54 public boolean getIsStudentPassed(List<CourseTaken> coursesTaken, List<MilestoneSet> milestonesPassed) {55 if (! breadthRequirements.checkIsPassed(coursesTaken, milestonesPassed))56 return false;57 if (! otherCourseRequirements.checkIsPassed(coursesTaken, milestonesPassed))58 return false;59 if (! otherGPARequirements.checkIsPassed(coursesTaken, milestonesPassed))60 return false;61 if (! milestones.checkIsPassed(coursesTaken, milestonesPassed))62 return false;63 return true;64 }65 /**66 * Generates and returns a requirementCheckResult list for the courses taken and milestones passed.67 *68 * @param coursesTaken the courses that the student has taken.69 * @param milestonesPassed milestones that the student has passed.70 * @return List of results from the progress check.71 */72 public List<RequirementCheckResult> generateRequirementCheckResults(List<CourseTaken> coursesTaken,73 List<MilestoneSet> milestonesPassed) {74 List<RequirementCheckResult> requirementCheckResultList = new ArrayList<RequirementCheckResult>();75 List<RequirementCheckResult> resultsToAdd;76 resultsToAdd = breadthRequirements.generateRequirementCheckResults(coursesTaken, milestonesPassed);77 for(RequirementCheckResult result: resultsToAdd) {78 requirementCheckResultList.add(result);79 }80 resultsToAdd = otherCourseRequirements.generateRequirementCheckResults(coursesTaken, milestonesPassed);81 for(RequirementCheckResult result: resultsToAdd) {82 requirementCheckResultList.add(result);83 }...

Full Screen

Full Screen

passed

Using AI Code Generation

copy

Full Screen

1r.add(1, 2, 3, 4, 5)2r.add(6, 7, 8, 9, 10)3r.add(11, 12, 13, 14, 15)4r.add(16, 17, 18, 19, 20)5r.add(21, 22, 23, 24, 25)6r.add(26, 27, 28, 29, 30)7r.add(31, 32, 33, 34, 35)8r.add(36, 37, 38, 39, 40)9r.add(41, 42, 43, 44, 45)10r.add(46, 47, 48, 49, 50)11r.add(51, 52, 53, 54, 55)12r.add(56, 57, 58, 59, 60)13r.add(61, 62, 63, 64, 65)14r.add(66, 67, 68, 69, 70)15r.add(71, 72, 73, 74, 75)16r.add(76, 77, 78, 79, 80)17r.add(81, 82, 83, 84, 85)18r.add(86, 87, 88, 89, 90)19r.add(91, 92, 93, 94, 95)20r.add(96, 97, 98, 99, 100)21r.add(101, 102, 103, 104, 105)22r.add(106, 107, 108, 109, 110)23r.add(111, 112, 113, 114, 115)24r.add(116, 117, 118, 119, 120)25r.add(121, 122, 123, 124, 125)26r.add(126, 127, 128, 129, 130)27r.add(131, 132, 133, 134, 135)28r.add(136, 137, 138, 139, 140)29r.add(141, 142, 143

Full Screen

Full Screen

passed

Using AI Code Generation

copy

Full Screen

1puts Requirement.check_email(email)2 def self.check_email(email)3 if email =~ /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Spectus_ruby automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful