|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
grendel.SelfTest
This is the base grendel SelfTest. Running this classes main() will execute the main() of all the SelfTest classes within the Grendel project.
This class also contains useful stuff for all of the Grendel SelfTest classes to use. It is expected that all of those classes will inherit from this one.
Field Summary | |
protected static java.io.File |
playdir
The directory where you can store temporary stuff. |
protected static java.util.Properties |
props
The Properties instance that all the javamail stuff will use. |
protected static javax.mail.Session |
session
The javax.mail.Session object. |
Constructor Summary | |
SelfTest()
|
Method Summary | |
void |
cleanDirectory(java.io.File dir)
Recursively cleans out the contents of the given directory. |
void |
cleanPlayDirectory()
Blows away the play directory. |
void |
endTests()
Clean up at the end. |
java.lang.String |
getStackTrace(java.lang.Throwable t)
Given a throwable, return as a string the stack trace from it. |
void |
installFile(java.lang.String resname,
java.lang.String filename)
Takes a file from the jar file and stores it into the play directory. |
static void |
main(java.lang.String[] args)
Run all the grendel selftests. |
void |
makePlayDir()
Creates an empty directory for your test to put stuff into. |
java.lang.String |
prettyTime(long time)
Given a long that represents a time, returns a String representation of it suitable for putting in a log message. |
void |
setUserAndPassword(java.lang.String user,
java.lang.String password)
Stuff in the name and password we want to be used for the next test. |
void |
startTests(java.lang.String[] args)
Initialize things. |
void |
writeKnownBug(java.lang.Object o,
java.lang.String methodName,
int bugnum,
java.lang.String message)
Report a bug that we already know about and that has an outstanding bug report sitting in the bug database. |
Field Detail |
protected static java.util.Properties props
protected static javax.mail.Session session
protected static java.io.File playdir
Constructor Detail |
public SelfTest()
Method Detail |
public static void main(java.lang.String[] args)
public void startTests(java.lang.String[] args)
public void endTests()
public void setUserAndPassword(java.lang.String user, java.lang.String password)
public void makePlayDir()
The very first time this is called, we make sure that the directory doesn't already exist. We want to make sure not to blow away something that was already sitting on disk that doesn't belong to us.
public void cleanDirectory(java.io.File dir)
public void cleanPlayDirectory()
public java.lang.String getStackTrace(java.lang.Throwable t)
public void installFile(java.lang.String resname, java.lang.String filename)
resname
- The name of the resource to grab from the jar file. This
name is interpreted relative to the package that your SelfTest subclass
is in.filename
- The name of the file to create. This name is interpreted
relative to the playdir.public java.lang.String prettyTime(long time)
public void writeKnownBug(java.lang.Object o, java.lang.String methodName, int bugnum, java.lang.String message)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |