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:
applyin interfaceorg.junit.rules.TestRule- Overrides:
applyin classorg.junit.rules.ExternalResource
-
before
- Overrides:
beforein classorg.junit.rules.ExternalResource- Throws:
Throwable
-
after
protected void after()- Overrides:
afterin classorg.junit.rules.ExternalResource
-
newDir
- Specified by:
newDirin interfaceorg.sonar.api.utils.TempFolder
-
newDir
- Specified by:
newDirin interfaceorg.sonar.api.utils.TempFolder
-
newFile
- Specified by:
newFilein interfaceorg.sonar.api.utils.TempFolder
-
newFile
- Specified by:
newFilein interfaceorg.sonar.api.utils.TempFolder
-
getRoot
-