mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
tests notifications: listener api for tests finish
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package com.intellij.execution.testframework.sm.runner.ui;
|
||||
|
||||
import com.intellij.execution.testframework.TestConsoleProperties;
|
||||
import com.intellij.execution.testframework.TestStatusListener;
|
||||
import com.intellij.execution.testframework.TestsUIUtil;
|
||||
import com.intellij.execution.testframework.sm.SMTestsRunnerBundle;
|
||||
import com.intellij.execution.testframework.sm.runner.SMTRunnerEventsAdapter;
|
||||
@@ -98,6 +99,8 @@ public class SMTRunnerNotificationsHandler extends SMTRunnerEventsAdapter {
|
||||
type = null;
|
||||
}
|
||||
|
||||
TestStatusListener.notifySuiteFinished(testsRoot);
|
||||
|
||||
if (msg != null) {
|
||||
notify(msg, type, testsRoot);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.execution.testframework;
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
|
||||
public abstract class TestStatusListener {
|
||||
public static final ExtensionPointName<TestStatusListener> EP_NAME = ExtensionPointName.create("com.intellij.testStatusListener");
|
||||
|
||||
public abstract void testSuiteFinished(AbstractTestProxy root);
|
||||
|
||||
public static void notifySuiteFinished(AbstractTestProxy root) {
|
||||
for (TestStatusListener statusListener : Extensions.getExtensions(EP_NAME)) {
|
||||
statusListener.testSuiteFinished(root);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,7 @@ import com.intellij.execution.junit2.ui.model.JUnitRunningModel;
|
||||
import com.intellij.execution.junit2.ui.properties.JUnitConsoleProperties;
|
||||
import com.intellij.execution.testframework.AbstractTestProxy;
|
||||
import com.intellij.execution.testframework.Printable;
|
||||
import com.intellij.execution.testframework.TestStatusListener;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
@@ -201,6 +202,7 @@ public class TestsPacketsReceiver implements OutputPacketProcessor, Disposable {
|
||||
final JUnitRunningModel model = getModel();
|
||||
if (model != null) {
|
||||
model.getNotifier().fireRunnerStateChanged(new CompletionEvent(true, reader.readInt()));
|
||||
TestStatusListener.notifySuiteFinished(model.getRoot());
|
||||
terminateStillRunning(model);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -397,6 +397,7 @@ public class TestNGResults extends TestResultsPanel implements TestFrameworkRunn
|
||||
myStatusLine.setStatusColor(ColorProgressBar.GREEN);
|
||||
}
|
||||
rootNode.setInProgress(false);
|
||||
TestStatusListener.notifySuiteFinished(rootNode);
|
||||
if (TestNGConsoleProperties.SELECT_FIRST_DEFECT.value(myProperties)) {
|
||||
selectTest(rootNode.getFirstDefect());
|
||||
}
|
||||
|
||||
@@ -236,6 +236,7 @@
|
||||
<extensionPoint name="java.compilerOutputIndex" area="IDEA_PROJECT"
|
||||
interface="com.intellij.compilerOutputIndex.api.indexer.CompilerOutputBaseIndex"/>
|
||||
<extensionPoint name="vetoSPICondition" interface="com.intellij.openapi.util.Condition"/>
|
||||
<extensionPoint name="testStatusListener" interface="com.intellij.execution.testframework.TestStatusListener"/>
|
||||
</extensionPoints>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
|
||||
Reference in New Issue
Block a user