|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.junit.JUnitTestManager
public class JUnitTestManager
Runs in the InterpreterJVM. Runs tests given a classname and formats the results into a (serializable) array of JUnitError that can be passed back to the MainJVM.
| Field Summary | |
|---|---|
private JUnitModelCallback |
_jmc
The interface to the master JVM via RMI. |
private Lambda<ClassLoader,ClassLoader> |
_loaderFactory
A factory producing a ClassLoader for tests with the given parent |
protected static Log |
_log
|
private TestSuite |
_suite
The accumulated test suite; null if no test is pending. |
private List<String> |
_testClassNames
The accumulated list of names of TestCase classes; null if no test is pending. |
private List<File> |
_testFiles
The list of files corresponding to testClassNames; null if no test is pending. |
private JUnitTestRunner |
_testRunner
The current testRunner; initially null. |
| Constructor Summary | |
|---|---|
JUnitTestManager(JUnitModelCallback jmc,
Lambda<ClassLoader,ClassLoader> loaderFactory)
Standard constructor |
|
| Method Summary | |
|---|---|
private boolean |
_isJUnitTest(Class<?> c)
Determines if the given class is a junit Test. |
private int |
_lineNumber(String sw,
String classname)
Parses the line number out of the stack trace in the given class name. |
private JUnitError |
_makeJUnitError(TestFailure failure,
List<String> classNames,
boolean isError,
List<File> files)
Constructs a new JUnitError from a TestFailure |
private void |
_reset()
|
List<String> |
findTestClasses(List<String> classNames,
List<File> files)
Find the test classes among the given classNames and accumulate them in TestSuite for junit. |
private JUnitTestRunner |
makeRunner()
Make a fresh JUnitTestRunner with its own class loader instance. |
boolean |
runTestSuite()
Runs the pending test suite set up by the preceding call to findTestClasses. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Log _log
private final JUnitModelCallback _jmc
private final Lambda<ClassLoader,ClassLoader> _loaderFactory
private JUnitTestRunner _testRunner
private TestSuite _suite
private List<String> _testClassNames
private List<File> _testFiles
| Constructor Detail |
|---|
public JUnitTestManager(JUnitModelCallback jmc,
Lambda<ClassLoader,ClassLoader> loaderFactory)
| Method Detail |
|---|
public List<String> findTestClasses(List<String> classNames,
List<File> files)
classNames - the class names that are test class candidatesfiles - the files corresponding to classNamespublic boolean runTestSuite()
private void _reset()
private boolean _isJUnitTest(Class<?> c)
c - the class to check
private JUnitError _makeJUnitError(TestFailure failure,
List<String> classNames,
boolean isError,
List<File> files)
failure - A given TestFailureclassNames - The classes that were used for this test suiteisError - The passed TestFailure may signify either an error or a failurefiles - The files that were used for this test suite
private int _lineNumber(String sw,
String classname)
private JUnitTestRunner makeRunner()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||