You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in a project with several files an including some integration tests, I am trying to perform the following actions:
File csFile = new File("src/test/resources/Program.cs").getAbsoluteFile();
Let's say that my project is in C:\temp\myproject therefore i will expect to get something like:
C:\temp\myproject\src\test\resources\Program.cs
but instead i got:
Caused by: java.nio.file.NoSuchFileException: C:\Program Files\Microsoft VS Code\src\test\resources
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:90)
at sun.nio.fs.WindowsLinkSupport.getRealPath(WindowsLinkSupport.java:259)
at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:836)
at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:44)
at org.sonar.api.batch.fs.internal.DefaultInputModule.initBaseDir(DefaultInputModule.java:86)
... 27 more
Cristian Andres (@bootrider) one way to solve this might be a test configuration where you could configure your working folder. We plan to support this later. What do you think about this? BTW, right now you could use getClass().getClassLoader().getResource() to walkaround if it is ok to update the code.
Activity
ansyral commentedon Jan 22, 2018
Cristian Andres (@bootrider) one way to solve this might be a test configuration where you could configure your working folder. We plan to support this later. What do you think about this? BTW, right now you could use
getClass().getClassLoader().getResource()to walkaround if it is ok to update the code.nazneen84 commentedon Feb 23, 2018
Xuan Zhou (@ansyral) Is this the right issue to track to allow JUnit tests run from a configured location?
ansyral commentedon Feb 26, 2018
let's use #100 to track this