|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jetty.server.session.test.MavenTestingUtils
public class MavenTestingUtils
Common utility methods for working with JUnit tests cases in a maven friendly way.
| Constructor Summary | |
|---|---|
MavenTestingUtils()
|
|
| Method Summary | |
|---|---|
static File |
getBasedir()
|
static File |
getTargetDir()
Get the directory to the /target directory for this project. |
static File |
getTargetFile(String path)
Create a File object for a path in the /target directory. |
static File |
getTargetTestingDir()
|
static File |
getTargetTestingDir(String testname)
Get a dir in /target/ that uses the an arbitrary name. |
static File |
getTargetTestingDir(junit.framework.TestCase test)
Get a dir in /target/ that uses the JUnit 3.x TestCase.getName() to make itself unique. |
static String |
getTestID()
|
static File |
getTestResourceDir(String name)
Get a dir from the src/test/resource directory. |
static File |
getTestResourceFile(String name)
Get a file from the src/test/resource directory. |
static File |
getTestResourcePath(String name)
Get a path resource (File or Dir) from the src/test/resource directory. |
static File |
getTestResourcesDir()
Get the directory to the src/test/resource directory |
static String |
readToString(File file)
Read the contents of a file into a String and return it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MavenTestingUtils()
| Method Detail |
|---|
public static File getBasedir()
public static File getTargetDir()
public static File getTargetFile(String path)
File object for a path in the /target directory.
path - the path desired, no validation of existence is performed.
public static File getTargetTestingDir()
public static File getTargetTestingDir(junit.framework.TestCase test)
TestCase.getName() to make itself unique.
test - the junit 3.x testcase to base this new directory on.
${basedir}/target sub directorypublic static File getTargetTestingDir(String testname)
testname - the testname to create directory against.
${basedir}/target sub directorypublic static File getTestResourceDir(String name)
name - the name of the path to get (it must exist as a dir)
public static File getTestResourceFile(String name)
name - the name of the path to get (it must exist as a file)
public static File getTestResourcePath(String name)
name - the name of the path to get (it must exist)
public static File getTestResourcesDir()
File to the src/test/resources directory
public static String readToString(File file)
throws IOException
file - the file to read.
IOException - if unable to read the file.public static String getTestID()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||