Package com.darkhonor.rage.model

Examples of com.darkhonor.rage.model.GradedEvent


        question2.setName("Sequencer");
       
        int result1 = instance.removeQuestionFromAllGradedEvents(question1);
        assertEquals(2, result1);
       
        GradedEvent gradedEvent = instance.find(new Long(2L));
        assertEquals(0, gradedEvent.getQuestions().size());
       
        int result2 = instance.removeQuestionFromAllGradedEvents(question2);
        assertEquals(1, result2);
       
        gradedEvent = instance.find(new Long(5L));
        assertEquals(0, gradedEvent.getQuestions().size());
       
        EntityManager em = testDb.getConnection();
       
        Question testQuestion1 = em.find(Question.class, new Long(2L));
        assertNotNull(testQuestion1);
View Full Code Here


        question2.setName("Sequencer");
       
        int result1 = instance.removeQuestionFromAllGradedEvents(question1);
        assertEquals(2, result1);
       
        GradedEvent gradedEvent = instance.find(new Long(2L));
        assertEquals(0, gradedEvent.getQuestions().size());
       
        int result2 = instance.removeQuestionFromAllGradedEvents(question2);
        assertEquals(1, result2);
       
        gradedEvent = instance.find(new Long(5L));
        assertEquals(0, gradedEvent.getQuestions().size());
       
        EntityManager em = testDb.getConnection();
       
        Question testQuestion1 = em.find(Question.class, new Long(2L));
        assertNotNull(testQuestion1);
View Full Code Here

        System.out.println("getAllVersionsOfGradedEventNullTerm");
        assertTrue(instance.isOpen());
        CourseDAO courseDAO = new CourseDAO(testDb.getConnection());
        Course course = courseDAO.find(1L);

        GradedEvent assignment = new GradedEvent();
        assignment.setCourse(course);
        assignment.setAssignment("PEX2");
        assignment.setVersion("ALL");

        courseDAO.closeConnection();
        List<GradedEvent> result = instance.getAllVersionsOfGradedEvent(assignment);
    }
View Full Code Here

        System.out.println("getAllVersionsOfGradedEventNullTerm");
        assertTrue(instance.isOpen());
        CourseDAO courseDAO = new CourseDAO(testDb.getConnection());
        Course course = courseDAO.find(1L);

        GradedEvent assignment = new GradedEvent();
        assignment.setCourse(course);
        assignment.setTerm("Summer 2010");
        assignment.setVersion("ALL");

        courseDAO.closeConnection();
        List<GradedEvent> result = instance.getAllVersionsOfGradedEvent(assignment);
    }
View Full Code Here

        System.out.println("getAllVersionsOfGradedEventNullVersion");
        assertTrue(instance.isOpen());
        CourseDAO courseDAO = new CourseDAO(testDb.getConnection());
        Course course = courseDAO.find(1L);

        GradedEvent assignment = new GradedEvent();
        assignment.setCourse(course);
        assignment.setTerm("Summer 2010");
        assignment.setAssignment("PEX1");

        courseDAO.closeConnection();
        List<GradedEvent> result = instance.getAllVersionsOfGradedEvent(assignment);
    }
View Full Code Here

    {
        System.out.println("create");
        assertTrue(instance.isOpen());
        CourseDAO courseDAO = new CourseDAO(testDb.getConnection());
        Course course = courseDAO.find(2L);
        GradedEvent testGradedEvent = new GradedEvent();
        testGradedEvent.setId(new Long(42L));
        testGradedEvent.setCourse(course);
        testGradedEvent.setAssignment("Final");
        testGradedEvent.setTerm("Spring 2010");
        testGradedEvent.setVersion("M1");
        Long newId = instance.create(testGradedEvent);
        assertNotNull(newId);
        assertEquals(newId, new Long(42L));
        assertEquals(5, instance.getGradedEventsByCourseAndAssignment().size());
        GradedEvent result = instance.find(new Long(42L));
        assertNotNull(result);
        assertEquals("Final", result.getAssignment());
        assertEquals("Spring 2010", result.getTerm());
        assertEquals("M1", result.getVersion());
        assertEquals(course, result.getCourse());
        assertEquals(testGradedEvent, result);
        courseDAO.closeConnection();
    }
View Full Code Here

    {
        System.out.println("createNullId");
        assertTrue(instance.isOpen());
        CourseDAO courseDAO = new CourseDAO(testDb.getConnection());
        Course course = courseDAO.find(2L);
        GradedEvent testGradedEvent = new GradedEvent();
        testGradedEvent.setCourse(course);
        testGradedEvent.setAssignment("Final");
        testGradedEvent.setTerm("Spring 2011");
        testGradedEvent.setVersion("M1");
        Long newId = instance.create(testGradedEvent);
        assertNotNull(newId);
        assertTrue(newId != 0);
        assertTrue(newId > 0);
        System.out.println("New Id: " + newId);
View Full Code Here

    @Test(expected = NullPointerException.class)
    public void testCreateNullGradedEvent()
    {
        System.out.println("createNullGradedEvent");
        assertTrue(instance.isOpen());
        GradedEvent testGradedEvent = null;
        instance.create(testGradedEvent);
    }
View Full Code Here

    @Test(expected=IllegalArgumentException.class)
    public void testCreateNullCourseTermAssignmentVersion()
    {
        System.out.println("createNullCourseTermAssignmentVersion");
        assertTrue(instance.isOpen());
        GradedEvent testGradedEvent = new GradedEvent();
        instance.create(testGradedEvent);
    }
View Full Code Here

    @Test(expected=IllegalArgumentException.class)
    public void testCreateNullCourse()
    {
        System.out.println("createNullCourse");
        assertTrue(instance.isOpen());
        GradedEvent testGradedEvent = new GradedEvent();
        testGradedEvent.setId(new Long(42L));
        testGradedEvent.setAssignment("Final");
        testGradedEvent.setTerm("Spring 2010");
        testGradedEvent.setVersion("ALL");
        instance.create(testGradedEvent);
    }
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.