junit4 icon indicating copy to clipboard operation
junit4 copied to clipboard

Mvn test failed with TemporaryFolderUsageTest

Open fubingting opened this issue 3 years ago • 2 comments

When I test with mvn test, the error is as follows:

Running org.junit.rules.TemporaryFolderUsageTest Tests run: 24, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.105 sec <<< FAILURE! - in org.junit.rules.TemporaryFolderUsageTest newFolderWithGivenFolderThrowsIOExceptionWhenFolderCannotBeCreated(org.junit.rules.TemporaryFolderUsageTest) Time elapsed: 0.012 sec <<< FAILURE! java.lang.AssertionError: Expected test to throw (an instance of java.io.IOException and exception with message a string containing "could not create a folder with the path 'level1'")

test env: [email protected] [email protected] [email protected] os:centos

fubingting avatar Mar 11 '21 12:03 fubingting

@fubingting Can you please debug the test and tell us why it does not reach line 216 in TemporaryFolder.java. Is it because one of the conditions lastMkdirsCallSuccessful and file.isDirectory() is true?

stefanbirkner avatar Mar 15 '21 20:03 stefanbirkner

I found that I was successful in a non-root environment. Does it have anything to do with root permissions? @stefanbirkner

fubingting avatar Sep 17 '21 03:09 fubingting