TamimEhsan commented on PR #859:
URL: https://github.com/apache/nutch/pull/859#issuecomment-3213775644

   is this test enough to check the backward compatibility? I tried to recreate 
the old behaviour by reassigning HashMap to metadata. Thus simulating a writing 
by old instance and reading from new. 
   
   ```java
     @Test
     public void testWritableCaseInsensitive() {
       SpellCheckedMetadata result = null;
       SpellCheckedMetadata meta = new SpellCheckedMetadata() {
         {
             this.metadata = new HashMap<>();
         }
       };
   
       result = writeRead(meta);
       Assert.assertEquals(0, result.size());
   
       meta.add("name-One", "value-1.1");
       result = writeRead(meta);
       Assert.assertEquals(1, result.size());
       Assert.assertEquals(1, result.getValues("naMe-one").length);
       Assert.assertEquals("value-1.1", result.get("nAme-oNe"));
   
       meta.add("Contenttype", "text/html");
       meta.add("name-Two", "value-2.1");
       meta.add("namE-two", "value-2.2");
       result = writeRead(meta);
       Assert.assertEquals(3, result.size());
       Assert.assertEquals(1, result.getValues("name-onE").length);
       Assert.assertEquals("value-1.1", result.getValues("namE-one")[0]);
       Assert.assertEquals(2, result.getValues("name-two").length);
       Assert.assertEquals("value-2.1", result.getValues("nAme-tWo")[0]);
       Assert.assertEquals("value-2.2", result.getValues("namE-Two")[1]);
       Assert.assertEquals("text/html", result.get(Metadata.CONTENT_TYPE));
     }
     ```


-- 
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...@nutch.apache.org

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

Reply via email to