Package org.osgi.service.useradmin

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


       
        m_latch = new CountDownLatch(1);
       
        new Thread(new Runnable() {
            public void run() {
                assertTrue(role.removeMember(anyone));
            };
        }).start();

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


       
        m_latch = new CountDownLatch(1);
       
        new Thread(new Runnable() {
            public void run() {
                role.removeMember(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.removeMember(anyone);
            };
        }).start();

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

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

    /**
     * Tests that removing a required member from a group works.
View Full Code Here

        Group group1 = (Group) m_userAdmin.createRole("group1", Role.GROUP);
       
        assertTrue(group1.addMember(user1));
       
        assertTrue(group1.removeMember(user1));
        assertFalse(group1.removeMember(user1));
    }

    /**
     * Tests that removing a required member from a group works.
     */
 
View Full Code Here

        User user1 = (User) m_userAdmin.createRole("user1", Role.USER);
        Group group1 = (Group) m_userAdmin.createRole("group1", Role.GROUP);
       
        assertTrue(group1.addRequiredMember(user1));
       
        assertTrue(group1.removeMember(user1));
        assertFalse(group1.removeMember(user1));
    }

    /**
     * Tests that testing for required group membership works.
View Full Code Here

        Group group1 = (Group) m_userAdmin.createRole("group1", Role.GROUP);
       
        assertTrue(group1.addRequiredMember(user1));
       
        assertTrue(group1.removeMember(user1));
        assertFalse(group1.removeMember(user1));
    }

    /**
     * Tests that testing for required group membership works.
     */
 
View Full Code Here

                toJSON(jw, xgroup, false);
            }
            else if ("removeMember".equals(action)) { //$NON-NLS-1$
                final Role xrole = userAdmin.getRole(role);
                final Group xgroup = (Group) userAdmin.getRole(group);
                xgroup.removeMember(xrole);
                toJSON(jw, xgroup, false);
            }
            else if ("del".equals(action)) { //$NON-NLS-1$
                out.print(userAdmin.removeRole(role));
            }
View Full Code Here

        User user = getUser(username);
        if (user == null) {
            throw new UserNotFoundException(username);
        }
        Group group = getGroup(user);
        group.removeMember(user);
        m_useradmin.removeRole(user.getName());
    }

    @Override
    public List<UserDTO> getData() {
View Full Code Here

        Group group1 = Mockito.mock(Group.class);
        User user1 = Mockito.mock(User.class);
        Mockito.when(userAdmin.getRole("group1")).thenReturn(group1);
        Mockito.when(userAdmin.getRole("user1")).thenReturn(user1);
        Mockito.when(group1.getType()).thenReturn(Role.GROUP);
        Mockito.when(group1.removeMember(user1)).thenReturn(true);
        boolean isAdded = mbean.removeMember("group1", "user1");
        Assert.assertTrue(isAdded);
        Mockito.verify(group1).removeMember(user1);
    }
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.