Package org.apache.jackrabbit.mongomk.impl.model

Examples of org.apache.jackrabbit.mongomk.impl.model.MongoCommit


    @Override
    public String branch(String trunkRevisionId) throws MicroKernelException {
        String revId = trunkRevisionId == null ? getHeadRevision() : trunkRevisionId;

        try {
            MongoCommit commit = (MongoCommit)CommitBuilder.build("", "", revId,
                    MongoNodeStore.INITIAL_COMMIT_MESSAGE);
            commit.setBranchId(revId + "-" + UUID.randomUUID().toString());
            return nodeStore.commit(commit);
        } catch (Exception e) {
            throw new MicroKernelException(e);
        }
    }
View Full Code Here


    public static void assertCommitContainsAffectedPaths(String revisionId,
            String... expectedPaths) throws Exception {
        DBCollection commitCollection = nodeStore.getCommitCollection();
        DBObject query = QueryBuilder.start(MongoCommit.KEY_REVISION_ID)
                .is(MongoUtil.toMongoRepresentation(revisionId)).get();
        MongoCommit result = (MongoCommit) commitCollection.findOne(query);
        Assert.assertNotNull(result);

        Set<String> actualPaths = result.getAffectedPaths();
        Assert.assertEquals(new HashSet<String>(Arrays.asList(expectedPaths)), new HashSet<String>(actualPaths));
    }
View Full Code Here

        DBCollection commitCollection = nodeStore.getCommitCollection();
        DBObject query = QueryBuilder.start(MongoCommit.KEY_REVISION_ID)
                .is(commit.getRevisionId()).and(MongoCommit.KEY_MESSAGE)
                .is(commit.getMessage()).and(MongoCommit.KEY_PATH)
                .is(commit.getPath()).and(MongoCommit.KEY_FAILED).notEquals(Boolean.TRUE).get();
        MongoCommit result = (MongoCommit) commitCollection.findOne(query);
        Assert.assertNotNull(result);
        Assert.assertEquals(commit.getDiff(), result.getDiff());
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.mongomk.impl.model.MongoCommit

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.