Search in sources :

Example 1 with TestConsoleProperties

use of com.intellij.execution.testframework.TestConsoleProperties in project buck by facebook.

the class TestExecutionState method execute.

@Nullable
@Override
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
    final ProcessHandler processHandler = runBuildCommand(executor);
    final TestConsoleProperties properties = new BuckTestConsoleProperties(processHandler, mProject, mConfiguration, "Buck test", executor);
    final ConsoleView console = SMTestRunnerConnectionUtil.createAndAttachConsole("buck test", processHandler, properties);
    return new DefaultExecutionResult(console, processHandler, AnAction.EMPTY_ARRAY);
}
Also used : DefaultExecutionResult(com.intellij.execution.DefaultExecutionResult) ConsoleView(com.intellij.execution.ui.ConsoleView) OSProcessHandler(com.intellij.execution.process.OSProcessHandler) ProcessHandler(com.intellij.execution.process.ProcessHandler) TestConsoleProperties(com.intellij.execution.testframework.TestConsoleProperties) Nullable(org.jetbrains.annotations.Nullable)

Example 2 with TestConsoleProperties

use of com.intellij.execution.testframework.TestConsoleProperties in project intellij-elixir by KronicDeth.

the class MixExUnitRunningState method createAndAttachConsole.

/**
   * Unifies the interface for {@code SMTestRunnerConnectionUtil.createAndAttachConsole} between 141 and later releases
   */
private ConsoleView createAndAttachConsole(@NotNull String testFrameworkName, @NotNull ProcessHandler processHandler, @NotNull TestConsoleProperties consoleProperties) throws ExecutionException {
    Class<SMTestRunnerConnectionUtil> klass = SMTestRunnerConnectionUtil.class;
    ConsoleView consoleView = null;
    try {
        Method createAndAttachConsole = klass.getMethod("createAndAttachConsole", String.class, ProcessHandler.class, TestConsoleProperties.class);
        try {
            consoleView = (ConsoleView) createAndAttachConsole.invoke(null, testFrameworkName, processHandler, consoleProperties);
        } catch (IllegalAccessException | InvocationTargetException e) {
            LOGGER.error(e);
        }
    } catch (NoSuchMethodException noSuchCreateAndAttachConsole3Method) {
        try {
            Method createAndAttachConsole = klass.getMethod("createAndAttachConsole", String.class, ProcessHandler.class, TestConsoleProperties.class, ExecutionEnvironment.class);
            try {
                consoleView = (ConsoleView) createAndAttachConsole.invoke(null, testFrameworkName, processHandler, consoleProperties, getEnvironment());
            } catch (IllegalAccessException | InvocationTargetException e) {
                LOGGER.error(e);
            }
        } catch (NoSuchMethodException noSuchCreateAndAttachConsole4Method) {
            noSuchCreateAndAttachConsole4Method.printStackTrace();
        }
    }
    return consoleView;
}
Also used : ExecutionEnvironment(com.intellij.execution.runners.ExecutionEnvironment) ConsoleView(com.intellij.execution.ui.ConsoleView) SMTestRunnerConnectionUtil(com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil) ProcessHandler(com.intellij.execution.process.ProcessHandler) Method(java.lang.reflect.Method) InvocationTargetException(java.lang.reflect.InvocationTargetException) TestConsoleProperties(com.intellij.execution.testframework.TestConsoleProperties)

Example 3 with TestConsoleProperties

use of com.intellij.execution.testframework.TestConsoleProperties in project intellij-community by JetBrains.

the class GeneralToSMTRunnerEventsConvertorTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    TestConsoleProperties consoleProperties = createConsoleProperties();
    TestConsoleProperties.HIDE_PASSED_TESTS.set(consoleProperties, false);
    TestConsoleProperties.OPEN_FAILURE_LINE.set(consoleProperties, false);
    TestConsoleProperties.SCROLL_TO_SOURCE.set(consoleProperties, false);
    TestConsoleProperties.SELECT_FIRST_DEFECT.set(consoleProperties, false);
    TestConsoleProperties.TRACK_RUNNING_TEST.set(consoleProperties, false);
    final ExecutionEnvironment environment = new ExecutionEnvironment();
    myMockResettablePrinter = new MockPrinter(true);
    myConsole = new MyConsoleView(consoleProperties, environment);
    myConsole.initUI();
    myResultsViewer = myConsole.getResultsViewer();
    myEventsProcessor = new GeneralToSMTRunnerEventsConvertor(consoleProperties.getProject(), myResultsViewer.getTestsRootNode(), "SMTestFramework");
    myEventsProcessor.addEventsListener(myResultsViewer);
    myTreeModel = myResultsViewer.getTreeView().getModel();
    myEventsProcessor.onStartTesting();
}
Also used : ExecutionEnvironment(com.intellij.execution.runners.ExecutionEnvironment) MockPrinter(com.intellij.execution.testframework.sm.runner.ui.MockPrinter) TestConsoleProperties(com.intellij.execution.testframework.TestConsoleProperties)

Example 4 with TestConsoleProperties

use of com.intellij.execution.testframework.TestConsoleProperties in project intellij-community by JetBrains.

the class SMTRunnerConsoleTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    final TestConsoleProperties consoleProperties = createConsoleProperties();
    final ExecutionEnvironment environment = new ExecutionEnvironment();
    myMockResettablePrinter = new MockPrinter(true);
    myConsole = new MyConsoleView(consoleProperties, environment);
    myConsole.initUI();
    myResultsViewer = myConsole.getResultsViewer();
    myRootSuite = myResultsViewer.getTestsRootNode();
    myEventsProcessor = new GeneralToSMTRunnerEventsConvertor(consoleProperties.getProject(), myResultsViewer.getTestsRootNode(), "SMTestFramework");
    myEventsProcessor.onStartTesting();
}
Also used : ExecutionEnvironment(com.intellij.execution.runners.ExecutionEnvironment) MockPrinter(com.intellij.execution.testframework.sm.runner.ui.MockPrinter) TestConsoleProperties(com.intellij.execution.testframework.TestConsoleProperties)

Example 5 with TestConsoleProperties

use of com.intellij.execution.testframework.TestConsoleProperties in project intellij-community by JetBrains.

the class SMTestProxyTest method testNavigatable.

public void testNavigatable() {
    TestConsoleProperties properties = EasyMock.createMock(TestConsoleProperties.class);
    assertNull(mySuite.getDescriptor(null, properties));
    mySuite.addChild(mySimpleTest);
    assertNull(mySuite.getDescriptor(null, properties));
    assertNull(mySimpleTest.getDescriptor(null, properties));
}
Also used : TestConsoleProperties(com.intellij.execution.testframework.TestConsoleProperties)

Aggregations

TestConsoleProperties (com.intellij.execution.testframework.TestConsoleProperties)16 ProcessHandler (com.intellij.execution.process.ProcessHandler)5 ExecutionEnvironment (com.intellij.execution.runners.ExecutionEnvironment)4 ConsoleView (com.intellij.execution.ui.ConsoleView)4 MockPrinter (com.intellij.execution.testframework.sm.runner.ui.MockPrinter)3 NotNull (org.jetbrains.annotations.NotNull)3 DefaultExecutionResult (com.intellij.execution.DefaultExecutionResult)2 AttachToProcessListener (com.intellij.execution.testframework.sm.runner.ui.AttachToProcessListener)2 SMTestRunnerResultsForm (com.intellij.execution.testframework.sm.runner.ui.SMTestRunnerResultsForm)2 ModuleRunConfiguration (com.intellij.execution.configurations.ModuleRunConfiguration)1 RuntimeConfigurationError (com.intellij.execution.configurations.RuntimeConfigurationError)1 UrlFilter (com.intellij.execution.filters.UrlFilter)1 OSProcessHandler (com.intellij.execution.process.OSProcessHandler)1 TestFrameworkPropertyListener (com.intellij.execution.testframework.TestFrameworkPropertyListener)1 SMTestRunnerConnectionUtil (com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil)1 SMTRunnerConsoleProperties (com.intellij.execution.testframework.sm.runner.SMTRunnerConsoleProperties)1 SMTRunnerConsoleView (com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView)1 KarmaTestProxyFilterProvider (com.intellij.javascript.karma.tree.KarmaTestProxyFilterProvider)1 Disposable (com.intellij.openapi.Disposable)1 Project (com.intellij.openapi.project.Project)1