Package org.apache.jackrabbit.mk.core

Examples of org.apache.jackrabbit.mk.core.MicroKernelImpl.commit()


       
        MicroKernel mk = new MicroKernelImpl(new Repository(gc, new MemoryBlobStore()));
        revs[0] = mk.commit("/", "+\"a\" : { \"c\":{}, \"d\":{} }", mk.getHeadRevision(), null);
        revs[1] = mk.commit("/", "+\"b\" : {}", mk.getHeadRevision(), null);
        revs[2] = mk.commit("/b", "+\"e\" : {}", mk.getHeadRevision(), null);
        revs[3] = mk.commit("/a/c", "+\"f\" : {}", mk.getHeadRevision(), null);

        // garbage collect
        gc.gc();

        revs[4] = mk.commit("/b/e", "+\"g\" : {}", mk.getHeadRevision(), null);
View Full Code Here


        revs[3] = mk.commit("/a/c", "+\"f\" : {}", mk.getHeadRevision(), null);

        // garbage collect
        gc.gc();

        revs[4] = mk.commit("/b/e", "+\"g\" : {}", mk.getHeadRevision(), null);
       
        // Assert head revision is contained after GC
        assertEquals(mk.getHeadRevision(), revs[revs.length - 1]);
       
        // Assert unused revisions were GCed
View Full Code Here

    @Before
    public void setUp() throws Exception {
        MicroKernel microKernel = new MicroKernelImpl();
        String jsop = "^\"a\":1 ^\"b\":2 ^\"c\":3 +\"x\":{} +\"y\":{} +\"z\":{} " +
                "+\"oak:index\":{\"solrIdx\":{\"coreName\":\"cn\", \"solrHome\":\"sh\", \"solrConfig\":\"sc\"}} ";
        microKernel.commit("/", jsop, microKernel.getHeadRevision(), "test data");
        store = new KernelNodeStore(microKernel);
    }

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

    @Test
    @Ignore("OAK-532"// FIXME OAK-532
    public void journalConsistency() throws Exception {
        while (true) {
            final MicroKernel mk1 = new MicroKernelImpl();
            final String rev = mk1.commit("", "+\"/a\":{}", null, null);

            Thread t1 = new Thread("t1") {
                @Override
                public void run() {
                    try {
View Full Code Here

            Thread t1 = new Thread("t1") {
                @Override
                public void run() {
                    try {
                        String r2 = mk1.commit("", "-\"/a\"+\"/c\":{}", rev, null);
                    }
                    catch (MicroKernelException ignore) { }
                }
            };
            Thread t2 = new Thread("t2") {
View Full Code Here

            };
            Thread t2 = new Thread("t2") {
                @Override
                public void run() {
                    try {
                        String r2 = mk1.commit("", "-\"/a\"+\"/b\":{}", rev, null);
                    }
                    catch (MicroKernelException ignore) { }
                }
            };
View Full Code Here

    @Before
    public void setUp() throws Exception {
        MicroKernel microKernel = new MicroKernelImpl();
        String jsop = "^\"a\":1 ^\"b\":2 ^\"c\":3 +\"x\":{} +\"y\":{} +\"z\":{} " +
                "+\"oak:index\":{\"solrIdx\":{\"coreName\":\"cn\", \"solrHomePath\":\"sh\", \"solrConfigPath\":\"sc\"}} ";
        microKernel.commit("/", jsop, microKernel.getHeadRevision(), "test data");
        store = new KernelNodeStore(microKernel);
    }

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

    @Before
    public void setUp() throws Exception {
        MicroKernel microKernel = new MicroKernelImpl();
        String jsop = "^\"a\":1 ^\"b\":2 ^\"c\":3 +\"x\":{} +\"y\":{} +\"z\":{} " +
                "+\"oak:index\":{\"solrIdx\":{\"coreName\":\"cn\", \"solrHomePath\":\"sh\", \"solrConfigPath\":\"sc\"}} ";
        microKernel.commit("/", jsop, microKernel.getHeadRevision(), "test data");
        store = new KernelNodeStore(microKernel);
    }

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

    @Test
    @Ignore("OAK-532"// FIXME OAK-532
    public void journalConsistency() throws Exception {
        while (true) {
            final MicroKernel mk1 = new MicroKernelImpl();
            final String rev = mk1.commit("", "+\"/a\":{}", null, null);

            Thread t1 = new Thread("t1") {
                @Override
                public void run() {
                    try {
View Full Code Here

            Thread t1 = new Thread("t1") {
                @Override
                public void run() {
                    try {
                        String r2 = mk1.commit("", "-\"/a\"+\"/c\":{}", rev, null);
                    }
                    catch (MicroKernelException ignore) { }
                }
            };
            Thread t2 = new Thread("t2") {
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.