mreutegg commented on a change in pull request #258:
URL: https://github.com/apache/jackrabbit-oak/pull/258#discussion_r525057869
##########
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:
Actually, the test _should_ dispose the `DocumentNodeStore` when it is
not needed anymore. Some tests use a `DocumentMKBuilderProvider` rule that
takes care of disposing the node store automatically after the test, but this
test creates the node store manually.
----------------------------------------------------------------
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]