Examples of Commit


Examples of org.apache.jackrabbit.mongomk.api.model.Commit

    public void removeNonExistentNode() throws Exception {
        List<Instruction> instructions = new LinkedList<Instruction>();
        instructions.add(new AddNodeInstructionImpl("/", "a"));
        instructions.add(new AddNodeInstructionImpl("/a", "b"));

        Commit commit = new CommitImpl("/", "+a : { b : {}  }", "Add nodes", instructions);
        CommitCommandMongo command = new CommitCommandMongo(mongoConnection, commit);
        command.execute();

        instructions = new LinkedList<Instruction>();
        instructions.add(new RemoveNodeInstructionImpl("/a", "c"));
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.api.model.Commit

        List<Instruction> instructions = new LinkedList<Instruction>();
        instructions.add(new AddNodeInstructionImpl("/", "a"));
        instructions.add(new AddNodeInstructionImpl("/", "b"));
        instructions.add(new AddNodeInstructionImpl("/", "c"));

        Commit commit = new CommitImpl("/", "+a : { b : {} , c : {} }",
                "This is a simple commit", instructions);
        CommitCommandMongo command = new CommitCommandMongo(mongoConnection, commit);
        String revisionId = command.execute();

        Assert.assertNotNull(revisionId);
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.api.model.Commit

        instructions.add(new AddNodeInstructionImpl("/", "a"));
        instructions.add(new AddPropertyInstructionImpl("/a", "key1", "value1"));
        instructions.add(new AddPropertyInstructionImpl("/a", "key2", "value2"));
        instructions.add(new AddPropertyInstructionImpl("/a", "key3", "value3"));

        Commit commit = new CommitImpl("/",
                "+a : { \"key1\" : \"value1\" , \"key2\" : \"value2\" , \"key3\" : \"value3\" }",
                "This is a simple commit", instructions);
        CommitCommandMongo command = new CommitCommandMongo(mongoConnection, commit);
        String revisionId = command.execute();
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.api.model.Commit

        instructions.add(new AddNodeInstructionImpl("/", "a"));
        instructions.add(new AddPropertyInstructionImpl("/a", "existed_key1", "value1"));
        instructions.add(new AddPropertyInstructionImpl("/a", "existed_key2", "value2"));
        instructions.add(new AddPropertyInstructionImpl("/a", "existed_key3", "value3"));

        Commit commit = new CommitImpl("/",
                "+a : { \"existed_key1\" : \"value1\" , \"existed_key2\" : \"value2\" , \"existed_key3\" : \"value3\" }",
                "This is a simple commit", instructions);
        CommitCommandMongo command = new CommitCommandMongo(mongoConnection, commit);
        String revisionId = command.execute();
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.api.model.Commit

        List<Instruction> instructions = new LinkedList<Instruction>();
        instructions.add(new AddNodeInstructionImpl("/", "a"));
        instructions.add(new AddNodeInstructionImpl("/", "b"));
        instructions.add(new AddNodeInstructionImpl("/", "c"));

        Commit commit = new CommitImpl("/", "+a : { b : {} , c : {} }",
                "This is a simple commit", instructions);
        CommitCommandMongo command = new CommitCommandMongo(mongoConnection, commit);
        String firstRevisionId = command.execute();

        instructions = new LinkedList<Instruction>();
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.api.model.Commit

    @Ignore /// FIXME
    public void rootNodeHasEmptyRootPath() throws Exception {
        List<Instruction> instructions = new LinkedList<Instruction>();
        instructions.add(new AddNodeInstructionImpl("", "/"));

        Commit commit = new CommitImpl("", "+/ : {}", "This is the root commit", instructions);
        CommitCommandMongo command = new CommitCommandMongo(mongoConnection, commit);
        String revisionId = command.execute();

        Assert.assertNotNull(revisionId);
        MongoAssert.assertNodesExist("",
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.api.model.Commit

        List<Instruction> instructions = new LinkedList<Instruction>();
        for (int i = 0; i < numberOfCommits; i++) {
            instructions.clear();
            instructions.add(new AddNodeInstructionImpl(path, baseNodeName + i));
            Commit commit = new CommitImpl(path, "+" + baseNodeName + i + " : {}",
                    "Add node n" + i, instructions);
            CommitCommandMongo command = new CommitCommandMongo(
                    mongoConnection, commit);
            command.execute();
            if (!PathUtils.denotesRoot(path)) {
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.api.model.Commit

        StringBuilder sb = new StringBuilder();
        sb.append("+\"a\" : { \"int\" : 1 } \n");
        sb.append("+\"a/b\" : { \"string\" : \"foo\" } \n");
        sb.append("+\"a/c\" : { \"bool\" : true }");

        Commit commit = this.buildAndAssertCommit(sb.toString());

        List<Instruction> instructions = commit.getInstructions();
        Assert.assertEquals(6, instructions.size());
        InstructionAssert.assertAddNodeInstruction((AddNodeInstruction) instructions.get(0), "/a");
        InstructionAssert.assertAddPropertyInstruction((AddPropertyInstruction) instructions.get(1), "/a", "int", 1);
        InstructionAssert.assertAddNodeInstruction((AddNodeInstruction) instructions.get(2), "/a/b");
        InstructionAssert.assertAddPropertyInstruction((AddPropertyInstruction) instructions.get(3), "/a/b", "string",
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.api.model.Commit

    public void testSimpleCopy() throws Exception {
        StringBuilder sb = new StringBuilder();
        sb.append("*\"a\" : \"b\"\n");
        sb.append("*\"a/b\" : \"a/c\"\n");

        Commit commit = this.buildAndAssertCommit(sb.toString());
        List<Instruction> instructions = commit.getInstructions();
        assertEquals(2, instructions.size());
        InstructionAssert.assertCopyNodeInstruction((CopyNodeInstruction) instructions.get(0), "/", "/a", "/b");
        InstructionAssert.assertCopyNodeInstruction((CopyNodeInstruction) instructions.get(1), "/", "/a/b", "/a/c");
    }
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.api.model.Commit

    public void testSimpleMove() throws Exception {
        StringBuilder sb = new StringBuilder();
        sb.append(">\"a\" : \"b\"\n");
        sb.append(">\"a/b\" : \"a/c\"\n");

        Commit commit = this.buildAndAssertCommit(sb.toString());
        List<Instruction> instructions = commit.getInstructions();
        assertEquals(2, instructions.size());
        InstructionAssert.assertMoveNodeInstruction((MoveNodeInstruction) instructions.get(0), "/", "/a", "/b");
        InstructionAssert.assertMoveNodeInstruction((MoveNodeInstruction) instructions.get(1), "/", "/a/b", "/a/c");
    }
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.