简体   繁体   中英

Eclipse in Linux: running a Junit coverage test gives an error “permission denied”

I am getting a java.io.IOException: Permission Denied error when I try to run a Coverage test over my Java project.

I can run individual JUnit tests, and they work fine.

Running the tests all together (via Coverage as JUnit tests), I get the error.

The Plug-in related to the error is org.eclipse.jdt.junit.core .

The stack trace given starts with org.eclipse.core.internals.jobs.Worker.run(Worker.java:54) and ends with java.io.UnixFileSystem.createFileExclusively(Native Method) .

I was able to run the coverage test before I built my project, but after the build it will not run. Not sure if these are connected.

Found the issue - java.io.UnixFileSystem.createFileExclusively(Native Method) . One of my tests (the newest one, which had not yet run under the Coverage test) was trying to write to a file that somehow had the permissions changed. Once the permissions were reset to allow me access, the Coverage test runs. Still not sure why it allowed me to individually run the test, but it all runs now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM