Examples of SimpleNodeScenario


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

        FetchValidCommitsQuery query = new FetchValidCommitsQuery(mongoConnection,
                String.valueOf(Integer.MAX_VALUE) /*maxRevisionId*/);
        List<CommitMongo> commits = query.execute();
        assertEquals(MIN_COMMITS, commits.size());

        SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
        scenario.create();
        commits = query.execute();
        assertEquals(SIMPLE_SCENARIO_COMMITS, commits.size());

        int numberOfChildren = 3;
        scenario.addChildrenToA(numberOfChildren);
        commits = query.execute();
        assertEquals(SIMPLE_SCENARIO_COMMITS + numberOfChildren, commits.size());
    }
View Full Code Here

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

                                        thirdRevisionId)));
    }

    @Test
    public void commitContainsAllAffectedNodes() throws Exception {
        SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
        String firstRevisionId = scenario.create();
        String secondRevisionId = scenario.update_A_and_add_D_and_E();

        MongoAssert.assertCommitContainsAffectedPaths(firstRevisionId, "/", "/a", "/a/b", "/a/c");
        MongoAssert.assertCommitContainsAffectedPaths(secondRevisionId, "/a", "/a/b", "/a/d", "/a/b/e");
    }
View Full Code Here

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

        FetchValidCommitsQuery query = new FetchValidCommitsQuery(mongoConnection,
                String.valueOf(Integer.MAX_VALUE) /*maxRevisionId*/);
        List<CommitMongo> commits = query.execute();
        CommitMongo commit0 = commits.get(0);

        SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
        scenario.create();
        commits = query.execute();
        CommitMongo commit1 = commits.get(0);
        assertTrue(commit0.getRevisionId() < commit1.getRevisionId());

        int numberOfChildren = 3;
        scenario.addChildrenToA(numberOfChildren);
        commits = query.execute();
        CommitMongo commit2 = commits.get(0);
        assertTrue(commit1.getRevisionId() < commit2.getRevisionId());
    }
View Full Code Here

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

        List<CommitMongo> commits = query.execute();
        CommitMongo commit0 = commits.get(0);

        Thread.sleep(1000);

        SimpleNodeScenario scenario = new SimpleNodeScenario(mongoConnection);
        scenario.create();
        commits = query.execute();
        CommitMongo commit1 = commits.get(0);
        assertTrue(commit0.getTimestamp() < commit1.getTimestamp());

        Thread.sleep(1000);

        int numberOfChildren = 3;
        scenario.addChildrenToA(numberOfChildren);
        commits = query.execute();
        CommitMongo commit2 = commits.get(0);
        assertTrue(commit1.getTimestamp() < commit2.getTimestamp());
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.document.impl.SimpleNodeScenario

        }
    }

    @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

Examples of org.apache.jackrabbit.oak.plugins.document.impl.SimpleNodeScenario

    }

    @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

Examples of org.apache.jackrabbit.oak.plugins.document.impl.SimpleNodeScenario

        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

Examples of org.apache.jackrabbit.oak.plugins.document.impl.SimpleNodeScenario

    }

    @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

Examples of org.apache.jackrabbit.oak.plugins.document.impl.SimpleNodeScenario

    }

    @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

Examples of org.apache.jackrabbit.oak.plugins.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
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.