@Test public void testMergeIntoEmptyCourse() { Course course = emptyCourse; dao.mergeCourse(course, course2); assertEquals(2, course.getCredits(), 0.1); assertEquals("grade2", course.getGrade()); assertEquals(new LocalTime(14, 00, 00), course.getCourseMeetings().get(0).getStartTime()); assertEquals(new LocalTime(15, 00, 00), course.getCourseMeetings().get(0).getEndTime()); assertEquals("school2", course.getSchool()); assertEquals("Course 2", course.getTitle()); }
protected void mergeCourse(Course original, Course additional) { if (additional.getCredits() != null) { original.setCredits(additional.getCredits()); } if (additional.getGrade() != null) { original.setGrade(additional.getGrade()); } if (additional.getCourseMeetings() != null) { original.getCourseMeetings().addAll(additional.getCourseMeetings()); } if (additional.getCourseUpdates() != null) { original.getCourseUpdates().addAll(additional.getCourseUpdates()); } if (additional.getInstructors() != null) { original.getInstructors().addAll(additional.getInstructors()); } if (additional.getSchool() != null) { original.setSchool(additional.getSchool()); } if (additional.getTitle() != null) { original.setTitle(additional.getTitle()); } }
MergingCoursesDaoImpl implements ICoursesDao { protected void mergeCourse(Course original, Course additional) { if (additional.getCredits() != null) { original.setCredits(additional.getCredits()); } if (additional.getGrade() != null) { original.setGrade(additional.getGrade()); } if (additional.getCourseMeetings() != null) { original.getCourseMeetings().addAll(additional.getCourseMeetings()); } if (additional.getCourseUpdates() != null) { original.getCourseUpdates().addAll(additional.getCourseUpdates()); } if (additional.getInstructors() != null) { original.getInstructors().addAll(additional.getInstructors()); } if (additional.getSchool() != null) { original.setSchool(additional.getSchool()); } if (additional.getTitle() != null) { original.setTitle(additional.getTitle()); } } }
MergingCoursesDaoImpl implements ICoursesDao { protected void mergeCourse(Course original, Course additional) { if (additional.getCredits() != null) { original.setCredits(additional.getCredits()); } if (additional.getGrade() != null) { original.setGrade(additional.getGrade()); } if (additional.getCourseMeetings() != null) { original.getCourseMeetings().addAll(additional.getCourseMeetings()); } if (additional.getCourseUpdates() != null) { original.getCourseUpdates().addAll(additional.getCourseUpdates()); } if (additional.getInstructors() != null) { original.getInstructors().addAll(additional.getInstructors()); } if (additional.getSchool() != null) { original.setSchool(additional.getSchool()); } if (additional.getTitle() != null) { original.setTitle(additional.getTitle()); } }  }
MergingCoursesDaoImpl implements ICoursesDao { protected void mergeCourse(Course original, Course additional) { if (additional.getCredits() != null) { original.setCredits(additional.getCredits()); } if (additional.getGrade() != null) { original.setGrade(additional.getGrade()); } if (additional.getCourseMeetings() != null) { original.getCourseMeetings().addAll(additional.getCourseMeetings()); } if (additional.getCourseUpdates() != null) { original.getCourseUpdates().addAll(additional.getCourseUpdates()); } if (additional.getInstructors() != null) { original.getInstructors().addAll(additional.getInstructors()); } if (additional.getSchool() != null) { original.setSchool(additional.getSchool()); } if (additional.getTitle() != null) { original.setTitle(additional.getTitle()); } }  @Resource(name="courseDaos") void setCourseDaos(List<ICoursesDao> courseDaos); @Override TermList getTermList(PortletRequest request); @Override CoursesByTerm getCoursesByTerm(PortletRequest request, String termCode); }
MergingCoursesDaoImpl implements ICoursesDao { protected void mergeCourse(Course original, Course additional) { if (additional.getCredits() != null) { original.setCredits(additional.getCredits()); } if (additional.getGrade() != null) { original.setGrade(additional.getGrade()); } if (additional.getCourseMeetings() != null) { original.getCourseMeetings().addAll(additional.getCourseMeetings()); } if (additional.getCourseUpdates() != null) { original.getCourseUpdates().addAll(additional.getCourseUpdates()); } if (additional.getInstructors() != null) { original.getInstructors().addAll(additional.getInstructors()); } if (additional.getSchool() != null) { original.setSchool(additional.getSchool()); } if (additional.getTitle() != null) { original.setTitle(additional.getTitle()); } }  @Resource(name="courseDaos") void setCourseDaos(List<ICoursesDao> courseDaos); @Override TermList getTermList(PortletRequest request); @Override CoursesByTerm getCoursesByTerm(PortletRequest request, String termCode);  }