Examples of addSpaceWithRole()


Examples of info.jtrac.domain.User.addSpaceWithRole()

        Space s = getSpace();
        jtrac.storeSpace(s);
        User u = new User();
        u.setLoginName("test");
        u.setEmail("dummy");
        u.addSpaceWithRole(s, "DEFAULT");
        jtrac.storeUser(u);
        //========================
        Item i0 = new Item();
        i0.setSpace(s);
        i0.setAssignedTo(u);
View Full Code Here

Examples of info.jtrac.domain.User.addSpaceWithRole()

        Space s = getSpace();
        jtrac.storeSpace(s);
        User u = new User();
        u.setLoginName("test");
        u.setEmail("dummy");
        u.addSpaceWithRole(s, "DEFAULT");
        jtrac.storeUser(u);
        //========================
        Item i = new Item();
        i.setSpace(s);
        i.setAssignedTo(u);
View Full Code Here

Examples of info.jtrac.domain.User.addSpaceWithRole()

        //========================
        // another user to "watch" this item
        User w = new User();
        w.setLoginName("test1");
        w.setEmail("dummy");
        w.addSpaceWithRole(s, "DEFAULT");
        jtrac.storeUser(w);
        ItemUser iu = new ItemUser(w);
        Set<ItemUser> ius = new HashSet<ItemUser>();
        ius.add(iu);
        i.setItemUsers(ius);
View Full Code Here

Examples of info.jtrac.domain.User.addSpaceWithRole()

        jtrac.storeSpace(s2);
       
        User u1 = new User();
        u1.setLoginName("test");
       
        u1.addSpaceWithRole(s1, "DEFAULT");
        jtrac.storeUser(u1);
       
        List<Space> list = jtrac.findSpacesNotFullyAllocatedToUser(u1.getId());
        assertEquals(2, list.size());
       
View Full Code Here

Examples of info.jtrac.domain.User.addSpaceWithRole()

            User admin = new User();
            admin.setLoginName("admin");
            admin.setName("Admin");
            admin.setEmail("admin");
            admin.setPassword("21232f297a57a5a743894a0e4a801fc3");
            admin.addSpaceWithRole(null, Role.ROLE_ADMIN);
            logger.info("inserting default admin user into database");
            storeUser(admin);
            logger.info("schema creation complete");
        }
        List<SpaceSequence> ssList = getHibernateTemplate().loadAll(SpaceSequence.class);
View Full Code Here

Examples of info.jtrac.domain.User.addSpaceWithRole()

        jtrac.storeSpace(space);
       
        User user = new User();
        user.setLoginName("test");
       
        user.addSpaceWithRole(space, "ROLE_TEST");
        jtrac.storeUser(user);
       
        User u1 = jtrac.loadUser("test");
       
        GrantedAuthority[] gas = u1.getAuthorities();
View Full Code Here

Examples of info.jtrac.domain.User.addSpaceWithRole()

    }
   
    public void testStoreAndLoadUserWithAdminRole() {
        User user = new User();
        user.setLoginName("test");
        user.addSpaceWithRole(null, "ROLE_ADMIN");
        jtrac.storeUser(user);
       
        UserDetails ud = jtrac.loadUserByUsername("test");
       
        Set<String> set = new HashSet<String>();
View Full Code Here

Examples of info.jtrac.domain.User.addSpaceWithRole()

    public void testItemInsertAndCounts() {
        Space s = getSpace();
        jtrac.storeSpace(s);
        User u = new User();
        u.setLoginName("test");
        u.addSpaceWithRole(s, "DEFAULT");
        jtrac.storeUser(u);
        Item i = new Item();
        i.setSpace(s);
        i.setAssignedTo(u);
        i.setLoggedBy(u);
View Full Code Here

Examples of info.jtrac.domain.User.addSpaceWithRole()

        Space space = getSpace();
        jtrac.storeSpace(space);
        long spaceId = space.getId();
        User user = new User();
        user.setLoginName("test");
        user.addSpaceWithRole(space, "ROLE_ADMIN");
        jtrac.storeUser(user);
        long id = jdbcTemplate.queryForLong("select id from user_space_roles where space_id = " + spaceId);
        UserSpaceRole usr = jtrac.loadUserSpaceRole(id);
        assertEquals(spaceId, usr.getSpace().getId());
        jtrac.removeUserSpaceRole(usr);
View Full Code Here

Examples of info.jtrac.domain.User.addSpaceWithRole()

    public void testRenameSpaceRole() {
        Space space = getSpace();
        jtrac.storeSpace(space);
        User u = new User();
        u.setLoginName("test");
        u.addSpaceWithRole(space, "DEFAULT");
        jtrac.storeUser(u);
        assertEquals(1, jdbcTemplate.queryForInt("select count(0) from user_space_roles where role_key = 'DEFAULT'"));
        jtrac.bulkUpdateRenameSpaceRole(space, "DEFAULT", "NEWDEFAULT");
        assertEquals(0, jdbcTemplate.queryForInt("select count(0) from user_space_roles where role_key = 'DEFAULT'"));
        assertEquals(1, jdbcTemplate.queryForInt("select count(0) from user_space_roles where role_key = 'NEWDEFAULT'"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.