Examples of NodeCond


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

        UserService userService2 = setupCredentials(userService, UserService.class,
                userTO.getUsername(), "password123");

        AttributeCond isNullCond = new AttributeCond(AttributeCond.Type.ISNOTNULL);
        isNullCond.setSchema("loginDate");
        NodeCond searchCondition = NodeCond.getLeafCond(isNullCond);

        List<UserTO> matchedUsers = userService2.search(searchCondition);
        assertNotNull(matchedUsers);
        assertFalse(matchedUsers.isEmpty());
        Set<Long> userIds = new HashSet<Long>(matchedUsers.size());
View Full Code Here

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

        AttributeCond fullnameLeafCond2 = new AttributeCond(AttributeCond.Type.LIKE);
        fullnameLeafCond2.setSchema("fullname");
        fullnameLeafCond2.setExpression("%i%");

        NodeCond searchCondition = NodeCond.getAndCond(NodeCond.getLeafCond(fullnameLeafCond1), NodeCond.getLeafCond(
                fullnameLeafCond2));

        assertTrue(searchCondition.isValid());

        List<UserTO> matchedUsers = userService.search(searchCondition);
       
        assertNotNull(matchedUsers);
        assertFalse(matchedUsers.isEmpty());
View Full Code Here

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

        final AttributableCond idRightCond = new AttributableCond(AttributableCond.Type.LT);
        idRightCond.setSchema("id");
        idRightCond.setExpression("2");

        final NodeCond searchCondition = NodeCond.getAndCond(NodeCond.getLeafCond(usernameLeafCond), NodeCond.
                getLeafCond(idRightCond));

        assertTrue(searchCondition.isValid());

        final List<UserTO> matchingUsers = userService.search(searchCondition);

        assertNotNull(matchingUsers);
        assertEquals(1, matchingUsers.size());
View Full Code Here

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

        final AttributableCond idRightCond = new AttributableCond(AttributableCond.Type.LT);
        idRightCond.setSchema("id");
        idRightCond.setExpression("2");

        final NodeCond searchCondition = NodeCond.getAndCond(NodeCond.getLeafCond(rolenameLeafCond),
                NodeCond.getLeafCond(idRightCond));

        assertTrue(searchCondition.isValid());

        final List<RoleTO> matchingRoles = roleService.search(searchCondition);

        assertNotNull(matchingRoles);
        assertEquals(1, matchingRoles.size());
View Full Code Here

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

        ws2.setResourceName("ws-target-resource2");

        ResourceCond ws1 = new ResourceCond();
        ws1.setResourceName("ws-target-resource-list-mappings-2");

        NodeCond searchCondition = NodeCond.getAndCond(NodeCond.getNotLeafCond(ws2), NodeCond.getLeafCond(ws1));

        assertTrue(searchCondition.isValid());

        List<UserTO> matchedUsers = userService.search(searchCondition);
        assertNotNull(matchedUsers);
        assertFalse(matchedUsers.isEmpty());
View Full Code Here

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

        AttributeCond fullnameLeafCond2 = new AttributeCond(AttributeCond.Type.LIKE);
        fullnameLeafCond2.setSchema("fullname");
        fullnameLeafCond2.setExpression("%i%");

        NodeCond searchCondition = NodeCond.getAndCond(NodeCond.getLeafCond(fullnameLeafCond1), NodeCond.getLeafCond(
                fullnameLeafCond2));

        assertTrue(searchCondition.isValid());

        List<UserTO> matchedUsers = userService.search(searchCondition, 1, 2);
        assertNotNull(matchedUsers);

        assertFalse(matchedUsers.isEmpty());
View Full Code Here

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

    @Test
    public void searchCount() throws InvalidSearchConditionException {
        AttributeCond isNullCond = new AttributeCond(AttributeCond.Type.ISNULL);
        isNullCond.setSchema("loginDate");
        NodeCond searchCond = NodeCond.getLeafCond(isNullCond);

        Integer count = userService.searchCount(searchCond);
        assertNotNull(count);
        assertTrue(count > 0);
    }
View Full Code Here

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

    public void searchByBooleanAttributableCond() throws InvalidSearchConditionException {
        final AttributableCond cond = new AttributableCond(AttributableCond.Type.EQ);
        cond.setSchema("inheritAttributes");
        cond.setExpression("true");

        final NodeCond searchCondition = NodeCond.getLeafCond(cond);

        final List<RoleTO> matchingRoles = roleService.search(searchCondition);
        assertNotNull(matchingRoles);
        assertFalse(matchingRoles.isEmpty());
    }
View Full Code Here

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

        userListCond.setExpression("USER_LIST");

        final EntitlementCond userReadcond = new EntitlementCond();
        userReadcond.setExpression("USER_READ");

        final NodeCond searchCondition = NodeCond.getAndCond(NodeCond.getLeafCond(userListCond),
                NodeCond.getLeafCond(userReadcond));
        assertTrue(searchCondition.isValid());

        final List<RoleTO> matchingRoles = roleService.search(searchCondition);
        assertNotNull(matchingRoles);
        assertFalse(matchingRoles.isEmpty());
    }
View Full Code Here

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

        userOwnerCond.setExpression("5");

        final AttributableCond ppolicyCond = new AttributableCond(AttributableCond.Type.ISNOTNULL);
        ppolicyCond.setSchema("passwordPolicy");

        final NodeCond searchCondition = NodeCond.getAndCond(NodeCond.getLeafCond(userOwnerCond),
                NodeCond.getLeafCond(ppolicyCond));

        assertTrue(searchCondition.isValid());

        final List<RoleTO> matchingRoles = roleService.search(searchCondition);

        assertNotNull(matchingRoles);
        assertEquals(1, matchingRoles.size());
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.