Package org.apache.jackrabbit.mk.api

Examples of org.apache.jackrabbit.mk.api.MicroKernel.commit()


        String revision = null;
        for (Entry<String, JsopWriter> e : builders.entrySet()) {
            String mount = e.getKey();
            MicroKernel m = mounts.get(mount);
            String jsop = e.getValue().toString();
            revision = m.commit("/", jsop, revisionId, message);
            revisions.put(mount, revision);
        }
        builders.clear();
        return getHeadRevision();
    }
View Full Code Here


    public void setUp() {
        MicroKernel kernel = new MicroKernelImpl();
        String jsop =
                "+\"test\":{\"a\":1,\"b\":2,\"c\":3,"
                + "\"x\":{},\"y\":{},\"z\":{}}";
        kernel .commit("/", jsop, null, "test data");
        store = new KernelNodeStore(kernel);
        root = store.getRoot();
    }

    @Test
View Full Code Here

        counter = 0;

        MicroKernel mk1 = new MicroKernelImpl("./target/mk1/" + random.nextInt());
        store1 = new KernelNodeStore(mk1);
        vf = store1.getValueFactory();
        mk1.commit("", "+\"/root\":{}", mk1.getHeadRevision(), "");
        root1 = new RootImpl(store1, null, new TestAcContext());

        MicroKernel mk2 = new MicroKernelImpl("./target/mk2/" + random.nextInt());
        store2 = new KernelNodeStore(mk2);
        mk2.commit("", "+\"/root\":{}", mk2.getHeadRevision(), "");
View Full Code Here

        mk1.commit("", "+\"/root\":{}", mk1.getHeadRevision(), "");
        root1 = new RootImpl(store1, null, new TestAcContext());

        MicroKernel mk2 = new MicroKernelImpl("./target/mk2/" + random.nextInt());
        store2 = new KernelNodeStore(mk2);
        mk2.commit("", "+\"/root\":{}", mk2.getHeadRevision(), "");
        root2 = new RootImpl(store2, null, new TestAcContext());
    }

    @Test
    public void fuzzTest() throws Exception {
View Full Code Here

        return node;
    }

    private void commit(String jsop) {
        MicroKernel kernel = store.getKernel();
        branchRevision = kernel.commit("/", jsop, branchRevision, null);
        currentRoot = new KernelNodeState(kernel, "/", branchRevision);
        committed = currentRoot;
    }

}
View Full Code Here

        String revision = null;
        for (Entry<String, JsopWriter> e : builders.entrySet()) {
            String mount = e.getKey();
            MicroKernel m = mounts.get(mount);
            String jsop = e.getValue().toString();
            revision = m.commit("/", jsop, revisionId, message);
            revisions.put(mount, revision);
        }
        builders.clear();
        return getHeadRevision();
    }
View Full Code Here

        String oldHead = head;

        Assert.assertEquals(null, index.getPath("1", head));

        head = mk.commit("/", "+\"test\" : {\"id\":\"1\"}", head, null);
        head = mk.commit("/", "+\"test2\" : {\"id\":\"2\"}", head, null);

        Assert.assertEquals("/test", index.getPath("1", head));
        Assert.assertEquals("/test2", index.getPath("2", head));
View Full Code Here

        String oldHead = head;

        Assert.assertEquals(null, index.getPath("1", head));

        head = mk.commit("/", "+\"test\" : {\"id\":\"1\"}", head, null);
        head = mk.commit("/", "+\"test2\" : {\"id\":\"2\"}", head, null);

        Assert.assertEquals("/test", index.getPath("1", head));
        Assert.assertEquals("/test2", index.getPath("2", head));

        Assert.assertEquals("/test", index.getPath("1", oldHead));
View Full Code Here

        Assert.assertEquals("/test2", index.getPath("2", oldHead));

        Assert.assertEquals("/test", index.getPath("1", head));
        Assert.assertEquals("/test2", index.getPath("2", head));

        head = mk.commit("/", "-\"test2\"", head, null);
        head = mk.commit("/test", "+\"test\" : {\"id\":\"3\"}", head, null);

        Assert.assertEquals("/test/test", index.getPath("3", head));

        // Recreate the indexer
View Full Code Here

        Assert.assertEquals("/test", index.getPath("1", head));
        Assert.assertEquals("/test2", index.getPath("2", head));

        head = mk.commit("/", "-\"test2\"", head, null);
        head = mk.commit("/test", "+\"test\" : {\"id\":\"3\"}", head, null);

        Assert.assertEquals("/test/test", index.getPath("3", head));

        // Recreate the indexer
        indexer = Indexer.getInstance(mk);
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.