本文整理汇总了Java中com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil.createConsole方法的典型用法代码示例。如果您正苦于以下问题:Java SMTestRunnerConnectionUtil.createConsole方法的具体用法?Java SMTestRunnerConnectionUtil.createConsole怎么用?Java SMTestRunnerConnectionUtil.createConsole使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil
的用法示例。
在下文中一共展示了SMTestRunnerConnectionUtil.createConsole方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConsoleView
import com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil; //导入方法依赖的package包/类
public static SMTRunnerConsoleView getConsoleView(
Project project,
BlazeCommandRunConfiguration configuration,
Executor executor,
BlazeTestUiSession testUiSession) {
SMTRunnerConsoleProperties properties =
new BlazeTestConsoleProperties(configuration, executor, testUiSession);
SMTRunnerConsoleView console =
(SMTRunnerConsoleView)
SMTestRunnerConnectionUtil.createConsole(BLAZE_FRAMEWORK, properties);
Disposer.register(project, console);
console
.getResultsViewer()
.getTreeView()
.getSelectionModel()
.setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
return console;
}
示例2: createConsole
import com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil; //导入方法依赖的package包/类
public static ConsoleView createConsole(Project project, ProcessHandler processHandler, ExecutionEnvironment executionEnvironment, TesterTestLocator locationProvider) {
TesterRunConfiguration profile = (TesterRunConfiguration) executionEnvironment.getRunProfile();
TesterConsoleProperties properties = new TesterConsoleProperties(profile, executionEnvironment.getExecutor(), locationProvider);
properties.addStackTraceFilter(new XdebugCallStackFilter(project, locationProvider.getPathMapper()));
BaseTestsOutputConsoleView testsOutputConsoleView = SMTestRunnerConnectionUtil.createConsole("Nette Tester", properties);
testsOutputConsoleView.addMessageFilter(new TesterStackTraceFilter(project, locationProvider.getPathMapper()));
testsOutputConsoleView.attachToProcess(processHandler);
Disposer.register(project, testsOutputConsoleView);
return testsOutputConsoleView;
}
示例3: execute
import com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil; //导入方法依赖的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.sm.SMTestRunnerConnectionUtil; //导入方法依赖的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;
}
示例5: createRunState
import com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil; //导入方法依赖的package包/类
@NotNull
@Override
protected NodeJSRunState createRunState(@NotNull Module module,
@NotNull Sdk targetSdk,
@NotNull final Executor executor,
@NotNull final ExecutionEnvironment executionEnvironment) throws ExecutionException
{
VirtualFile mocha = NpmRunUtil.findNpmModule(module, MochaPsiElementUtil.MOCHA);
if(mocha == null)
{
throw new ExecutionException("'mocha' module is not installed");
}
VirtualFile fileOrDirectory = getFileOrDirectory();
if(fileOrDirectory == null)
{
throw new ExecutionException((myTargetType == TargetType.DIRECTORY ? "Directory" : "File") + " is not set");
}
NodeJSRunState state = new NodeJSRunState(module, targetSdk, this)
{
@NotNull
@Override
public ConsoleView createConsole(OSProcessHandler processHandler)
{
SMTRunnerConsoleProperties testConsoleProperties = new SMTRunnerConsoleProperties(MochaConfiguration.this, "Mocha", executor);
testConsoleProperties.setIdBasedTestTree(true);
testConsoleProperties.setIfUndefined(TestConsoleProperties.HIDE_PASSED_TESTS, false);
return SMTestRunnerConnectionUtil.createConsole("Mocha", testConsoleProperties);
}
};
state.addArgument(mocha.getPath() + "/bin/_mocha");
File pluginPath = PluginManager.getPluginPath(MochaConfiguration.class);
File mochaReporter = new File(pluginPath, "mocha-consulo");
if(mochaReporter.exists())
{
state.addArgument("--reporter");
state.addArgument(new File(mochaReporter, "lib/mochaIntellijReporter.js").getPath());
state.addArgument("--ui");
state.addArgument("bdd");
}
switch(myTargetType)
{
case DIRECTORY:
state.addArgument("--recursive");
state.addArgument(getDirectoryPath());
break;
case FILE:
state.addArgument(getFilePath());
break;
}
return state;
}