Package org.apache.jackrabbit.oak.plugins.document.memory

Examples of org.apache.jackrabbit.oak.plugins.document.memory.MemoryDocumentStore.find()


        NodeDocument.setRevision(op, r2, "c");
        NodeDocument.setPrevious(op, r0, r0);
        NodeDocument.setPrevious(op, r1high, r1low);
        store.createOrUpdate(NODES, op);

        NodeDocument doc = store.find(NODES, rootId);
        assertNotNull(doc);
        Set<Revision> revs = doc.getValueMap("prop").keySet();
        assertEquals(2, revs.size());
        assertTrue(revs.contains(r0));
        assertTrue(revs.contains(r2));
View Full Code Here


        NodeDocument.setRevision(op, r51, "c");
        NodeDocument.setPrevious(op, r42, r12);
        NodeDocument.setPrevious(op, r31, r01);
        store.createOrUpdate(NODES, op);

        NodeDocument doc = store.find(NODES, rootId);
        assertNotNull(doc);
        List<NodeDocument> prevDocs = Lists.newArrayList(
                doc.getPreviousDocs("p1", null));
        assertEquals(2, prevDocs.size());
        assertEquals(Utils.getPreviousIdFor(rootId, r31), prevDocs.get(0).getId());
View Full Code Here

        s.release();
        writer.join();
        assertEquals("expected exception", 1, exceptions.size());

        String id = Utils.getIdFromPath("/foo/node");
        NodeDocument doc = docStore.find(Collection.NODES, id);
        assertNotNull("document with id " + id + " does not exist", doc);
        assertTrue(!doc.getLastRev().isEmpty());
        id = Utils.getIdFromPath("/bar/node");
        doc = docStore.find(Collection.NODES, id);
        assertNotNull("document with id " + id + " does not exist", doc);
View Full Code Here

        String id = Utils.getIdFromPath("/foo/node");
        NodeDocument doc = docStore.find(Collection.NODES, id);
        assertNotNull("document with id " + id + " does not exist", doc);
        assertTrue(!doc.getLastRev().isEmpty());
        id = Utils.getIdFromPath("/bar/node");
        doc = docStore.find(Collection.NODES, id);
        assertNotNull("document with id " + id + " does not exist", doc);
        assertTrue(!doc.getLastRev().isEmpty());

        mk.dispose();
    }
View Full Code Here

                .setAsyncDelay(0).clock(clock).getNodeStore();
        DocumentNodeStore nodeStore3 = new DocumentMK.Builder()
                .setDocumentStore(docStore).setClusterId(3)
                .setAsyncDelay(0).clock(clock).getNodeStore();

        NodeDocument doc = docStore.find(NODES, Utils.getIdFromPath("/"));
        assertNotNull(doc);
        Revision created = doc.getLocalDeleted().firstKey();
        assertEquals(1, created.getClusterId());

        clock.waitUntil(System.currentTimeMillis() +
View Full Code Here

        clock.waitUntil(System.currentTimeMillis() +
                DocumentNodeStore.REMEMBER_REVISION_ORDER_MILLIS + 1000);
        nodeStore3.runBackgroundOperations();

        doc = docStore.find(NODES, Utils.getIdFromPath("/"));
        assertNotNull(doc);
        NodeState state = doc.getNodeAtRevision(nodeStore3,
                nodeStore3.getHeadRevision(), null);
        assertNotNull(state);
View Full Code Here

        ns1.merge(builder1, EmptyHook.INSTANCE, CommitInfo.EMPTY);

        ns1.runBackgroundOperations();

        // get current _modified timestamp on /node
        NodeDocument doc = docStore.find(NODES, Utils.getIdFromPath("/node"));
        Long mod1 = (Long) doc.get(MODIFIED_IN_SECS);
        assertNotNull(mod1);

        ns2.runBackgroundOperations();
View Full Code Here

        Long mod1 = (Long) doc.get(MODIFIED_IN_SECS);
        assertNotNull(mod1);

        ns2.runBackgroundOperations();

        doc = docStore.find(NODES, Utils.getIdFromPath("/node"));
        Long mod2 = (Long) doc.get(MODIFIED_IN_SECS);
        assertTrue("" + mod2 + " < " + mod1, mod2 >= mod1);

        ns1.dispose();
        ns2.dispose();
View Full Code Here

        builder = ns.getRoot().builder();
        builder.child("test").setProperty("prop", "value");
        ns.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);

        Revision rev = ns.getHeadRevision();
        NodeDocument doc = docStore.find(Collection.NODES, Utils.getIdFromPath("/test"));
        assertNotNull(doc);
        DocumentNodeState state = doc.getNodeAtRevision(ns, rev, null);
        assertNotNull(state);
        assertTrue(state.hasProperty("prop"));
        assertEquals("value", state.getProperty("prop").getValue(Type.STRING));
View Full Code Here

            ns.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
        }
        ns.runBackgroundOperations();

        // must still return the same value as before the split
        doc = docStore.find(Collection.NODES, Utils.getIdFromPath("/test"));
        assertNotNull(doc);
        state = doc.getNodeAtRevision(ns, rev, null);
        assertNotNull(state);
        assertTrue(state.hasProperty("prop"));
        assertEquals("value", state.getProperty("prop").getValue(Type.STRING));
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.