Package org.apache.jackrabbit.mongomk.impl

Examples of org.apache.jackrabbit.mongomk.impl.SimpleNodeScenario


*/
public class MongoMKGetHeadRevisionTest extends BaseMongoMKTest {

    @Test
    public void simple() throws Exception {
        SimpleNodeScenario scenario = new SimpleNodeScenario(mk);
        String rev1 = scenario.create();

        String rev2 = mk.getHeadRevision();
        assertEquals(rev1, rev2);

        String rev3 = scenario.deleteA();
        assertFalse(rev3.equals(rev2));
    }
View Full Code Here


        }
    }

    @Test
    public void afterDelete() throws Exception {
        SimpleNodeScenario scenario = new SimpleNodeScenario(mk);
        scenario.create();

        JSONObject root = parseJSONObject(mk.getNodes("/", null, 0, 0, -1, null));
        assertPropertyValue(root, ":childNodeCount", 1L);

        JSONObject a = parseJSONObject(mk.getNodes("/a", null, 0, 0, -1, null));
        assertPropertyValue(a, ":childNodeCount", 2L);

        scenario.deleteA();
        root = parseJSONObject(mk.getNodes("/", null, 0, 0, -1, null));
        assertPropertyValue(root, ":childNodeCount", 0L);
    }
View Full Code Here

    }

    @Test
    @Ignore   
    public void depthNegative() throws Exception {
        SimpleNodeScenario scenario = new SimpleNodeScenario(mk);
        scenario.create();

        JSONObject root = parseJSONObject(mk.getNodes("/", null, -1, 0, -1, null));
        assertPropertyValue(root, ":childNodeCount", 1L);
    }
View Full Code Here

        assertPropertyValue(root, ":childNodeCount", 1L);
    }

    @Test
    public void depthZero() throws Exception {
        SimpleNodeScenario scenario = new SimpleNodeScenario(mk);
        scenario.create();

        JSONObject root = parseJSONObject(mk.getNodes("/", null, 0, 0, -1, null));
        assertPropertyValue(root, ":childNodeCount", 1L);

        JSONObject a = resolveObjectValue(root, "a");
View Full Code Here

    }

    @Test
    @Ignore   
    public void depthOne() throws Exception {
        SimpleNodeScenario scenario = new SimpleNodeScenario(mk);
        scenario.create();

        JSONObject root = parseJSONObject(mk.getNodes("/", null, 1, 0, -1, null));
        assertPropertyValue(root, ":childNodeCount", 1L);

        JSONObject a = resolveObjectValue(root, "a");
View Full Code Here

    }

    @Test
    @Ignore   
    public void depthLimitless() throws Exception {
        SimpleNodeScenario scenario = new SimpleNodeScenario(mk);
        scenario.create();

        JSONObject root = parseJSONObject(mk.getNodes("/", null, -1, 0, -1, null));
        assertPropertyValue(root, ":childNodeCount", 1L);

        JSONObject a = resolveObjectValue(root, "a");
View Full Code Here

*/
public class MongoMKNodeExistsTest extends BaseMongoMKTest {

    @Test
    public void simple() throws Exception {
        SimpleNodeScenario scenario = new SimpleNodeScenario(mk);
        String revisionId = scenario.create();

        boolean exists = mk.nodeExists("/a", revisionId);
        assertTrue(exists);

        exists = mk.nodeExists("/a/b", revisionId);
        assertTrue(exists);

        revisionId = scenario.deleteA();

        exists = mk.nodeExists("/a", revisionId);
        assertFalse(exists);

        exists = mk.nodeExists("/a/b", revisionId);
View Full Code Here

        assertFalse(exists);
    }

    @Test
    public void withoutRevisionId() throws Exception {
        SimpleNodeScenario scenario = new SimpleNodeScenario(mk);
        scenario.create();

        boolean exists = mk.nodeExists("/a", null);
        assertTrue(exists);

        scenario.deleteA();

        exists = mk.nodeExists("/a", null);
        assertFalse(exists);
    }
View Full Code Here

        assertFalse(exists);
    }

    @Test
    public void withInvalidRevisionId() throws Exception {
        SimpleNodeScenario scenario = new SimpleNodeScenario(mk);
        scenario.create();

        try {
            mk.nodeExists("/a", "123456789");
            fail("Expected: Invalid revision id exception");
        } catch (Exception expected) {
View Full Code Here

        }
    }

    @Test
    public void parentDelete() throws Exception {
        SimpleNodeScenario scenario = new SimpleNodeScenario(mk);
        scenario.create();

        boolean exists = mk.nodeExists("/a/b", null);
        assertTrue(exists);

        scenario.deleteA();
        exists = mk.nodeExists("/a/b", null);
        assertFalse(exists);
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.mongomk.impl.SimpleNodeScenario

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.