use of com.intellij.execution.testframework.TestFrameworkRunningModel in project intellij-community by JetBrains.
the class ImportedTestRunnableState method execute.
@Nullable
@Override
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
final MyEmptyProcessHandler handler = new MyEmptyProcessHandler();
final SMTRunnerConsoleProperties properties = myRunProfile.getProperties();
RunProfile configuration;
final String frameworkName;
if (properties != null) {
configuration = properties.getConfiguration();
frameworkName = properties.getTestFrameworkName();
} else {
configuration = myRunProfile;
frameworkName = "Import Test Results";
}
final ImportedTestConsoleProperties consoleProperties = new ImportedTestConsoleProperties(properties, myFile, handler, myRunProfile.getProject(), configuration, frameworkName, executor);
final BaseTestsOutputConsoleView console = SMTestRunnerConnectionUtil.createConsole(consoleProperties.getTestFrameworkName(), consoleProperties);
final JComponent component = console.getComponent();
AbstractRerunFailedTestsAction rerunFailedTestsAction = null;
if (component instanceof TestFrameworkRunningModel) {
rerunFailedTestsAction = consoleProperties.createRerunFailedTestsAction(console);
if (rerunFailedTestsAction != null) {
rerunFailedTestsAction.setModelProvider(() -> (TestFrameworkRunningModel) component);
}
}
console.attachToProcess(handler);
final DefaultExecutionResult result = new DefaultExecutionResult(console, handler);
if (rerunFailedTestsAction != null) {
result.setRestartActions(rerunFailedTestsAction);
}
return result;
}
use of com.intellij.execution.testframework.TestFrameworkRunningModel in project intellij-community by JetBrains.
the class AbstractRerunFailedTestsAction method isActive.
private boolean isActive(AnActionEvent e) {
Project project = e.getProject();
if (project == null) {
return false;
}
TestFrameworkRunningModel model = getModel();
if (model == null || model.getRoot() == null) {
return false;
}
Filter filter = getFailuresFilter();
for (AbstractTestProxy test : model.getRoot().getAllTests()) {
//noinspection unchecked
if (filter.shouldAccept(test)) {
return true;
}
}
return false;
}
use of com.intellij.execution.testframework.TestFrameworkRunningModel in project intellij by bazelbuild.
the class BlazeRerunFailedTestsAction method getRunProfile.
@Override
@Nullable
protected MyRunProfile getRunProfile(ExecutionEnvironment environment) {
final TestFrameworkRunningModel model = getModel();
if (model == null) {
return null;
}
BlazeCommandRunConfiguration config = (BlazeCommandRunConfiguration) model.getProperties().getConfiguration();
return new BlazeRerunTestRunProfile(config.clone());
}
Aggregations