Package com.darkhonor.rage.model

Examples of com.darkhonor.rage.model.GradedEvent


    public void testUpdateTerm()
    {
        System.out.println("updateTerm");
        assertTrue(instance.isOpen());

        GradedEvent gradedEvent = instance.find(new Long(3L));
        gradedEvent.setTerm("Fall 2010");

        assertEquals(1, gradedEvent.getQuestions().size());

        // Make sure the updated GradedEvent is returned from the method
        GradedEvent result = instance.update(gradedEvent);
        assertNotNull(result);

        // Grab the updated GradedEvent from the Data source
        GradedEvent requestQuery = instance.find(new Long(3L));

        // Verify the data is maintained across the 3 versions (local, result from
        // update, and query of the data source

        // Id
        assertEquals(new Long(3L), requestQuery.getId());
        assertEquals(result.getId(), requestQuery.getId());

        // Course
        assertEquals("CS110", requestQuery.getCourse().getName());
        assertEquals(result.getCourse(), requestQuery.getCourse());

        // Assignment
        assertEquals("PEX2", requestQuery.getAssignment());
        assertEquals(result.getAssignment(), requestQuery.getAssignment());

        // Term
        assertEquals("Fall 2010", requestQuery.getTerm());
        assertEquals(result.getTerm(), requestQuery.getTerm());

        // Version
        assertEquals("M2", requestQuery.getVersion());
        assertEquals(result.getVersion(), requestQuery.getVersion());

        // Due Date
        assertEquals("29 Apr 2010", requestQuery.getDueDate());
        assertEquals(result.getDueDate(), requestQuery.getDueDate());

        // Partial Credit
        assertEquals(true, requestQuery.getPartialCredit());
        assertEquals(result.getPartialCredit(), requestQuery.getPartialCredit());

        // Number of Questions
        assertEquals(1, requestQuery.getQuestions().size());
        assertEquals(result.getQuestions().size(), requestQuery.getQuestions().size());

        assertTrue(instance.isOpen());
    }
View Full Code Here


        System.out.println("find");
        assertTrue(instance.isOpen());
        CourseDAO courseDAO = new CourseDAO(testDb.getConnection());
        Course course = courseDAO.find(1L);
        Long id = new Long(3L);
        GradedEvent expResult = new GradedEvent(course, "PEX2", "M2");
        expResult.setTerm("Summer 2010");
        expResult.setId(new Long(3L));
        GradedEvent result = instance.find(id);
        assertNotNull(result);
        assertEquals("Summer 2010", result.getTerm());
        assertEquals("PEX2", result.getAssignment());
        assertEquals("M2", result.getVersion());
        assertEquals(course, result.getCourse());
        assertEquals(expResult, result);
        courseDAO.closeConnection();
    }
View Full Code Here

    public void testFindNoResult()
    {
        System.out.println("findIdNoResult");
        assertTrue(instance.isOpen());
        Long resultId = new Long(12L);
        GradedEvent result = instance.find(resultId);
        assertNull(result);
    }
View Full Code Here

    public void testFindIdLessThanZero()
    {
        System.out.println("findIdLessThanZero");
        assertTrue(instance.isOpen());
        Long resultId = new Long(-3L);
        GradedEvent result = instance.find(resultId);
    }
View Full Code Here

    public void testFindZeroId()
    {
        System.out.println("findZeroId");
        assertTrue(instance.isOpen());
        Long resultId = new Long(0L);
        GradedEvent result = instance.find(resultId);
    }
View Full Code Here

    public void testFindNullId()
    {
        System.out.println("findNullId");
        assertTrue(instance.isOpen());
        Long nullId = null;
        GradedEvent result = instance.find(nullId);
    }
View Full Code Here

        System.out.println("findClosedConnection");
        assertTrue(instance.isOpen());
        instance.closeConnection();
        assertFalse(instance.isOpen());
        Long resultId = new Long(2L);
        GradedEvent result = instance.find(resultId);
    }
View Full Code Here

        Course course = new Course();
        course.setId(new Long(1L));
        course.setName("CS110");

        assertTrue(instance.isOpen());
        GradedEvent result = instance.find(course, "PEX2", "Summer 2010", "M1");
        assertNotNull(result);
        Long expectedId = new Long(2L);
        assertEquals(expectedId, result.getId());
        assertEquals(course, result.getCourse());
        assertEquals("PEX2", result.getAssignment());
        assertEquals("Summer 2010", result.getTerm());
        assertEquals("M1", result.getVersion());
        assertTrue(result.getPartialCredit());
        assertEquals(1, result.getQuestions().size());
    }
View Full Code Here

        Course course = new Course();
        course.setId(new Long(100L));
        course.setName("CS192");

        assertTrue(instance.isOpen());
        GradedEvent result = instance.find(course, "TowersOfHanoi",
                "Summer 2012", "ALL");
        assertNull(result);
    }
View Full Code Here

    {
        System.out.println("findExpanded - Null Course");
        Course course = null;
       
        assertTrue(instance.isOpen());
        GradedEvent result = instance.find(course, "PEX2", "Summer 2010", "M1");
    }
View Full Code Here

TOP

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

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.