edu.rice.cs.drjava.model.junit
Interface JUnitModel

All Known Implementing Classes:
DefaultJUnitModel

public interface JUnitModel


Method Summary
 void addListener(JUnitListener listener)
          Add a JUnitListener to the model.
 SwingDocument getJUnitDocument()
          This is used by test cases and perhaps other things.
 JUnitErrorModel getJUnitErrorModel()
          Gets the JUnitErrorModel, which contains error info for the last test run.
 void junit(OpenDefinitionsDocument doc)
          Runs JUnit over a single 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 junitProject()
          Creates a JUnit test suite over all currently open project documents and runs it.
 void nonTestCase(boolean isTestAll)
          Cleans up an attempt JUnit test exeuction when suitable test code is not available.
 void removeAllListeners()
          Removes all JUnitListeners from this model.
 void removeListener(JUnitListener listener)
          Removes 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
 

Method Detail

setForceTestSuffix

void setForceTestSuffix(boolean b)
set the forceTestSuffix flag that forces class names in projects to end in "Test


addListener

void addListener(JUnitListener listener)
Add a JUnitListener to the model.

Parameters:
listener - a listener that reacts to JUnit events

removeListener

void removeListener(JUnitListener listener)
Removes a JUnitListener from the model. If the listener is not installed, this method has no effect.

Parameters:
listener - a listener that reacts to JUnit events

removeAllListeners

void removeAllListeners()
Removes all JUnitListeners from this model.


getJUnitDocument

SwingDocument getJUnitDocument()
This is used by test cases and perhaps other things. We should kill it.


junitAll

void junitAll()
Creates a JUnit test suite over all currently open documents and runs it. If the class file associated with a file is not a test case, it will be ignored. Synchronized against the compiler model to prevent testing and compiling at the same time, which would create invalid results.


junitProject

void junitProject()
Creates a JUnit test suite over all currently open project documents and runs it. If the class file associated with a file is not a test case, it will be ignored. Synchronized against the compiler model to prevent testing and compiling at the same time, which would create invalid results.


junitDocs

void junitDocs(List<OpenDefinitionsDocument> lod)
Runs JUnit over a list of documents. Synchronized against the compiler model to prevent testing and compiling at the same time, which would create invalid results.

Parameters:
lod - the list of documents that are to be run through JUnit testing.

junit

void junit(OpenDefinitionsDocument doc)
           throws ClassNotFoundException,
                  IOException
Runs JUnit over a single document. Synchronized against the compiler model to prevent testing and compiling at the same time, which would create invalid results.

Parameters:
doc - the document to be run under JUnit
Throws:
ClassNotFoundException
IOException

nonTestCase

void nonTestCase(boolean isTestAll)
Cleans up an attempt JUnit test exeuction when suitable test code is not available.

Parameters:
isTestAll - whether or not it was a use of the test all button

getJUnitErrorModel

JUnitErrorModel getJUnitErrorModel()
Gets the JUnitErrorModel, which contains error info for the last test run.


resetJUnitErrors

void resetJUnitErrors()
Resets the junit error state to have no errors.