Package org.apache.rave.portal.model

Examples of org.apache.rave.portal.model.Authority


        return new SearchResult<User>(users, totalResult);
    }

    private static SearchResult<Authority> createSearchResultWithTwoAuthorities() {
        List<Authority> authorities = new ArrayList<Authority>();
        Authority foo = new Authority();
        foo.setAuthority("FOO");
        Authority bar = new Authority();
        bar.setAuthority("BAR");
        authorities.add(foo);
        authorities.add(bar);
        return new SearchResult<Authority>(authorities, authorities.size());
    }
View Full Code Here


     */
    private class AuthorityEditor extends PropertyEditorSupport {

        @Override
        public void setAsText(String text) throws IllegalArgumentException {
            Authority authority = authorityService.getAuthorityByName(text);
            setValue(authority);
        }
View Full Code Here

        validPageLayout = new PageLayout();
        validPageLayout.setEntityId(99L);
        validPageLayout.setNumberOfRegions(4L);
        validPageLayout.setCode(VALID_LAYOUT_CODE);
       
        Authority role1 = new Authority();
        role1.setAuthority("DEFAULT_ROLE1");
        Authority role2 = new Authority();
        role2.setAuthority("DEFAULT_ROLE2");
       
        validAuthorityList = new ArrayList<Authority>();
        validAuthorityList.add(role1);
        validAuthorityList.add(role2);
        validAuthoritySearchResult = new SearchResult<Authority>(validAuthorityList, validAuthorityList.size());       
View Full Code Here

     */
    private class AuthorityEditor extends PropertyEditorSupport {

        @Override
        public void setAsText(String text) throws IllegalArgumentException {
            Authority authority = authorityService.getAuthorityByName(text);
            setValue(authority);
        }
View Full Code Here

        assertThat(user.getEmail(), is(equalTo(USER_EMAIL)));
    }

    @Test
    public void addOrDeleteUserDoesNotAffectAuthority() {
        Authority authority = authorityRepository.get(1L);
        Assert.assertNotNull("Existing authority", authority);

        int usercount = authority.getUsers().size();
        User user = new User();
        user.setUsername("dummy");
        authority.addUser(user);
        authorityRepository.save(authority);
        assertNull("Persisting an Authority does not persist an unknown user", repository.getByUsername("dummy"));
        Assert.assertEquals("Authority has 1 more user", usercount + 1, authority.getUsers().size());

        repository.save(user);
        user = repository.getByUsername("dummy");
        Assert.assertNotNull(user);
        Assert.assertEquals("Authority has 1 more user", usercount + 1, authority.getUsers().size());

        repository.delete(user);
        authority = authorityRepository.get(1L);
        Assert.assertNotNull("Authority has not been removed after deleting user", authority);
        Assert.assertEquals("Authority has original amount of users", usercount, authority.getUsers().size());
    }
View Full Code Here

        return new SearchResult<User>(users, totalResult);
    }

    private static SearchResult<Authority> createSearchResultWithTwoAuthorities() {
        List<Authority> authorities = new ArrayList<Authority>();
        Authority foo = new AuthorityImpl();
        foo.setAuthority("FOO");
        Authority bar = new AuthorityImpl();
        bar.setAuthority("BAR");
        authorities.add(foo);
        authorities.add(bar);
        return new SearchResult<Authority>(authorities, authorities.size());
    }
View Full Code Here

        return new SearchResult<User>(users, totalResult);
    }

    private static SearchResult<Authority> createSearchResultWithTwoAuthorities() {
        List<Authority> authorities = new ArrayList<Authority>();
        Authority foo = new Authority();
        foo.setAuthority("FOO");
        Authority bar = new Authority();
        bar.setAuthority("BAR");
        authorities.add(foo);
        authorities.add(bar);
        return new SearchResult<Authority>(authorities, authorities.size());
    }
View Full Code Here

     */
    private class AuthorityEditor extends PropertyEditorSupport {

        @Override
        public void setAsText(String text) throws IllegalArgumentException {
            Authority authority = authorityService.getAuthorityByName(text);
            setValue(authority);
        }
View Full Code Here

        assertThat(user.getEmail(), is(equalTo(USER_EMAIL)));
    }

    @Test
    public void addOrDeleteUserDoesNotAffectAuthority() {
        Authority authority = authorityRepository.get(1L);
        Assert.assertNotNull("Existing authority", authority);

        int usercount = authority.getUsers().size();
        User user = new JpaUser();
        user.setUsername("dummy");
        authority.addUser(user);
        authorityRepository.save(authority);
        assertNull("Persisting an Authority does not persist an unknown user", repository.getByUsername("dummy"));
        Assert.assertEquals("Authority has 1 more user", usercount + 1, authority.getUsers().size());

        repository.save(user);
        user = repository.getByUsername("dummy");
        Assert.assertNotNull(user);
        Assert.assertEquals("Authority has 1 more user", usercount + 1, authority.getUsers().size());

        repository.delete(user);
        authority = authorityRepository.get(1L);
        Assert.assertNotNull("Authority has not been removed after deleting user", authority);
        Assert.assertEquals("Authority has original amount of users", usercount, authority.getUsers().size());
    }
View Full Code Here

    }

    @Test
    public void getByAuthorityName() {
        String authorityName = "administrator";
        Authority authority = repository.getByAuthority(authorityName);
        assertNotNull(authority);
        assertEquals(authorityName, authority.getAuthority());
        assertTrue(authority.getUsers().isEmpty());
    }
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.Authority

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.