Package org.apache.syncope.core.persistence.dao.search

Examples of org.apache.syncope.core.persistence.dao.search.MembershipCond


    @Test
    public void roles() {
        String fiqlExpression = SyncopeClient.getUserSearchConditionBuilder().hasRoles(1L).query();
        assertEquals(SpecialAttr.ROLES + "==1", fiqlExpression);

        MembershipCond membCond = new MembershipCond();
        membCond.setRoleId(1L);
        SearchCond simpleCond = SearchCond.getLeafCond(membCond);

        assertEquals(simpleCond, SearchCondConverter.convert(fiqlExpression));
    }
View Full Code Here


    @Test
    public void userMatch() {
        SyncopeUser user = userDAO.find(1L);
        assertNotNull(user);

        MembershipCond membershipCond = new MembershipCond();
        membershipCond.setRoleId(5L);

        assertFalse(searchDAO.matches(user, SearchCond.getLeafCond(membershipCond), SubjectType.USER));

        membershipCond.setRoleId(1L);

        assertTrue(searchDAO.matches(user, SearchCond.getLeafCond(membershipCond), SubjectType.USER));
    }
View Full Code Here

    public void searchWithLikeCondition() {
        AttributeCond fullnameLeafCond = new AttributeCond(AttributeCond.Type.LIKE);
        fullnameLeafCond.setSchema("fullname");
        fullnameLeafCond.setExpression("%o%");

        MembershipCond membershipCond = new MembershipCond();
        membershipCond.setRoleId(1L);

        AttributeCond loginDateCond = new AttributeCond(AttributeCond.Type.EQ);
        loginDateCond.setSchema("loginDate");
        loginDateCond.setExpression("2009-05-26");
View Full Code Here

    public void searchByPageAndSize() {
        AttributeCond fullnameLeafCond = new AttributeCond(AttributeCond.Type.LIKE);
        fullnameLeafCond.setSchema("fullname");
        fullnameLeafCond.setExpression("%o%");

        MembershipCond membershipCond = new MembershipCond();
        membershipCond.setRoleId(1L);

        AttributeCond loginDateCond = new AttributeCond(AttributeCond.Type.EQ);
        loginDateCond.setSchema("loginDate");
        loginDateCond.setExpression("2009-05-26");
View Full Code Here

        assertTrue(users.isEmpty());
    }

    @Test
    public void searchByMembership() {
        MembershipCond membershipCond = new MembershipCond();
        membershipCond.setRoleId(1L);

        List<SyncopeUser> users = searchDAO.search(
                EntitlementUtil.getRoleIds(entitlementDAO.findAll()), SearchCond.getLeafCond(membershipCond),
                SubjectType.USER);
        assertNotNull(users);
        assertEquals(2, users.size());

        membershipCond = new MembershipCond();
        membershipCond.setRoleId(5L);

        users = searchDAO.search(
                EntitlementUtil.getRoleIds(entitlementDAO.findAll()), SearchCond.getNotLeafCond(membershipCond),
                SubjectType.USER);
        assertNotNull(users);
View Full Code Here

                    leaf = SearchCond.getLeafCond(attributeCond);
                } else {
                    switch (specialAttrName) {
                        case ROLES:
                            MembershipCond membershipCond = new MembershipCond();
                            membershipCond.setRoleId(Long.valueOf(value));
                            leaf = SearchCond.getLeafCond(membershipCond);
                            break;

                        case RESOURCES:
                            ResourceCond resourceCond = new ResourceCond();
View Full Code Here

TOP

Related Classes of org.apache.syncope.core.persistence.dao.search.MembershipCond

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.