JUnit Rule TemporaryFolder

Posted by Jeff Storey on Stack Overflow See other posts from Stack Overflow or by Jeff Storey
Published on 2010-04-27T15:09:12Z Indexed on 2010/04/27 16:23 UTC
Read the original article Hit count: 344

Filed under:
|
|

I'm creating a TemporaryFolder using the @Rule annotation in JUnit 4.7. I've tried to create a new folder that is a child of the temp folder using tempFolder.newFolder("someFolder") in the @Before (setup) method of my test. It seems as though the temporary folder gets initialized after the setup method runs, meaning I can't use the temporary folder in the setup method. Is this correct (and predictable) behavior?

thanks, Jeff

© Stack Overflow or respective owner

Related posts about java

Related posts about junit