本文整理汇总了Java中com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction.setModelProvider方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractRerunFailedTestsAction.setModelProvider方法的具体用法?Java AbstractRerunFailedTestsAction.setModelProvider怎么用?Java AbstractRerunFailedTestsAction.setModelProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction
的用法示例。
在下文中一共展示了AbstractRerunFailedTestsAction.setModelProvider方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: attachRerunFailedTestsAction
import com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction; //导入方法依赖的package包/类
public static DefaultExecutionResult attachRerunFailedTestsAction(DefaultExecutionResult result) {
ExecutionConsole console = result.getExecutionConsole();
if (!(console instanceof SMTRunnerConsoleView)) {
return result;
}
SMTRunnerConsoleView smConsole = (SMTRunnerConsoleView) console;
TestConsoleProperties consoleProperties = smConsole.getProperties();
if (!(consoleProperties instanceof BlazeTestConsoleProperties)) {
return result;
}
BlazeTestConsoleProperties properties = (BlazeTestConsoleProperties) consoleProperties;
AbstractRerunFailedTestsAction action = properties.createRerunFailedTestsAction(smConsole);
if (action != null) {
action.init(properties);
action.setModelProvider(smConsole::getResultsViewer);
result.setRestartActions(action);
}
return result;
}
示例2: execute
import com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction; //导入方法依赖的package包/类
@NotNull
@Override
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
if (GaugeVersion.isGreaterOrEqual(GaugeRunConfiguration.TEST_RUNNER_SUPPORT_VERSION, false)
&& GaugeSettingsService.getSettings().useIntelliJTestRunner()) {
ProcessHandler handler = startProcess();
GaugeConsoleProperties properties = new GaugeConsoleProperties(config, "Gauge", executor, handler);
ConsoleView console = SMTestRunnerConnectionUtil.createAndAttachConsole("Gauge", handler, properties);
DefaultExecutionResult result = new DefaultExecutionResult(console, handler, createActions(console, handler));
if (ActionManager.getInstance().getAction("RerunFailedTests") != null) {
AbstractRerunFailedTestsAction action = properties.createRerunFailedTestsAction(console);
if (action != null) {
action.setModelProvider(((SMTRunnerConsoleView) console)::getResultsViewer);
result.setRestartActions(action);
}
}
return result;
}
return super.execute(executor, runner);
}
示例3: execute
import com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction; //导入方法依赖的package包/类
@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(new Getter<TestFrameworkRunningModel>() {
@Override
public TestFrameworkRunningModel get() {
return (TestFrameworkRunningModel)component;
}
});
}
}
console.attachToProcess(handler);
final DefaultExecutionResult result = new DefaultExecutionResult(console, handler);
if (rerunFailedTestsAction != null) {
result.setRestartActions(rerunFailedTestsAction);
}
return result;
}
示例4: execute
import com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction; //导入方法依赖的package包/类
@Nullable
@Override
public ExecutionResult execute(Executor executor, @Nonnull 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(new Getter<TestFrameworkRunningModel>() {
@Override
public TestFrameworkRunningModel get() {
return (TestFrameworkRunningModel)component;
}
});
}
}
console.attachToProcess(handler);
final DefaultExecutionResult result = new DefaultExecutionResult(console, handler);
if (rerunFailedTestsAction != null) {
result.setRestartActions(rerunFailedTestsAction);
}
return result;
}