naturzukunft commented on PR #324:
URL: https://github.com/apache/commons-rdf/pull/324#issuecomment-2817263181

   The original `org.apache.commons.rdf.api.AbstractDatasetTest`:
   
   ```
       @Test
       public void testStreamDefaultGraphNameByPattern() throws Exception {
           // Explicitly select in only the default graph Optional.empty()
           final Optional<? extends Quad> aliceTopic = 
dataset.stream(Optional.empty(), null, null, null).findAny();
           assertTrue(aliceTopic.isPresent());
           // COMMONSRDF-55: should not be <urn:x-arq:defaultgraph> or similar
           assertNull(aliceTopic.get().getGraphName().orElse(null));
           assertFalse(aliceTopic.get().getGraphName().isPresent());
       }
   ```
   is running with jdk 17.
   
   if i change it to this, which I think tests the same thing only slightly 
better, then the test also fails with jdk 17:
   ```
       @Test
       public void testStreamDefaultGraphNameByPattern() throws Exception {
           dataset.stream(Optional.empty(), null, null, null).forEach(quad -> {
               // COMMONSRDF-55: should not be <urn:x-arq:defaultgraph> or 
similar
               assertNull(quad.getGraphName().orElse(null));
               assertFalse(quad.getGraphName().isPresent());
           });
       }
   ```
   
   So in my opinion the test is wrong. And the order of the stream changes with 
a newer jdk, so `findAny()`  delivers another quad.


-- 
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: issues-unsubscr...@commons.apache.org

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

Reply via email to