Vinod-holani commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r525077893
##########
File path:
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/MissingLastRevSeekerTest.java
##########
@@ -216,4 +220,26 @@ public void getClusterNodeInfo() {
private ClusterNodeInfoDocument getClusterNodeInfo(int clusterId) {
return seeker.getClusterNodeInfo(clusterId);
}
+
+ @Test
+ public void getNonSplitDocs() throws Exception {
+ String nodeName = this.getClass().getName() + "-foo";
+ DocumentNodeStore dns =
getBuilder().setDocumentStore(store).getNodeStore();
+ NodeBuilder b1 = dns.getRoot().builder();
+ b1.child(nodeName);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ //Modify and commit changes on this node 100 times to create a split
document
+ for (int i = 0; i < NUM_REVS_THRESHOLD; i++) {
+ b1 = dns.getRoot().builder();
+ b1.child(nodeName).setProperty("prop",i);
+ dns.merge(b1, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+ }
+ dns.runBackgroundOperations();
+ int docs = 0;
+ //seeker should return only non split documents
+ for(Document doc : seeker.getCandidates(0)) {
+ docs++;
+ }
+ assertEquals(2, docs);
+ }
Review comment:
Ok so we do need to dispose the DocumentNodeStore but not underlying
DocumentStore for this test case. I was confused with these two comments.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]