Package com.darkhonor.rage.model

Examples of com.darkhonor.rage.model.Course


     * Utility method to create the same course for testing.
     * @return      The created Course;
     */
    private Course createTestCourseNullId()
    {
        Course course = new Course("CS256");
       
        // Create 2 Sections, 2 Students per Section, and 2 Instructors
        Student student1 = new Student("Jerry", "Baker", "C14Jerry.Baker",
                new Integer(2013));
        student1.setId(new Long(10L));
        Student student2 = new Student("Lisa", "Thompson", "C14Lisa.Thompson",
                new Integer(2013));
        student2.setId(new Long(11L));
        Student student3 = new Student("Kelly", "Rogers", "C14Kelly.Rogers",
                new Integer(2013));
        student3.setId(new Long(12L));
        Student student4 = new Student("Jason", "Borough", "C14Jason.Borough",
                new Integer(2013));
        student4.setId(new Long(13L));
        Section section1 = new Section("M3A");
        section1.setId(new Long(10L));
        Section section2 = new Section("T2B");
        section2.setId(new Long(11L));
        Instructor instructor1 = new Instructor("Sam", "Pierce", "Sam.Pierce");
        instructor1.setDomainAccount(instructor1.getWebID());
        instructor1.setId(new Long(14L));
        Instructor instructor2 = new Instructor("Jenny", "Conners", "Jenny.Conners");
        instructor2.setDomainAccount(instructor2.getWebID());
        instructor2.setId(new Long(15L));

        // Set the Instructors for Sections 1 & 2
        section1.setInstructor(instructor1);
        section2.setInstructor(instructor2);
        section1.setCourse(course);
        section2.setCourse(course);

        // Add Instructors to Course
        course.addInstructor(instructor1);
        course.addInstructor(instructor2);

        // Add Students 1 & 2 to Section 1
        section1.addStudent(student1);
        student1.addSection(section1);
        section1.addStudent(student2);
        student2.addSection(section1);

        // Add Students 3 & 4 to Section 2
        section2.addStudent(student3);
        student3.addSection(section2);
        section2.addStudent(student4);
        student4.addSection(section2);

        // Add Sections 1 & 2 to Course
        course.addSection(section1);
        course.addSection(section2);

        return course;
    }
View Full Code Here


        return course;
    }

    private Course createExistingCourse()
    {
        Course course = new Course("CS110");
        course.setId(1L);

        // Create 2 Sections, 2 Students per Section, and 2 Instructors
        Student student1 = new Student("John", "Doe", "C13John.Doe",
                new Integer(2013));
        student1.setId(new Long(1L));
        Student student2 = new Student("Mary", "Johnson", "C13Mary.Johnson",
                new Integer(2013));
        student2.setId(new Long(2L));
        Student student3 = new Student("Bob", "Reimer", "C13Robert.Reimer",
                new Integer(2013));
        student3.setId(new Long(3L));
        Student student4 = new Student("Andrew", "Callow", "C13Andrew.Callow",
                new Integer(2013));
        student4.setId(new Long(4L));

        Section section1 = new Section("M1A");
        section1.setId(new Long(1L));
        Section section2 = new Section("M2B");
        section2.setId(new Long(2L));
        section1.setCourse(course);
        section2.setCourse(course);

        Instructor instructor1 = new Instructor("David", "Roberts", "David.Roberts");
        instructor1.setId(new Long(5L));
        Instructor instructor2 = new Instructor("Sarah", "O'Reilly", "Sarah.OReilly");
        instructor2.setId(new Long(6L));

        // Set the Instructors for Sections 1 & 2
        section1.setInstructor(instructor1);
        section2.setInstructor(instructor2);

        // Add Instructors to Course
        course.addInstructor(instructor1);
        course.addInstructor(instructor2);

        // Add Students 1 & 2 to Section 1
        section1.addStudent(student1);
        student1.addSection(section1);
        section1.addStudent(student2);
        student2.addSection(section1);

        course.addSection(section1);
        course.addSection(section2);

        // Add Students 3 & 4 to Section 2
        section2.addStudent(student3);
        student3.addSection(section2);
        section2.addStudent(student4);
View Full Code Here

   
    @Test(expected = NullPointerException.class)
    public void testFindExpandedNullAssignment()
    {
        System.out.println("findExpanded - Null Assignment Name");
        Course course = new Course();
        course.setId(new Long(1L));
        course.setName("CS110");

        assertTrue(instance.isOpen());
        GradedEvent result = instance.find(course, null, "Summer 2010", "M1");  
    }
View Full Code Here

   
    @Test(expected = NullPointerException.class)
    public void testFindExpandedNullTerm()
    {
        System.out.println("findExpanded - Null Term");
        Course course = new Course();
        course.setId(new Long(1L));
        course.setName("CS110");

        assertTrue(instance.isOpen());
        GradedEvent result = instance.find(course, "PEX2", null, "M1");  
    }
View Full Code Here

   
    @Test(expected = NullPointerException.class)
    public void testFindExpandedNullVersion()
    {
        System.out.println("findExpanded - Null Version");
        Course course = new Course();
        course.setId(new Long(1L));
        course.setName("CS110");

        assertTrue(instance.isOpen());
        GradedEvent result = instance.find(course, "PEX2", "Summer 2010", null);  
    }
View Full Code Here

   
    @Test(expected = IllegalArgumentException.class)
    public void testFindExpandedInvalidCourseNullCourseName()
    {
        System.out.println("findExpanded - Null Course Name");
        Course course = new Course();
        course.setId(new Long(1L));

        assertTrue(instance.isOpen());
        GradedEvent result = instance.find(course, "PEX2", "Summer 2010", "M1");
    }
View Full Code Here

   
    @Test(expected = IllegalArgumentException.class)
    public void testFindExpandedInvalidName()
    {
        System.out.println("findExpanded - Blank Assignment Name");
        Course course = new Course();
        course.setId(new Long(1L));
        course.setName("CS110");

        assertTrue(instance.isOpen());
        GradedEvent result = instance.find(course, "", "Summer 2010", "M1");  
    }
View Full Code Here

   
    @Test(expected = IllegalArgumentException.class)
    public void testFindExpandedInvalidTerm()
    {
        System.out.println("findExpanded - Blank Term");
        Course course = new Course();
        course.setId(new Long(1L));
        course.setName("CS110");

        assertTrue(instance.isOpen());
        GradedEvent result = instance.find(course, "PEX2", "", "M1");  
    }
View Full Code Here

   
    @Test(expected = IllegalArgumentException.class)
    public void testFindExpandedInvalidVersion()
    {
        System.out.println("findExpanded - Blank Version");
        Course course = new Course();
        course.setId(new Long(1L));
        course.setName("CS110");

        assertTrue(instance.isOpen());
        GradedEvent result = instance.find(course, "PEX2", "Summer 2010", "");  
    }
View Full Code Here

   
    @Test(expected = IllegalStateException.class)
    public void testFindExpandedClosedConnection()
    {
        System.out.println("findExpanded - Closed Connection");
        Course course = new Course();
        course.setId(new Long(1L));
        course.setName("CS110");

        assertTrue(instance.isOpen());
        instance.closeConnection();
        assertFalse(instance.isOpen());
        GradedEvent result = instance.find(course, "PEX2", "Summer 2010", "M1");
View Full Code Here

TOP

Related Classes of com.darkhonor.rage.model.Course

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.