Search in sources :

Example 1 with GeneralTestEventsProcessor

use of com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor in project buck by facebook.

the class BuckToGeneralTestEventsConverter method consumeTestRunComplete.

@Override
public void consumeTestRunComplete(long timestamp) {
    mConnection.disconnect();
    myHandler.detachProcess();
    final GeneralTestEventsProcessor processor = getProcessor();
    if (processor == null) {
        return;
    }
    processor.onFinishTesting();
}
Also used : GeneralTestEventsProcessor(com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor)

Example 2 with GeneralTestEventsProcessor

use of com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor in project buck by facebook.

the class BuckToGeneralTestEventsConverter method consumeCompilerError.

@Override
public void consumeCompilerError(String target, long timestamp, String error, ImmutableSet<String> suggestions) {
    final GeneralTestEventsProcessor processor = getProcessor();
    if (processor != null) {
        processor.onUncapturedOutput("Build failed at " + DateFormatUtil.formatTimeWithSeconds(new Date(timestamp)) + "\n", ProcessOutputTypes.STDOUT);
    }
    mConnection.disconnect();
    myHandler.detachProcess();
}
Also used : GeneralTestEventsProcessor(com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor) Date(java.util.Date)

Example 3 with GeneralTestEventsProcessor

use of com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor in project buck by facebook.

the class BuckToGeneralTestEventsConverter method consumeTestResultsAvailable.

@Override
public void consumeTestResultsAvailable(long timestamp, TestResults testResults) {
    final GeneralTestEventsProcessor processor = getProcessor();
    if (processor == null) {
        return;
    }
    for (TestCaseSummary suite : testResults.getTestCases()) {
        if (suite.getTestResults().isEmpty()) {
            continue;
        }
        final String locationUrl = null;
        processor.onSuiteStarted(new TestSuiteStartedEvent(suite.getTestCaseName(), locationUrl));
        for (TestResultsSummary test : suite.getTestResults()) {
            final String testName = test.getTestName();
            processor.onTestStarted(new TestStartedEvent(testName, null));
            final String stdOut = test.getStdOut();
            if (stdOut != null) {
                processor.onTestOutput(new TestOutputEvent(testName, stdOut, true));
            }
            final String stdErr = test.getStdErr();
            if (stdErr != null) {
                processor.onTestOutput(new TestOutputEvent(testName, stdErr, false));
            }
            if (test.getType() == ResultType.FAILURE) {
                processor.onTestFailure(new TestFailedEvent(testName, "", test.getStacktrace(), true, null, null));
            } else {
                processor.onTestFinished(new TestFinishedEvent(testName, test.getTime()));
            }
        }
        processor.onSuiteFinished(new TestSuiteFinishedEvent(suite.getTestCaseName()));
    }
}
Also used : TestStartedEvent(com.intellij.execution.testframework.sm.runner.events.TestStartedEvent) GeneralTestEventsProcessor(com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor) TestOutputEvent(com.intellij.execution.testframework.sm.runner.events.TestOutputEvent) TestFinishedEvent(com.intellij.execution.testframework.sm.runner.events.TestFinishedEvent) TestSuiteStartedEvent(com.intellij.execution.testframework.sm.runner.events.TestSuiteStartedEvent) TestCaseSummary(com.facebook.buck.intellij.ideabuck.ws.buckevents.parts.TestCaseSummary) TestSuiteFinishedEvent(com.intellij.execution.testframework.sm.runner.events.TestSuiteFinishedEvent) TestResultsSummary(com.facebook.buck.intellij.ideabuck.ws.buckevents.parts.TestResultsSummary) TestFailedEvent(com.intellij.execution.testframework.sm.runner.events.TestFailedEvent)

Example 4 with GeneralTestEventsProcessor

use of com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor in project buck by facebook.

the class BuckToGeneralTestEventsConverter method consumeBuildStart.

@Override
public void consumeBuildStart(long timestamp) {
    final GeneralTestEventsProcessor processor = getProcessor();
    if (processor == null) {
        return;
    }
    processor.onUncapturedOutput("Build started at " + DateFormatUtil.formatTimeWithSeconds(new Date(timestamp)) + "\n", ProcessOutputTypes.STDOUT);
}
Also used : GeneralTestEventsProcessor(com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor) Date(java.util.Date)

Example 5 with GeneralTestEventsProcessor

use of com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor in project buck by facebook.

the class BuckToGeneralTestEventsConverter method consumeBuildEnd.

@Override
public void consumeBuildEnd(long timestamp) {
    final GeneralTestEventsProcessor processor = getProcessor();
    if (processor == null) {
        return;
    }
    processor.onUncapturedOutput("Build finished at " + DateFormatUtil.formatTimeWithSeconds(new Date(timestamp)) + "\n", ProcessOutputTypes.STDOUT);
}
Also used : GeneralTestEventsProcessor(com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor) Date(java.util.Date)

Aggregations

GeneralTestEventsProcessor (com.intellij.execution.testframework.sm.runner.GeneralTestEventsProcessor)7 Date (java.util.Date)4 TestFinishedEvent (com.intellij.execution.testframework.sm.runner.events.TestFinishedEvent)2 TestStartedEvent (com.intellij.execution.testframework.sm.runner.events.TestStartedEvent)2 TestSuiteFinishedEvent (com.intellij.execution.testframework.sm.runner.events.TestSuiteFinishedEvent)2 TestSuiteStartedEvent (com.intellij.execution.testframework.sm.runner.events.TestSuiteStartedEvent)2 TestCaseSummary (com.facebook.buck.intellij.ideabuck.ws.buckevents.parts.TestCaseSummary)1 TestResultsSummary (com.facebook.buck.intellij.ideabuck.ws.buckevents.parts.TestResultsSummary)1 TestFailedEvent (com.intellij.execution.testframework.sm.runner.events.TestFailedEvent)1 TestOutputEvent (com.intellij.execution.testframework.sm.runner.events.TestOutputEvent)1 TestSuiteStarted (jetbrains.buildServer.messages.serviceMessages.TestSuiteStarted)1