mreutegg commented on code in PR #550:
URL: https://github.com/apache/jackrabbit-oak/pull/550#discussion_r857606356


##########
oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/LuceneJournalPropertyBuilderTest.java:
##########
@@ -53,7 +53,25 @@ public void nullOrEmptyJson() throws Exception{
 
         assertTrue(Iterables.isEmpty(((IndexedPaths)builder2.build())));
     }
+    @Test
+    public void addJsonLessThanMaxBuilderSize() throws Exception {
+        String a = null;
+        for (int i = 0; i < 499; i++) {
+            a = "{\"/var/eventing/jobs/foo/2022/4/19/14/27/af96fcfa9e32_8589" 
+ i + "\" :[\"/oak:index/foo\",\"/oak:index/bar\"]}";
+            builder.addSerializedProperty(a);
+        }
+        
assertEquals(createdIndexPathMap((IndexedPaths)builder.build()).size(), 998);

Review Comment:
   Please swap the two arguments for assertEquals(). The first argument is the 
expected value, which is 998 in this test.



##########
oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/LuceneJournalPropertyBuilderTest.java:
##########
@@ -53,7 +53,25 @@ public void nullOrEmptyJson() throws Exception{
 
         assertTrue(Iterables.isEmpty(((IndexedPaths)builder2.build())));
     }
+    @Test
+    public void addJsonLessThanMaxBuilderSize() throws Exception {
+        String a = null;
+        for (int i = 0; i < 499; i++) {
+            a = "{\"/var/eventing/jobs/foo/2022/4/19/14/27/af96fcfa9e32_8589" 
+ i + "\" :[\"/oak:index/foo\",\"/oak:index/bar\"]}";
+            builder.addSerializedProperty(a);
+        }
+        
assertEquals(createdIndexPathMap((IndexedPaths)builder.build()).size(), 998);
+    }
 
+    @Test
+    public void addJsonBiggerThanMaxBuilderSize() throws Exception {
+        String a = null;
+        for (int i = 0; i < 502; i++) {
+            a = "{\"/var/eventing/jobs/foo/2022/4/19/14/27/af96fcfa9e32_8589" 
+ i + "\" :[\"/oak:index/foo\",\"/oak:index/bar\"]}";
+            builder.addSerializedProperty(a);
+        }
+        
assertEquals(createdIndexPathMap((IndexedPaths)builder.build()).size(), 1000);

Review Comment:
   Same as above. Please swap the two arguments to assertEquals().



-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to