Package org.sonar.api.impl.utils
Class JUnitTempFolder
java.lang.Object
org.junit.rules.ExternalResource
org.sonar.api.impl.utils.JUnitTempFolder
- All Implemented Interfaces:
org.junit.rules.TestRule
,org.sonar.api.utils.TempFolder
public class JUnitTempFolder
extends org.junit.rules.ExternalResource
implements org.sonar.api.utils.TempFolder
Implementation of
Example:
TempFolder
to be used
only in JUnit tests. It wraps TemporaryFolder
.
Example:
public class MyTest { @@org.junit.Rule public JUnitTempFolder temp = new JUnitTempFolder(); @@org.junit.Test public void myTest() throws Exception { File dir = temp.newDir(); // ... } }
- Since:
- 5.1
-
Constructor Details
-
JUnitTempFolder
public JUnitTempFolder()
-
-
Method Details
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description) - Specified by:
apply
in interfaceorg.junit.rules.TestRule
- Overrides:
apply
in classorg.junit.rules.ExternalResource
-
before
- Overrides:
before
in classorg.junit.rules.ExternalResource
- Throws:
Throwable
-
after
protected void after()- Overrides:
after
in classorg.junit.rules.ExternalResource
-
newDir
- Specified by:
newDir
in interfaceorg.sonar.api.utils.TempFolder
-
newDir
- Specified by:
newDir
in interfaceorg.sonar.api.utils.TempFolder
-
newFile
- Specified by:
newFile
in interfaceorg.sonar.api.utils.TempFolder
-
newFile
- Specified by:
newFile
in interfaceorg.sonar.api.utils.TempFolder
-
getRoot
-