The plugin attaches itself to the
org.eclipse.jdt.junit.testRunListeners
extension point and records the names of all tests during JUnit test execution. (See RedGreenListener.java
) When the test session is finished, it compares these test statistics against the previous run. In fact the only thing we need to know is if any test cases have been added. (See TestStats.java
) Based on the comparison the plugin decides if to show an annoying popup or not. (See TestRunDiff.java
)The current mechanism is simple and likely to be wrong for special cases:
public boolean firstTestOk() { return newAdded.size() == 0 || secondFailed; }but it works great on katas and small hobby projects.
The
org.eclipse.jdt.junit.testRunListeners
extension point is available in Eclipse Europa (version 3.3), but it does not work there. The schema testRunListeners.exsd
for the extension point seems to be missing from the JDT/JUnit bundles. The situation changes in Helios (3.6) and JUnit starts to notify the declared listeners. As the current release of Eclipse is version 3.8/4.2, I believe that two versions of backwards-compatibility should be enough.Download the plugin here. Copy it into your
plugins
folder and restart Eclipse.