Package se.gu.fire.core

Examples of se.gu.fire.core.StudentGroup


        GroupManager groupMan = new GroupManager();
        groupMan.setEntityManager(em);
       
        FireUser user1 = TestUtil.createRandomUser();

        StudentGroup sg = new StudentGroup();

        sg.addGroupMember(user1);

        em.getTransaction().begin();
        userMan.create(user1);
        groupMan.create(sg);
        em.getTransaction().commit();

        FireUser user2 = userMan.read(user1.getId());
        assertNotNull(user2);

        StudentGroup group = groupMan.read(sg.getId());
        assertNotNull(group);

        assertEquals(user2, user1);
       
        // Test getGroupForUser
        List<FireUser> users = groupMan.getGroupMembers(group);
        assertTrue(users.size() > 0);

        TestData data = new TestData();

        StudentGroup group2 = new StudentGroup();
        group2.addAllGroupMembers(data.users);

        em.getTransaction().begin();
        for (FireUser user : data.users) userMan.create(user);
        groupMan.create(group2);
        em.getTransaction().commit();

        StudentGroup group3 = groupMan.getGroupForUser(data.user2);

        assertEquals(group2, group3);
    }
View Full Code Here


        em.getTransaction().begin();
        um.create(u2);
        em.getTransaction().commit();

        // Student group
        StudentGroup group = new StudentGroup();
        em.getTransaction().begin();
        group.addGroupMember(u);
        gm.create(group);
        em.getTransaction().commit();

        assertEquals(SubmissionStatus.NotSubmitted, sm.getAssignmentStatus(assign, group));
View Full Code Here

TOP

Related Classes of se.gu.fire.core.StudentGroup

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.