You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by "fugerit79 (via GitHub)" <gi...@apache.org> on 2025/09/23 07:06:41 UTC

[PR] issue FOP-3275 - JAVA 25 - fix test case FontFileFinderTestCase.testValidEventListener() - new File("").exists() return true [xmlgraphics-fop]

fugerit79 opened a new pull request, #90:
URL: https://github.com/apache/xmlgraphics-fop/pull/90

   There a small issue on one TestCase on Java 25 : 
   
   `FontFileFinderTestCase.testValidEventListener()
   
   The output is : 
   
   ```
   Wanted but not invoked:
   fontEventListener.fontDirectoryNotFound(
       <any>,
       <any>
   );
   -> at org.apache.fop.fonts.autodetect.FontFileFinderTestCase.testValidEventListener(FontFileFinderTestCase.java:86)
   Actually, there were zero interactions with this mock.Wanted but not invoked:
   fontEventListener.fontDirectoryNotFound(
       <any>,
       <any>
   );
   -> at org.apache.fop.fonts.autodetect.FontFileFinderTestCase.testValidEventListener(FontFileFinderTestCase.java:86)
   Actually, there were zero interactions with this mock. 
   ```
   
   It seems to depend on the fact that new File("").exists() return `true` on java 25, while it was `false` on previous versions.
   
   Here is a simple reproducer : 
   
   ```
   import java.io.File;
   import java.io.IOException;
   
   public class TestFile {
   
       public static void main( String[] args ) throws IOException {
           File file = new File("");
           System.out.println( String.format( "java version: %s, file exists? : %s, path name : %s",
                   System.getProperty("java.version") , file.exists(), file.getCanonicalPath() ) );
       }
   
   } 
   ```
   
   Output on java 21 : 
   
   java version: 21.0.2, file exists? : **false**, path name : /home/user/test-project
   
   And on java 25 : 
   
   java version: 25, file exists? : **true**, path name : /home/user/test-project
   
   The resolved path canonical name "/home/user/test-project" actually exists, so mayb java 21 is right here.
   
   It seems to me in this case is just better to use a test case input that is working with both version, for instance : 
   
   `finder.find(new File("not-exists"));`
   
   What do you think?
   


-- 
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: commits-unsubscribe@xmlgraphics.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Re: [PR] issue FOP-3275 - JAVA 25 - fix test case FontFileFinderTestCase.testValidEventListener() - new File("").exists() return true [xmlgraphics-fop]

Posted by "tbee (via GitHub)" <gi...@apache.org>.
tbee commented on PR #90:
URL: https://github.com/apache/xmlgraphics-fop/pull/90#issuecomment-4090683697

   Changing a test is not fixing the issue?


-- 
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: commits-unsubscribe@xmlgraphics.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Re: [PR] issue FOP-3275 - JAVA 25 - fix test case FontFileFinderTestCase.testValidEventListener() - new File("").exists() return true [xmlgraphics-fop]

Posted by "fugerit79 (via GitHub)" <gi...@apache.org>.
fugerit79 closed pull request #90: issue FOP-3275 - JAVA 25 - fix test case FontFileFinderTestCase.testValidEventListener() - new File("").exists() return true
URL: https://github.com/apache/xmlgraphics-fop/pull/90


-- 
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: commits-unsubscribe@xmlgraphics.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Re: [PR] issue FOP-3275 - JAVA 25 - fix test case FontFileFinderTestCase.testValidEventListener() - new File("").exists() return true [xmlgraphics-fop]

Posted by "fugerit79 (via GitHub)" <gi...@apache.org>.
fugerit79 commented on PR #90:
URL: https://github.com/apache/xmlgraphics-fop/pull/90#issuecomment-3322994201

   No more needed as of commit <https://github.com/apache/xmlgraphics-fop/commit/f38d7bab4989128a2600b6f82889bc6721e89733> (I checkt it is working)


-- 
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: commits-unsubscribe@xmlgraphics.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org