|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jetty.toolchain.test.TestingDir
public class TestingDir
A junit 4.x Rule
to provide a common, easy to use, testing directory that is unique per unit test.
Similar in scope to the TemporaryFolder
rule, as it creates a directory, when asked (via getDir()
or getEmptyDir()
) in the maven
project familiar and friendly location: ${basedir}/target/tests/${testclass}/${testmethod}
.
Note: existing facilities within MavenTestingUtils
for keeping the directory name short for the sake of windows users is being used.
Constructor Summary | |
---|---|
TestingDir()
|
Method Summary | |
---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement statement,
org.junit.runners.model.FrameworkMethod method,
Object target)
|
void |
ensureEmpty()
Ensure that the test directory is empty. |
File |
getDir()
Get the test specific directory to use for testing work directory. |
File |
getEmptyDir()
Get the unique testing directory while ensuring that it is empty (if not). |
File |
getFile(String name)
Get a file inside of the test specific test directory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TestingDir()
Method Detail |
---|
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement statement, org.junit.runners.model.FrameworkMethod method, Object target)
apply
in interface org.junit.rules.MethodRule
public File getDir()
Name is derived from the test classname & method name.
public File getFile(String name)
Note: No assertions are made if the file exists or not.
name
- the path name of the file (supports deep paths)
public void ensureEmpty()
Useful for repeated testing without using the maven clean
goal (such as within Eclipse).
public File getEmptyDir()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |