Package org.apache.syncope.common.search

Examples of org.apache.syncope.common.search.AttributableCond


        assertTrue(found);
    }

    @Test
    public void issue242() {
        final AttributableCond cond = new AttributableCond(AttributeCond.Type.LIKE);
        cond.setSchema("id");
        cond.setExpression("test%");

        final NodeCond searchCondition = NodeCond.getLeafCond(cond);
        assertTrue(searchCondition.isValid());

        final List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
View Full Code Here


        assertTrue(users.isEmpty());
    }

    @Test
    public void issueSYNCOPE46() {
        final AttributableCond cond = new AttributableCond(AttributeCond.Type.LIKE);
        cond.setSchema("username");
        cond.setExpression("%ossin%");

        final NodeCond searchCondition = NodeCond.getLeafCond(cond);
        assertTrue(searchCondition.isValid());

        final List<SyncopeUser> users = searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
View Full Code Here

        final String status = execution.getStatus();
        assertNotNull(status);
        assertTrue(PropagationTaskExecStatus.valueOf(status).isSuccessful());

        // 2. verify that synchronized role is found, with expected attributes
        final AttributableCond rolenameLeafCond = new AttributableCond(AttributableCond.Type.EQ);
        rolenameLeafCond.setSchema("name");
        rolenameLeafCond.setExpression("testLDAPGroup");
        final List<RoleTO> matchingRoles = roleService.search(NodeCond.getLeafCond(rolenameLeafCond));
        assertNotNull(matchingRoles);
        assertEquals(1, matchingRoles.size());

        final AttributableCond usernameLeafCond = new AttributableCond(AttributeCond.Type.EQ);
        usernameLeafCond.setSchema("username");
        usernameLeafCond.setExpression("syncFromLDAP");
        final List<UserTO> matchingUsers = userService.search(NodeCond.getLeafCond(usernameLeafCond));
        assertNotNull(matchingUsers);
        assertEquals(1, matchingUsers.size());

        final RoleTO roleTO = matchingRoles.iterator().next();
View Full Code Here

            // users: just id or username can be selected to be used
            // roles: just id or name can be selected to be used
            if ("id".equalsIgnoreCase(schema) || "username".equalsIgnoreCase(schema)
                    || "name".equalsIgnoreCase(schema)) {

                AttributableCond cond = new AttributableCond();
                cond.setSchema(schema);
                cond.setType(type);
                cond.setExpression(expression);

                nodeCond = NodeCond.getLeafCond(cond);
            } else {
                AttributeCond cond = new AttributeCond();
                cond.setSchema(schema);
                cond.setType(type);
                cond.setExpression(expression);

                nodeCond = NodeCond.getLeafCond(cond);
            }

            searchCond = searchCond == null
View Full Code Here

TOP

Related Classes of org.apache.syncope.common.search.AttributableCond

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.