[ 
https://issues.apache.org/jira/browse/RAT-496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18028259#comment-18028259
 ] 

Tilman Hausherr commented on RAT-496:
-------------------------------------

There's also another problem in ReportOptionTest.java:

org.junit.platform.commons.JUnitException: Failed to close extension context

 java.io.IOException: Failed to delete temp directory 
C:\Users\XXXXX\AppData\Local\Temp\junit-2715225895996044134. The following 
paths could not be deleted (see suppressed exceptions for details): <root>, 
.gitignore

...

Suppressed: java.nio.file.FileSystemException: 
C:\Users\XXXXX\AppData\Local\Temp\junit-2715225895996044134\.gitignore: Der 
Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess 
verwendet wird.

The problem is mentioned here: 
https://github.com/junit-team/junit-framework/issues/4567

There is no problem when running that test file individually. I had a 
superficial look at the code and didn't see a leak.

I disabled that class and now the whole build passes.

> FileNotFoundException in Resources.getExampleResource() if project path has a 
> space
> -----------------------------------------------------------------------------------
>
>                 Key: RAT-496
>                 URL: https://issues.apache.org/jira/browse/RAT-496
>             Project: Apache Rat
>          Issue Type: Bug
>          Components: core engine
>    Affects Versions: 0.17
>            Reporter: Tilman Hausherr
>            Assignee: Philipp Ottlinger
>            Priority: Minor
>             Fix For: 0.17
>
>
> I tried to build on my machine and got this:
> java.io.FileNotFoundException: Source 
> 'XXXXX\Eigene%20Dateien\XXXX\Java\creadur-rat\apache-rat-core\target\test-classes\examples\exampleData\Source.java'
>  does not exist
>       at org.apache.commons.io.FileUtils.checkFileExists(FileUtils.java:317)
>       at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:855)
>       at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:888)
>       at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:790)
>       at 
> org.apache.rat.document.FileDocumentTest.setUp(FileDocumentTest.java:50)
> This can be fixed by changing the code in {{Resources.java}} like this:
> {code:java}
>     public static File getExampleResource(String pResource) {
>         URL url = Resources.class.getResource("/examples/" + pResource);
>         Objects.requireNonNull(url, "/examples/" + pResource + " not found");
>         try
>         {
>             return Paths.get(url.toURI()).toFile();
>         }
>         catch (URISyntaxException ex)
>         {
>             throw new IllegalArgumentException(ex);
>         }
>     }
> {code}
> Using IllegalArgumentException because this is an unchecked exception. 
> Alternatively we could throw URISyntaxException but then we'd have to change 
> more files.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to