|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.microedition.midlet.MIDlet | +--j2meunit.midletui.TestRunner
A TestRunner that runs as a MIDlet. It can be used in two ways:
Field Summary | |
protected javax.microedition.lcdui.StringItem |
aErrorInfo
|
protected javax.microedition.lcdui.StringItem |
aFailureInfo
|
protected javax.microedition.lcdui.Gauge |
aProgressBar
|
protected TestResult |
aResult
|
protected javax.microedition.lcdui.List |
aResultsList
|
protected java.io.PrintStream |
aWriter
|
protected boolean |
bScreenOutput
|
protected boolean |
bTextOutput
|
protected int |
nCount
|
protected static TestRunner |
theInstance
|
Constructor Summary | |
TestRunner()
Creates a new TestRunner object. |
Method Summary | |
void |
addError(Test test,
java.lang.Throwable t)
TestListener.addError() - will print 'E' to System.out. |
void |
addFailure(Test test,
AssertionFailedError e)
TestListener.addError() - will print 'F' to System.out. |
void |
addToResultsList(java.lang.String sText)
Add a string to the result output. |
void |
addToResultsList(java.lang.Throwable t)
Add a string to the result output. |
protected Test |
createTestSuite(java.lang.String[] rTestCaseClasses)
Builds a test suite from all test case classes in a string array. |
protected void |
destroyApp(boolean bUnconditional)
Empty implementation of MIDlet.destroyApp. |
protected void |
doRun(Test suite)
Will run all tests in the given test suite. |
void |
endTest(Test test)
TestListener.endTest() |
void |
endTestStep(Test test)
TestListener.endTestStep() |
static TestRunner |
getInstance()
To return the current TestRunner instance. |
protected javax.microedition.lcdui.List |
getResultsList()
Returns the javax.microedition.lcdui.List instance to append the result data to. |
java.io.PrintStream |
getWriter()
Get the output stream (defaults to System.out). |
protected void |
pauseApp()
Empty implementation of MIDlet.pauseApp. |
void |
print(TestResult result)
Prints errors and failures to the standard output |
void |
printErrors(TestResult result)
Prints the errors to the standard output |
void |
printFailures(TestResult result)
Prints failures to the standard output |
void |
printFooter()
Prints the footer |
void |
printHeader(TestResult result)
Prints the header of the report |
void |
setOutputMode(boolean bScreen,
boolean bText)
To set the output mode(s) for this TestRunner. |
void |
setWriter(java.io.PrintStream aStream)
Set the output stream. |
void |
showResult()
To display the result of the test in a javax.microedition.lcdui.List screen. |
protected void |
start(java.lang.String[] rTestCaseClasses)
Starts a test run. processes the command line arguments and creates a test suite from it. |
protected void |
startApp()
Default implementation that reads the attribute J2MEUnitTestClasses with getAppProperty and invokes the method start() with the result string. |
void |
startTest(Test test)
TestListener.startTest() - will print '.' to te System.out. |
Methods inherited from class javax.microedition.midlet.MIDlet |
getAppProperty, notifyDestroyed, notifyPaused, resumeRequest |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static TestRunner theInstance
protected javax.microedition.lcdui.Gauge aProgressBar
protected javax.microedition.lcdui.List aResultsList
protected java.io.PrintStream aWriter
protected javax.microedition.lcdui.StringItem aErrorInfo
protected javax.microedition.lcdui.StringItem aFailureInfo
protected TestResult aResult
protected boolean bScreenOutput
protected boolean bTextOutput
protected int nCount
Constructor Detail |
public TestRunner()
Method Detail |
public static TestRunner getInstance()
public void setOutputMode(boolean bScreen, boolean bText)
bScreen
- If TRUE, output will be written to an LCDUI screenbText
- If TRUE, output will be written to a PrintStream (System.out
by default)public void setWriter(java.io.PrintStream aStream)
aStream
- A PrintStream to be used for output.public java.io.PrintStream getWriter()
public void addError(Test test, java.lang.Throwable t)
addError
in interface TestListener
test
- The test that failedt
- The Exception that caused the errorpublic void addFailure(Test test, AssertionFailedError e)
addFailure
in interface TestListener
test
- The test that failede
- The AssertionFailedError that caused the failurepublic void addToResultsList(java.lang.String sText)
sText
- The text to addpublic void addToResultsList(java.lang.Throwable t)
t
- The text to addpublic void endTest(Test test)
endTest
in interface TestListener
test
- The test that finishedpublic void endTestStep(Test test)
endTestStep
in interface TestListener
test
- The test of which a step has finishedpublic void print(TestResult result)
result
- The test resultspublic void printErrors(TestResult result)
result
- The test result containing the errorspublic void printFailures(TestResult result)
result
- The test result containing the failurespublic void printFooter()
public void printHeader(TestResult result)
result
- DOCUMENT ME!public void showResult()
public void startTest(Test test)
startTest
in interface TestListener
test
- The test that startedprotected javax.microedition.lcdui.List getResultsList()
protected Test createTestSuite(java.lang.String[] rTestCaseClasses)
rTestCaseClasses
- A string array containing the test case class
names
protected void destroyApp(boolean bUnconditional)
destroyApp
in class javax.microedition.midlet.MIDlet
bUnconditional
- Not needed hereprotected void doRun(Test suite)
suite
- The test suite to runprotected void pauseApp()
pauseApp
in class javax.microedition.midlet.MIDlet
protected void start(java.lang.String[] rTestCaseClasses)
The only thing that a sub
rTestCaseClasses
- The names of the test case classesprotected void startApp() throws javax.microedition.midlet.MIDletStateChangeException
startApp
in class javax.microedition.midlet.MIDlet
javax.microedition.midlet.MIDletStateChangeException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |