|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.cs.drjava.model.junit.DefaultJUnitModel
public class DefaultJUnitModel
Manages unit testing via JUnit.
Constructor Summary | |
---|---|
DefaultJUnitModel(MainJVM jvm,
CompilerModel compilerModel,
GlobalModel model)
Main constructor. |
Method Summary | |
---|---|
void |
addListener(JUnitListener listener)
Add a JUnitListener to the model. |
void |
classFileError(ClassFileError e)
Called to indicate that an illegal class file was encountered |
Iterable<File> |
getClassPath()
Returns the current classpath in use by the JUnit JVM, in the form of a path-separator delimited string. |
File |
getFileForClassName(String className)
Called when the JUnitTestManager wants to open a file that is not currently open. |
SwingDocument |
getJUnitDocument()
Used only for testing. |
JUnitErrorModel |
getJUnitErrorModel()
Gets the JUnitErrorModel, which contains error info for the last test run. |
boolean |
isTestInProgress()
|
void |
junit(OpenDefinitionsDocument doc)
Runs JUnit on the current document. |
void |
junitAll()
Creates a JUnit test suite over all currently open documents and runs it. |
void |
junitDocs(List<OpenDefinitionsDocument> lod)
Runs JUnit over a list of documents. |
void |
junitJVMReady()
Called when the JVM used for unit tests has registered. |
void |
junitProject()
Creates a JUnit test suite over all currently open documents and runs it. |
void |
nonTestCase(boolean isTestAll)
Called from the JUnitTestManager if its given className is not a test case. |
void |
removeAllListeners()
Removes all JUnitListeners from this model. |
void |
removeListener(JUnitListener listener)
Remove a JUnitListener from the model. |
void |
resetJUnitErrors()
Resets the junit error state to have no errors. |
void |
setForceTestSuffix(boolean b)
set the forceTestSuffix flag that forces class names in projects to end in "Test |
void |
testEnded(String testName,
boolean wasSuccessful,
boolean causedError)
Called when a particular test has ended. |
void |
testStarted(String testName)
Called when a particular test is started. |
void |
testSuiteEnded(JUnitError[] errors)
Called when a full suite of tests has finished running. |
void |
testSuiteStarted(int numTests)
Called to indicate that a suite of tests has started running. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultJUnitModel(MainJVM jvm, CompilerModel compilerModel, GlobalModel model)
jvm
- RMI interface to a secondary JVM for running testscompilerModel
- the CompilerModel, used only as a lock to prevent simultaneous test and compilemodel
- used only for getSourceFileMethod Detail |
---|
public void setForceTestSuffix(boolean b)
JUnitModel
setForceTestSuffix
in interface JUnitModel
public boolean isTestInProgress()
public void addListener(JUnitListener listener)
addListener
in interface JUnitModel
listener
- a listener that reacts to JUnit eventspublic void removeListener(JUnitListener listener)
removeListener
in interface JUnitModel
listener
- a listener that reacts to JUnit eventspublic void removeAllListeners()
removeAllListeners
in interface JUnitModel
public SwingDocument getJUnitDocument()
getJUnitDocument
in interface JUnitModel
public void junitAll()
junitAll
in interface JUnitModel
public void junitProject()
junitProject
in interface JUnitModel
public void junitDocs(List<OpenDefinitionsDocument> lod)
JUnitModel
junitDocs
in interface JUnitModel
lod
- the list of documents that are to be run through JUnit testing.public void junit(OpenDefinitionsDocument doc) throws ClassNotFoundException, IOException
junit
in interface JUnitModel
doc
- the document to be run under JUnit
ClassNotFoundException
IOException
public JUnitErrorModel getJUnitErrorModel()
getJUnitErrorModel
in interface JUnitModel
public void resetJUnitErrors()
resetJUnitErrors
in interface JUnitModel
public void nonTestCase(boolean isTestAll)
nonTestCase
in interface JUnitModel
nonTestCase
in interface JUnitModelCallback
isTestAll
- whether or not it was a use of the test all buttonpublic void classFileError(ClassFileError e)
classFileError
in interface JUnitModelCallback
e
- the ClassFileObject describing the error.public void testSuiteStarted(int numTests)
testSuiteStarted
in interface JUnitModelCallback
numTests
- The number of tests in the suite to be run.public void testStarted(String testName)
testStarted
in interface JUnitModelCallback
testName
- The name of the test being started.public void testEnded(String testName, boolean wasSuccessful, boolean causedError)
testEnded
in interface JUnitModelCallback
testName
- The name of the test that has ended.wasSuccessful
- Whether the test passed or not.causedError
- If not successful, whether the test caused an error or simply failed.public void testSuiteEnded(JUnitError[] errors)
testSuiteEnded
in interface JUnitModelCallback
errors
- The array of errors from all failed tests in the suite.public File getFileForClassName(String className)
getFileForClassName
in interface JUnitModelCallback
className
- the name of the class for which we want to find the file
public Iterable<File> getClassPath()
getClassPath
in interface JUnitModelCallback
public void junitJVMReady()
junitJVMReady
in interface JUnitModelCallback
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |