Package org.encuestame.persistence.domain.security

Examples of org.encuestame.persistence.domain.security.Group


     * @throws EnMeExpcetion
     */
    @Category(DefaultTest.class)
    @Test
    public void testUpdateGroup() throws EnMeExpcetion {
        Group secgroups = createGroups("guests");
        Long idGroupUpdate = secgroups.getGroupId();
        UnitGroupBean groupBean = ConvertDomainBean
                .convertGroupDomainToBean(secgroups);
        groupBean.setGroupName("editors");
        securityService.updateGroup(groupBean);
        Group groupUpdateRetrieve = getGroup().getGroupById(idGroupUpdate);
        assertEquals("Should be", "editors", groupUpdateRetrieve.getGroupName());

    }
View Full Code Here


     * @throws EnMeNoResultsFoundException
     */
    @Category(DefaultTest.class)
    @Test
    public void testCreateGroup() throws EnMeNoResultsFoundException {
        Group secCreateGroup = new Group();
        secCreateGroup.setGroupId(12L);
        secCreateGroup.setGroupDescriptionInfo("1111");
        secCreateGroup.setGroupName("vvvv");
        secCreateGroup.setIdState(1L);
        final UnitGroupBean createGroupBean = ConvertDomainBean
                .convertGroupDomainToBean(secCreateGroup);
        securityService.createGroup(createGroupBean,
                this.userAccount.getUsername());
        // TODO: need assert
View Full Code Here

    @Category(DefaultTest.class)
    @Test
    public void testAssignGroup() throws EnMeExpcetion {
        final UserAccount users = createUserAccount("juanpicado",
                this.userPrimary);
        final Group groups = createGroups("encuestador");
        UserAccountBean userBean = ConvertDomainBean
                .convertSecondaryUserToUserBean(users);
        UnitGroupBean groupBean = ConvertDomainBean
                .convertGroupDomainToBean(groups);
        // securityService.assingGroup(userBean, groupBean);
View Full Code Here

    public Group createGroups(final String groupname){
        return createGroups(groupname, this.createAccount());
    }

    public Group createGroups(final String groupname, final Account secUser){
        final Group group = new Group();
        group.setAccount(secUser);
        group.setGroupName(groupname);
        group.setIdState(1L);
        group.setGroupType(Type.SECURITY);
        group.setGroupDescriptionInfo("First Group");
        getGroup().saveOrUpdate(group);
        return group;
    }
View Full Code Here

    /**
     * Test Sec Groups Domain.
     **/
    @Test
    public void testSecGroups(){
        final Group groups = new Group();
        groups.setGroupName("writers");
        groups.setGroupDescriptionInfo("writers");
        groups.setAccount(createAccount());
        groups.getPermissions().add(createPermission("administrator"));
        groups.getProjects().add(createProject("TIC", "TIC", "TIC", createAccount()));
        getGroup().saveOrUpdate(groups);
        assertNotNull(groups.getGroupId());
    }
View Full Code Here

    @Test
    public void testAddPermissionToGroup(){
        final Permission editor = createPermission("editor");
        final Permission admon = createPermission("publisher");
        final Permission permission = createPermission("administrator");
        final Group group = createGroups("group 1");
        group.getPermissions().add(editor);
        group.getPermissions().add(admon);
        group.getPermissions().add(permission);
        getGroup().saveOrUpdate(group);
        assertEquals("Should be equals", 3, group.getPermissions().size());
    }
View Full Code Here

    /**
    *Test Create Group.
    */
    @Test
    public void TestCreateGroup(){
        final Group group = super.createGroups("first group");
        assertNotNull(group);
    }
View Full Code Here

    /**
     * Test Delete Group.
     */
    @Test
   public void TestDeleteGroup(){
        final Group group = super.createGroups("second group");
        getGroup().delete(group);
        assertNotNull(this.secGroup);
        assertEquals("Should be equals",1, getGroup().findAllGroups().size());
    }
View Full Code Here

    /**Test Update Group**/
    @Test
    public void TestUpdateGroup(){
        final String newName = "Administrator";
        final String newDescription = "System Admin";
        final Group group = super.createGroups("fifth group");
        group.setGroupName(newName);
        group.setGroupDescriptionInfo(newDescription);
        getGroup().saveOrUpdate(group);
        final Group retrieveGroup = getGroupDaoImp().getGroupById(
                Long.valueOf(group.getGroupId()));
    assertEquals("New Name should be", newName,
        retrieveGroup.getGroupName());
    assertEquals("New Description should be", newDescription,
        retrieveGroup.getGroupDescriptionInfo());
    }
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.security.Group

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.