Package com.darkhonor.rage.model

Examples of com.darkhonor.rage.model.GradedEvent


    {
        System.out.println("createNullAssignment");
        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.setTerm("Spring 2010");
        testGradedEvent.setVersion("ALL");
        courseDAO.closeConnection();
        instance.create(testGradedEvent);
    }
View Full Code Here


    {
        System.out.println("createNullTerm");
        assertTrue(instance.isOpen());
        CourseDAO courseDAO = new CourseDAO(testDb.getConnection());
        Course course = courseDAO.find(1L);
        GradedEvent testGradedEvent = new GradedEvent();
        testGradedEvent.setId(new Long(42L));
        testGradedEvent.setCourse(course);
        testGradedEvent.setAssignment("Final");
        testGradedEvent.setVersion("ALL");
        courseDAO.closeConnection();
        instance.create(testGradedEvent);
    }
View Full Code Here

    {
        System.out.println("createNullTermFromConstructor");
        assertTrue(instance.isOpen());
        CourseDAO courseDAO = new CourseDAO(testDb.getConnection());
        Course course = courseDAO.find(1L);
        GradedEvent testGradedEvent = new GradedEvent(course, "Final", "ALL");
        testGradedEvent.setId(new Long(42L));
        courseDAO.closeConnection();
        instance.create(testGradedEvent);
    }
View Full Code Here

    {
        System.out.println("createNullVersion");
        assertTrue(instance.isOpen());
        CourseDAO courseDAO = new CourseDAO(testDb.getConnection());
        Course course = courseDAO.find(1L);
        GradedEvent testGradedEvent = new GradedEvent();
        testGradedEvent.setId(new Long(42L));
        testGradedEvent.setCourse(course);
        testGradedEvent.setAssignment("Final");
        testGradedEvent.setTerm("Spring 2010");
        courseDAO.closeConnection();
        instance.create(testGradedEvent);
    }
View Full Code Here

    {
        System.out.println("createExistingGradedEvent");
        assertTrue(instance.isOpen());
        CourseDAO courseDAO = new CourseDAO(testDb.getConnection());
        Course course = courseDAO.find(1L);
        GradedEvent testGradedEvent = new GradedEvent();
        testGradedEvent.setCourse(course);
        testGradedEvent.setAssignment("PEX2");
        testGradedEvent.setTerm("Summer 2010");
        testGradedEvent.setVersion("M1");
        testGradedEvent.setId(new Long(2L));
        courseDAO.closeConnection();
        instance.create(testGradedEvent);
    }
View Full Code Here

    {
        System.out.println("createClosedConnection");
        assertTrue(instance.isOpen());
        CourseDAO courseDAO = new CourseDAO(testDb.getConnection());
        Course course = courseDAO.find(1L);
        GradedEvent testGradedEvent = new GradedEvent();
        testGradedEvent.setId(new Long(42L));
        testGradedEvent.setCourse(course);
        testGradedEvent.setAssignment("Final");
        testGradedEvent.setTerm("Spring 2010");
        testGradedEvent.setVersion("M1");
        courseDAO.closeConnection();
        instance.closeConnection();
        assertFalse(instance.isOpen());
        instance.create(testGradedEvent);
    }
View Full Code Here

    @Test
    public void testDelete()
    {
        System.out.println("delete");
        assertTrue(instance.isOpen());
        GradedEvent result = instance.find(new Long(3L));
        assertNotNull(result);
        assertEquals("Summer 2010", result.getTerm());
        assertEquals("M2", result.getVersion());
        assertEquals("PEX2", result.getAssignment());

        instance.delete(result);

        assertTrue(instance.isOpen());
        result = instance.find(new Long(3L));
View Full Code Here

    @Test(expected=NullPointerException.class)
    public void testDeleteNullGradedEvent()
    {
        System.out.println("deleteNullGradedEvent");
        assertTrue(instance.isOpen());
        GradedEvent gradedEvent = null;
        instance.delete(gradedEvent);
    }
View Full Code Here

    @Test(expected=IllegalStateException.class)
    public void testDeleteClosedConnection()
    {
        System.out.println("deleteClosedConnection");
        assertTrue(instance.isOpen());
        GradedEvent result = instance.find(new Long(3L));
        assertNotNull(result);
        assertEquals("Summer 2010", result.getTerm());
        assertEquals("M2", result.getVersion());
        assertEquals("PEX2", result.getAssignment());

        assertTrue(instance.isOpen());
        instance.closeConnection();
        assertFalse(instance.isOpen());
       
View Full Code Here

    @Test(expected=IllegalArgumentException.class)
    public void testDeleteNullCourse()
    {
        System.out.println("deleteNullCourse");
        assertTrue(instance.isOpen());
        GradedEvent gradedEvent = new GradedEvent();

        gradedEvent.setAssignment("PEX2");
        gradedEvent.setTerm("Summer 2010");
        gradedEvent.setVersion("M2");
        gradedEvent.setId(new Long(3L));
       
        instance.delete(gradedEvent);
    }
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.