From 0f4ca4c6a33cb47f48ddd4d057075370f41cc856 Mon Sep 17 00:00:00 2001 From: Roman Chernyatchik Date: Wed, 9 Sep 2009 22:27:37 +0400 Subject: [PATCH] notifications about tests passed/finished in SM runner. Balloon will be shown only if Run/Dubug window isn't active (missed files) --- .../testframework/sm/runner/GeneralToSMTRunnerEventsConvertor.java | 4 ++-- .../execution/testframework/sm/runner/SMTRunnerEventsAdapter.java | 4 ++-- .../execution/testframework/sm/runner/SMTRunnerEventsListener.java | 6 ++++-- .../intellij/execution/testframework/sm/SMLightFixtureTestCase.java | 2 +- .../sm/runner/GeneralToSMTRunnerEventsConvertorTest.java | 3 ++- .../testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java | 6 +++--- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertor.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertor.java index e1fe3dd8f0..61664dff66 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertor.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertor.java @@ -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); } } diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerEventsAdapter.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerEventsAdapter.java index cb5b16a145..c03b5a3c1e 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerEventsAdapter.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerEventsAdapter.java @@ -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) {} diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerEventsListener.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerEventsListener.java index ec1491ccc3..3828dc8f81 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerEventsListener.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerEventsListener.java @@ -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 */ diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/SMLightFixtureTestCase.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/SMLightFixtureTestCase.java index e2ebe1ab1f..6bebda25db 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/SMLightFixtureTestCase.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/SMLightFixtureTestCase.java @@ -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; diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java index ab9c009180..4bc2a6b7a4 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java @@ -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(); } }); diff --git a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java index 3e9ef93005..b0f6b55515 100644 --- a/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java +++ b/platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java @@ -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); } -- 2.11.4.GIT