|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--junit.runner.BaseTestRunner | +--de.uds.cs.st.dd.core.JUnitRunner
The JUnitRunner is used to launch a JUnit configuration automatically.
Field Summary | |
private Socket |
clientSocket
The client socket. |
private int |
deltaDebuggingMode
Mode of the Delta Debugging algorithm. |
private String |
host
Host to connect to, default is the localhost |
private String |
inputFile
Name of the input file of the JUnit test that is to be analyzed with. |
static String |
MSG_FAILING_INPUT
Constant message header indicating the failing input. |
static String |
MSG_FAILING_INPUT_ENDED
Constant message header indicating the end of the failing * input message. |
static String |
MSG_JUNIT_ENDED
Constant message header indicating the end of a JUnit run. |
static String |
MSG_MINIMIZE_ENDED
Constant message header indicating the end of a Delta Debugging * result message. |
static String |
MSG_MINIMIZE_RESULT
Constant message header indicating the result of a Delta Debugging * process (i.e. |
static String |
MSG_PASSING_INPUT
Constant message header indicating the passing input. |
static String |
MSG_PASSING_INPUT_ENDED
Constant message header indicating the end of the passing * input message. |
static String |
MSG_STATUS_MINIMIZED
Constant message header indicating the finished status of a Delta * Debugging analysis. |
static String |
MSG_STATUS_TEMPORARY
Constant message header indicating a temporary result of a Delta * Debugging analysis. |
static String |
MSG_TEST_ENDED
Constant message header indicating the end of a test. |
static String |
MSG_TEST_FAILED
Constant message header indicating the failure of a test. |
static String |
MSG_TEST_FAILED_ENDED
Constant message header indicating the end of a test-failure message. |
static String |
MSG_TEST_RUN_STARTED
Constant message header indicating the beginning of a test run. |
static String |
MSG_TEXT
Constant message header indicating a text message. |
static String |
MSG_TEXT_ENDED
Constant message header indicating the end of a text message. |
private String |
originalFileName
Name of the original file. |
private int |
port
Port to connect to. |
private junit.framework.TestResult |
result
Holds information on the test result. |
private boolean |
storeFailingTests
A flag to indicate, if failing tests are to be stored or not. |
private PrintWriter |
writer
Print writer for sending messages |
Fields inherited from class junit.runner.BaseTestRunner |
SUITE_METHODNAME |
Constructor Summary | |
JUnitRunner()
Creates a new JUnitRunner and allocates the test result. |
Method Summary | |
private boolean |
connect()
Connects to remote listeners. |
protected junit.framework.TestResult |
createTestResult()
Convenience method to create a new TestResult object. |
junit.framework.TestResult |
doRun(junit.framework.Test test)
Runs the specified test(s). |
void |
endTest(junit.framework.Test test)
|
private junit.framework.Test |
findTest(String suiteClassName,
String methodName)
Helper method to find a Test class based on the name of the test suite * and a method name. |
int |
getLineNumber(Throwable exc,
String text)
Determines the line number of the failure as it occured in the * specified test function (i.e. |
junit.runner.TestSuiteLoader |
getLoader()
Returns the standard suite loader. |
static void |
main(String[] args)
Main entry point of the JUnitRunner. |
static void |
run(Class testClass)
Runs the specified test class. |
static junit.framework.TestResult |
run(junit.framework.Test test)
Runs a single test. |
protected void |
runFailed(String arg0)
|
void |
sendMessage(String msg)
Used to send an arbitrary message. |
void |
sendTextMessage(String message)
Convenience method to send a text message. |
void |
shutDown()
Cleanup. |
junit.framework.TestResult |
start(String[] args)
Actually starts the testing with the command line parameters that * have been specified when calling the main function. |
void |
startTest(junit.framework.Test test)
|
void |
testEnded(String test)
|
void |
testFailed(int status,
junit.framework.Test test,
Throwable exc)
Overrides the testFailed method from the BaseTestRunner class. |
void |
testStarted(String test)
|
Methods inherited from class junit.runner.BaseTestRunner |
addError, addFailure, clearStatus, elapsedTimeAsString, extractClassName, getFilteredTrace, getFilteredTrace, getPreference, getPreference, getPreferences, getTest, inVAJava, loadSuiteClass, processArguments, savePreferences, setLoading, setPreference, setPreferences, showStackRaw, truncate, useReloadingTestSuiteLoader |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String MSG_TEST_ENDED
public static final String MSG_MINIMIZE_RESULT
public static final String MSG_MINIMIZE_ENDED
public static final String MSG_FAILING_INPUT
public static final String MSG_FAILING_INPUT_ENDED
public static final String MSG_PASSING_INPUT
public static final String MSG_PASSING_INPUT_ENDED
public static final String MSG_TEST_FAILED
public static final String MSG_TEST_FAILED_ENDED
public static final String MSG_TEST_RUN_STARTED
public static final String MSG_JUNIT_ENDED
public static final String MSG_TEXT
public static final String MSG_TEXT_ENDED
public static final String MSG_STATUS_MINIMIZED
public static final String MSG_STATUS_TEMPORARY
private Socket clientSocket
private PrintWriter writer
private String host
private int port
private int deltaDebuggingMode
private String inputFile
private String originalFileName
private junit.framework.TestResult result
private boolean storeFailingTests
Constructor Detail |
public JUnitRunner()
Method Detail |
public static void run(Class testClass)
testClass
- class which holds the tests to be executed.public static junit.framework.TestResult run(junit.framework.Test test)
test
- test to be run.
public junit.runner.TestSuiteLoader getLoader()
getLoader
in class junit.runner.BaseTestRunner
public void testStarted(String test)
testStarted
in class junit.runner.BaseTestRunner
public void testEnded(String test)
testEnded
in class junit.runner.BaseTestRunner
public void startTest(junit.framework.Test test)
startTest
in interface junit.framework.TestListener
startTest
in class junit.runner.BaseTestRunner
public void endTest(junit.framework.Test test)
endTest
in interface junit.framework.TestListener
endTest
in class junit.runner.BaseTestRunner
public int getLineNumber(Throwable exc, String text)
public void testFailed(int status, junit.framework.Test test, Throwable exc)
testFailed
in class junit.runner.BaseTestRunner
protected void runFailed(String arg0)
runFailed
in class junit.runner.BaseTestRunner
BaseTestRunner.runFailed(java.lang.String)
protected junit.framework.TestResult createTestResult()
public junit.framework.TestResult doRun(junit.framework.Test test)
public static void main(String[] args)
-f filename
: stores all failing test names and the exact
* line of the assertion violation in the specified file.
*
* _OR_
*
* -m inputfilename testname
: minimizes the specified file, if
* a failure is detected in the test named testname
.
*
* Do not specifiy both arguments.
*
* Additionaly, you have to specify the name of the class that holds
* the test.
*
* Example: JUnitRunner -m input.txt testMultiply mymath.ArithmeticTester
*
* @param args Command line parameters (see above).
private junit.framework.Test findTest(String suiteClassName, String methodName)
public void sendMessage(String msg)
ISimpleViewer
sendMessage
in interface ISimpleViewer
msg
- the message to be sent. May contain additional information
about the message type.public void sendTextMessage(String message)
ISimpleViewer
sendTextMessage
in interface ISimpleViewer
message
- text message to send.public void shutDown()
private boolean connect()
public junit.framework.TestResult start(String[] args) throws Exception
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |