Package org.osgi.service.useradmin

Examples of org.osgi.service.useradmin.Group.addMember()


        m_latch = new CountDownLatch(1);
       
        new Thread(new Runnable() {
            public void run() {
                Role anyone = m_repository.getRoleByName(Role.USER_ANYONE);
                assertTrue(role.addMember(anyone));
            };
        }).start();

        assertTrue(m_latch.await(1, TimeUnit.SECONDS));
    }
View Full Code Here


        m_latch = new CountDownLatch(1);
       
        new Thread(new Runnable() {
            public void run() {
                Role anyone = m_roleRepository.getRoleByName(Role.USER_ANYONE);
                role.addMember(anyone);
            };
        }).start();

        assertTrue(m_latch.await(1, TimeUnit.SECONDS));
    }
View Full Code Here

     * Tests whether removing a role from a group causes an event to be emitted to the {@link RoleRepository}.
     */
    public void testRemoveBasicRoleYieldsEventOk() throws Exception {
        final Role anyone = m_roleRepository.getRoleByName(Role.USER_ANYONE);
        final Group role = (Group) m_roleRepository.addRole("bar", Role.GROUP);
        role.addMember(anyone);
       
        m_latch = new CountDownLatch(1);
       
        new Thread(new Runnable() {
            public void run() {
View Full Code Here

     */
    public void testAddGroupMemberOk() {
        User user1 = (User) m_userAdmin.createRole("user1", Role.USER);
        Group group1 = (Group) m_userAdmin.createRole("group1", Role.GROUP);
       
        assertTrue(group1.addMember(user1));
        assertFalse(group1.addMember(user1));
    }

    /**
     * Tests that adding a required member to a group works.
View Full Code Here

    public void testAddGroupMemberOk() {
        User user1 = (User) m_userAdmin.createRole("user1", Role.USER);
        Group group1 = (Group) m_userAdmin.createRole("group1", Role.GROUP);
       
        assertTrue(group1.addMember(user1));
        assertFalse(group1.addMember(user1));
    }

    /**
     * Tests that adding a required member to a group works.
     */
 
View Full Code Here

        User user1 = (User) m_userAdmin.createRole("user1", Role.USER);
        User user2 = (User) m_userAdmin.createRole("user2", Role.USER);
        User user3 = (User) m_userAdmin.createRole("user3", Role.USER);

        Group reqGroup = (Group) m_userAdmin.createRole("reqGroup", Role.GROUP);
        reqGroup.addMember(user1);
        reqGroup.addMember(user2);
        reqGroup.addMember(user3);
       
        Group group = (Group) m_userAdmin.createRole("group", Role.GROUP);
        group.addRequiredMember(reqGroup);
View Full Code Here

        User user2 = (User) m_userAdmin.createRole("user2", Role.USER);
        User user3 = (User) m_userAdmin.createRole("user3", Role.USER);

        Group reqGroup = (Group) m_userAdmin.createRole("reqGroup", Role.GROUP);
        reqGroup.addMember(user1);
        reqGroup.addMember(user2);
        reqGroup.addMember(user3);
       
        Group group = (Group) m_userAdmin.createRole("group", Role.GROUP);
        group.addRequiredMember(reqGroup);
        group.addMember(user1);
View Full Code Here

        User user3 = (User) m_userAdmin.createRole("user3", Role.USER);

        Group reqGroup = (Group) m_userAdmin.createRole("reqGroup", Role.GROUP);
        reqGroup.addMember(user1);
        reqGroup.addMember(user2);
        reqGroup.addMember(user3);
       
        Group group = (Group) m_userAdmin.createRole("group", Role.GROUP);
        group.addRequiredMember(reqGroup);
        group.addMember(user1);
        group.addMember(user2);
View Full Code Here

        reqGroup.addMember(user2);
        reqGroup.addMember(user3);
       
        Group group = (Group) m_userAdmin.createRole("group", Role.GROUP);
        group.addRequiredMember(reqGroup);
        group.addMember(user1);
        group.addMember(user2);

        Authorization auth = m_userAdmin.getAuthorization(user1);
        assertTrue(auth.hasRole("group"));
       
View Full Code Here

        reqGroup.addMember(user3);
       
        Group group = (Group) m_userAdmin.createRole("group", Role.GROUP);
        group.addRequiredMember(reqGroup);
        group.addMember(user1);
        group.addMember(user2);

        Authorization auth = m_userAdmin.getAuthorization(user1);
        assertTrue(auth.hasRole("group"));
       
        auth = m_userAdmin.getAuthorization(user2);
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.