Package org.apache.jackrabbit.api.security.user

Examples of org.apache.jackrabbit.api.security.user.Query


        assertSameElements(result, expected);
    }

    @Test
    public void testPropertyExistence() throws RepositoryException {
        Iterator<Authorizable> result = userMgr.findAuthorizables(new Query() {
            public <T> void build(QueryBuilder<T> builder) {
                builder.setCondition(builder.
                        exists("@poisonous"));
            }
        });
View Full Code Here


        assertSameElements(result, expected);
    }

    @Test
    public void testPropertyLike() throws RepositoryException {
        Iterator<Authorizable> result = userMgr.findAuthorizables(new Query() {
            public <T> void build(QueryBuilder<T> builder) {
                builder.setCondition(builder.
                        like("profile/@food", "m%"));
            }
        });
View Full Code Here

        assertSameElements(result, expected);
    }

    @Test
    public void testContains1() throws RepositoryException {
        Iterator<Authorizable> result = userMgr.findAuthorizables(new Query() {
            public <T> void build(QueryBuilder<T> builder) {
                builder.setCondition(builder.
                        contains(".", "gold"));
            }
        });
View Full Code Here

        assertSameElements(result, expected);
    }

    @Test
    public void testContains2() throws RepositoryException {
        Iterator<Authorizable> result = userMgr.findAuthorizables(new Query() {
            public <T> void build(QueryBuilder<T> builder) {
                builder.setCondition(builder.
                        contains("@color", "gold"));
            }
        });
View Full Code Here

        assertSameElements(result, expected);
    }

    @Test
    public void testContains3() throws RepositoryException {
        Iterator<Authorizable> result = userMgr.findAuthorizables(new Query() {
            public <T> void build(QueryBuilder<T> builder) {
                builder.setCondition(builder.contains("profile/.", "grass"));
            }
        });
View Full Code Here

        assertSameElements(result, expected);
    }

    @Test
    public void testContains4() throws RepositoryException {
        Iterator<Authorizable> result = userMgr.findAuthorizables(new Query() {
            public <T> void build(QueryBuilder<T> builder) {
                builder.setCondition(builder.
                        contains("profile/@food", "grass"));
            }
        });
View Full Code Here

        assertSameElements(result, expected);
    }

    @Test
    public void testCondition1() throws RepositoryException {
        Iterator<Authorizable> result = userMgr.findAuthorizables(new Query() {
            public <T> void build(QueryBuilder<T> builder) {
                builder.setCondition(builder.
                        and(builder.
                                eq("profile/@cute", vf.createValue(true)), builder.
                                not(builder.
View Full Code Here

        assertSameElements(result, expected);
    }

    @Test
    public void testCondition2() throws RepositoryException {
        Iterator<Authorizable> result = userMgr.findAuthorizables(new Query() {
            public <T> void build(QueryBuilder<T> builder) {
                builder.setCondition(builder.
                        or(builder.
                                eq("profile/@food", vf.createValue("mice")), builder.
                                eq("profile/@food", vf.createValue("nectar"))));
View Full Code Here

        assertSameElements(result, expected);
    }

    @Test
    public void testImpersonation() throws RepositoryException {
        Iterator<Authorizable> result = userMgr.findAuthorizables(new Query() {
            public <T> void build(QueryBuilder<T> builder) {
                builder.setCondition(builder.
                        impersonates("jackrabbit"));
            }
        });
View Full Code Here

    }

    @Test
    public void testAdminImpersonation() throws Exception {
        final String adminPrincipalName = userMgr.getAuthorizable(superuser.getUserID()).getPrincipal().getName();
        Iterator<Authorizable> result = userMgr.findAuthorizables(new Query() {
            public <T> void build(QueryBuilder<T> builder) {
                builder.setCondition(builder.impersonates(adminPrincipalName));
            }
        });
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.api.security.user.Query

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.