notifications about tests passed/finished in SM runner. Balloon will be shown only if Run/Dubug window isn't active (missed files)

This commit is contained in:
Roman Chernyatchik
2009-09-09 22:27:37 +04:00
parent 878cf2d064
commit 0f4ca4c6a3
6 changed files with 14 additions and 11 deletions
@@ -324,13 +324,13 @@ public class GeneralToSMTRunnerEventsConvertor implements GeneralTestEventsProce
private void fireOnTestingStarted() {
for (SMTRunnerEventsListener listener : myEventsListeners) {
listener.onTestingStarted();
listener.onTestingStarted(myTestsRootNode);
}
}
private void fireOnTestingFinished() {
for (SMTRunnerEventsListener listener : myEventsListeners) {
listener.onTestingFinished();
listener.onTestingFinished(myTestsRootNode);
}
}
@@ -6,8 +6,8 @@ import org.jetbrains.annotations.NotNull;
* @author Roman Chernyatchik
*/
public class SMTRunnerEventsAdapter implements SMTRunnerEventsListener {
public void onTestingStarted(){}
public void onTestingFinished(){}
public void onTestingStarted(@NotNull SMTestProxy testsRoot){}
public void onTestingFinished(@NotNull SMTestProxy testsRoot){}
public void onTestsCountInSuite(final int count) {}
public void onTestStarted(@NotNull final SMTestProxy test) {}
@@ -10,12 +10,14 @@ import org.jetbrains.annotations.NotNull;
public interface SMTRunnerEventsListener {
/**
* On start testing, before tests and suits launching
* @param testsRoot
*/
void onTestingStarted();
void onTestingStarted(@NotNull SMTestProxy testsRoot);
/**
* After test framework finish testing
* @param testsRootNode
*/
void onTestingFinished();
void onTestingFinished(@NotNull SMTestProxy testsRoot);
/*
* Tests count in next suite. For several suites this method will be invoked several times
*/
@@ -20,7 +20,7 @@ import java.io.IOException;
/**
* @author Roman.Chernyatchik
*/
public class SMLightFixtureTestCase extends UsefulTestCase {
public abstract class SMLightFixtureTestCase extends UsefulTestCase {
protected static final LightProjectDescriptor ourDescriptor = new LightProjectDescriptor() {
public ModuleType getModuleType() {
return ModuleType.EMPTY;
@@ -8,6 +8,7 @@ import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerTestTreeView;
import com.intellij.execution.testframework.sm.runner.ui.SMTestRunnerResultsForm;
import com.intellij.openapi.util.Disposer;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeModel;
@@ -249,7 +250,7 @@ public class GeneralToSMTRunnerEventsConvertorTest extends BaseSMTRunnerTestCase
final Marker finishedMarker = new Marker();
myEventsProcessor.addEventsListener(new SMTRunnerEventsAdapter(){
@Override
public void onTestingFinished() {
public void onTestingFinished(@NotNull SMTestProxy testsRoot) {
finishedMarker.set();
}
});
@@ -59,12 +59,12 @@ public class SMTestRunnerResultsFormTest extends BaseSMTRunnerTestCase {
public void testGetTestsRootNode() {
assertNotNull(myTestsRootNode);
myResultsViewer.onTestingFinished();
myResultsViewer.onTestingFinished(myTestsRootNode);
assertNotNull(myResultsViewer.getTestsRootNode());
}
public void testTestingStarted() {
myResultsViewer.onTestingStarted();
myResultsViewer.onTestingStarted(myTestsRootNode);
assertTrue(myResultsViewer.getStartTime() > 0);
assertEquals(0, myResultsViewer.getTestsCurrentCount());
@@ -130,7 +130,7 @@ public class SMTestRunnerResultsFormTest extends BaseSMTRunnerTestCase {
}
public void testOnFinishTesting_EndTime() {
myResultsViewer.onTestingFinished();
myResultsViewer.onTestingFinished(myTestsRootNode);
assertTrue(myResultsViewer.getEndTime() > 0);
}