Package org.apache.jackrabbit.oak.api

Examples of org.apache.jackrabbit.oak.api.Root.refresh()


    @Test
    public void testCreateJcrUuid() throws Exception {
        setupPermission("/a", testPrincipal, true, PrivilegeConstants.JCR_READ, PrivilegeConstants.JCR_ADD_CHILD_NODES);

        Root testRoot = getTestRoot();
        testRoot.refresh();

        NodeUtil a = new NodeUtil(testRoot.getTree("/a"));
        NodeUtil test = a.addChild("referenceable2", NT_NAME);
        test.setString(JcrConstants.JCR_UUID, IdentifierManager.generateUUID());
        testRoot.commit();
View Full Code Here


    public void testCreateInvalidJcrUuid() throws Exception {
        setupPermission("/a", testPrincipal, true, PrivilegeConstants.JCR_READ, PrivilegeConstants.JCR_ADD_CHILD_NODES);

        try {
            Root testRoot = getTestRoot();
            testRoot.refresh();

            NodeUtil a = new NodeUtil(testRoot.getTree("/a"));
            NodeUtil test = a.addChild("referenceable2", NT_NAME);
            test.setString(JcrConstants.JCR_UUID, "not a uuid");
            testRoot.commit();
View Full Code Here

    public void testCreateBooleanJcrUuid() throws Exception {
        setupPermission("/a", testPrincipal, true, PrivilegeConstants.JCR_READ, PrivilegeConstants.JCR_ADD_CHILD_NODES);

        try {
            Root testRoot = getTestRoot();
            testRoot.refresh();

            NodeUtil a = new NodeUtil(testRoot.getTree("/a"));
            NodeUtil test = a.addChild("referenceable2", NT_NAME);
            test.setBoolean(JcrConstants.JCR_UUID, false);
            testRoot.commit();
View Full Code Here

    }

    @Test
    public void testUserManagementPermissionWithJr2Flag() throws Exception {
        Root testRoot = getTestRoot();
        testRoot.refresh();

        UserManager testUserMgr = getUserConfiguration().getUserManager(testRoot, NamePathMapper.DEFAULT);
        try {
            User u = testUserMgr.createUser("a", "b");
            testRoot.commit();
View Full Code Here

    }

    @Test
    public void testUserManagementPermissionWithJr2Flag() throws Exception {
        Root testRoot = getTestRoot();
        testRoot.refresh();

        UserManager testUserMgr = getUserConfiguration().getUserManager(testRoot, NamePathMapper.DEFAULT);
        try {
            User u = testUserMgr.createUser("a", "b");
            testRoot.commit();
View Full Code Here

    public void testTestSessionGetApplicablePolicies() throws Exception {
        setupPolicy(testPath);
        root.commit();

        Root testRoot = getTestRoot();
        testRoot.refresh();
        JackrabbitAccessControlManager testAcMgr = getTestAccessControlManager();
        PrincipalManager testPrincipalMgr = getSecurityProvider().getPrincipalConfiguration().getPrincipalManager(testRoot, getNamePathMapper());

        List<Principal> principals = ImmutableList.of(testPrincipal, EveryonePrincipal.getInstance());
        for (Principal principal : principals) {
View Full Code Here

    public void testTestSessionGetPolicies() throws Exception {
        setupPolicy(testPath);
        root.commit();

        Root testRoot = getTestRoot();
        testRoot.refresh();
        JackrabbitAccessControlManager testAcMgr = getTestAccessControlManager();
        PrincipalManager testPrincipalMgr = getSecurityProvider().getPrincipalConfiguration().getPrincipalManager(testRoot, getNamePathMapper());

        List<Principal> principals = ImmutableList.of(testPrincipal, EveryonePrincipal.getInstance());
        for (Principal principal : principals) {
View Full Code Here

    @Test
    public void testCreateJcrUuid() throws Exception {
        setupPermission("/a", testPrincipal, true, PrivilegeConstants.JCR_READ, PrivilegeConstants.JCR_ADD_CHILD_NODES);

        Root testRoot = getTestRoot();
        testRoot.refresh();

        NodeUtil a = new NodeUtil(testRoot.getTree("/a"));
        NodeUtil test = a.addChild("referenceable2", NT_NAME);
        test.setString(JcrConstants.JCR_UUID, IdentifierManager.generateUUID());
        testRoot.commit();
View Full Code Here

    public void testCreateInvalidJcrUuid() throws Exception {
        setupPermission("/a", testPrincipal, true, PrivilegeConstants.JCR_READ, PrivilegeConstants.JCR_ADD_CHILD_NODES);

        try {
            Root testRoot = getTestRoot();
            testRoot.refresh();

            NodeUtil a = new NodeUtil(testRoot.getTree("/a"));
            NodeUtil test = a.addChild("referenceable2", NT_NAME);
            test.setString(JcrConstants.JCR_UUID, "not a uuid");
            testRoot.commit();
View Full Code Here

    public void testCreateBooleanJcrUuid() throws Exception {
        setupPermission("/a", testPrincipal, true, PrivilegeConstants.JCR_READ, PrivilegeConstants.JCR_ADD_CHILD_NODES);

        try {
            Root testRoot = getTestRoot();
            testRoot.refresh();

            NodeUtil a = new NodeUtil(testRoot.getTree("/a"));
            NodeUtil test = a.addChild("referenceable2", NT_NAME);
            test.setBoolean(JcrConstants.JCR_UUID, false);
            testRoot.commit();
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.