|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.EventNotifier<JUnitListener>
edu.rice.cs.drjava.model.junit.JUnitEventNotifier
class JUnitEventNotifier
Keeps track of all listeners to a JUnitModel, and has the ability to notify them of some event.
This class has a specific role of managing JUnitListeners. Other classes with similar names use similar code to perform the same function for other interfaces, e.g. InteractionsEventNotifier and GlobalEventNotifier. These classes implement the appropriate interface definition so that they can be used transparently as composite packaging for a particular listener interface.
Components which might otherwise manage their own list of listeners use EventNotifiers instead to simplify their internal implementation. Notifiers should therefore be considered a private implementation detail of the components, and should not be used directly outside of the "host" component.
All methods in this class must use the synchronization methods provided by ReaderWriterLock. This ensures that multiple notifications (reads) can occur simultaneously, but only one thread can be adding or removing listeners (writing) at a time, and no reads can occur during a write.
No methods on this class should be synchronized using traditional Java synchronization!
| Field Summary |
|---|
| Fields inherited from class edu.rice.cs.drjava.model.EventNotifier |
|---|
_listeners, _lock |
| Constructor Summary | |
|---|---|
JUnitEventNotifier()
|
|
| Method Summary | |
|---|---|
void |
addListener(JUnitListener jul)
Adds a listener to the notifier. |
void |
classFileError(ClassFileError e)
Called when JUnit encounters an illegal class file. |
void |
compileBeforeJUnit(CompilerListener cl,
List<OpenDefinitionsDocument> outOfSync)
Called before JUnit is started by the DefaultJUnitModel. |
void |
junitClassesStarted()
Called after junitClasses is started by the GlobalModel. |
void |
junitEnded()
Called after JUnit is finished running tests. |
void |
junitStarted()
Called after junit/junitAll is started by the GlobalModel. |
void |
junitSuiteStarted(int numTests)
Called to indicate that a suite of tests has started running. |
void |
junitTestEnded(String name,
boolean wasSuccessful,
boolean causedError)
Called when a particular test has ended. |
void |
junitTestStarted(String name)
Called when a particular test is started. |
void |
nonTestCase(boolean isTestAll,
boolean didCompileFail)
Called when trying to test a non-TestCase class. |
| Methods inherited from class edu.rice.cs.drjava.model.EventNotifier |
|---|
removeAllListeners, removeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
JUnitEventNotifier()
| Method Detail |
|---|
public void addListener(JUnitListener jul)
EventNotifier
addListener in class EventNotifier<JUnitListener>jul - a listener that reacts on events
public void nonTestCase(boolean isTestAll,
boolean didCompileFail)
nonTestCase in interface JUnitListenerisTestAll - whether or not it was a use of the test all buttondidCompileFail - whether or not a compile before this JUnit attempt failedpublic void classFileError(ClassFileError e)
JUnitListener
classFileError in interface JUnitListenere - the error or exception thrown by loading and resolving f.
public void compileBeforeJUnit(CompilerListener cl,
List<OpenDefinitionsDocument> outOfSync)
compileBeforeJUnit in interface JUnitListenerpublic void junitStarted()
junitStarted in interface JUnitListenerpublic void junitClassesStarted()
junitClassesStarted in interface JUnitListenerpublic void junitSuiteStarted(int numTests)
junitSuiteStarted in interface JUnitListenernumTests - The number of tests in the suite to be run.public void junitTestStarted(String name)
junitTestStarted in interface JUnitListenername - The name of the test being started.
public void junitTestEnded(String name,
boolean wasSuccessful,
boolean causedError)
junitTestEnded in interface JUnitListenername - 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 junitEnded()
junitEnded in interface JUnitListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||