com.intellij.execution.testframework.TestConsoleProperties Java Examples

The following examples show how to use com.intellij.execution.testframework.TestConsoleProperties. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TrackCoverageAction.java    From consulo with Apache License 2.0 6 votes vote down vote up
public void valueChanged(final TreeSelectionEvent e) {
  if (myUpdateCoverageAlarm.isDisposed()) return;
  if (!TestConsoleProperties.TRACK_CODE_COVERAGE.value(myModel.getProperties()) || !isEnabled()) return;
  myUpdateCoverageAlarm.cancelAllRequests();
  final Project project = myModel.getProperties().getProject();
  final CoverageDataManager coverageDataManager = CoverageDataManager.getInstance(project);
  final CoverageSuitesBundle currentSuite = coverageDataManager.getCurrentSuitesBundle();
  if (currentSuite != null) {
    if (ApplicationManager.getApplication().isDispatchThread()) {
      myUpdateCoverageAlarm.addRequest(new Runnable() {
        public void run() {
          selectSubCoverage();
        }
      }, 300);
    } else {
      if (coverageDataManager.isSubCoverageActive()) coverageDataManager.restoreMergedCoverage(currentSuite);
    }
  }
}
 
Example #2
Source File: AbstractTestTreeBuilder.java    From consulo with Apache License 2.0 6 votes vote down vote up
public void setStatisticsComparator(TestConsoleProperties properties, boolean sortByStatistics) {
  if (!sortByStatistics) {
    setTestsComparator(TestConsoleProperties.SORT_ALPHABETICALLY.value(properties));
  }
  else {
    setNodeDescriptorComparator(new Comparator<NodeDescriptor>() {
      @Override
      public int compare(NodeDescriptor o1, NodeDescriptor o2) {
        if (o1.getParentDescriptor() == o2.getParentDescriptor() &&
            o1 instanceof BaseTestProxyNodeDescriptor &&
            o2 instanceof BaseTestProxyNodeDescriptor) {
          final Long d1 = ((BaseTestProxyNodeDescriptor)o1).getElement().getDuration();
          final Long d2 = ((BaseTestProxyNodeDescriptor)o2).getElement().getDuration();
          return Comparing.compare(d2, d1);
        }
        return 0;
      }
    });
  }
  queueUpdate();
}
 
Example #3
Source File: TestResultsPanel.java    From consulo with Apache License 2.0 6 votes vote down vote up
protected TestResultsPanel(@Nonnull JComponent console, AnAction[] consoleActions, TestConsoleProperties properties,
                           @Nonnull String splitterProportionProperty, float splitterDefaultProportion) {
  super(new BorderLayout(0,1));
  myConsole = console;
  myConsoleActions = consoleActions;
  myProperties = properties;
  mySplitterProportionProperty = splitterProportionProperty;
  mySplitterDefaultProportion = splitterDefaultProportion;
  myStatisticsSplitterProportionProperty = mySplitterProportionProperty + "_Statistics";
  final ToolWindowManagerListener listener = new ToolWindowManagerListener() {
    @Override
    public void stateChanged() {
      final boolean splitVertically = splitVertically();
      myStatusLine.setPreferredSize(splitVertically);
      mySplitter.setOrientation(splitVertically);
      revalidate();
      repaint();
    }
  };
  ToolWindowManagerEx.getInstanceEx(properties.getProject()).addToolWindowManagerListener(listener, this);
}
 
Example #4
Source File: TestFrameworkActions.java    From consulo with Apache License 2.0 6 votes vote down vote up
public static void addPropertyListener(final AbstractProperty<Boolean> property,
                                       final TestFrameworkPropertyListener<Boolean> propertyListener,
                                       final TestFrameworkRunningModel model,
                                       final boolean sendValue) {
  final TestConsoleProperties properties = model.getProperties();
  if (sendValue) {
    properties.addListenerAndSendValue(property, propertyListener);
  }
  else {
    properties.addListener(property, propertyListener);
  }
  Disposer.register(model, new Disposable() {
    public void dispose() {
      properties.removeListener(property, propertyListener);
    }
  });
}
 
Example #5
Source File: SmRunnerUtils.java    From intellij with Apache License 2.0 6 votes vote down vote up
@Nullable
public static AbstractRerunFailedTestsAction createRerunFailedTestsAction(
    DefaultExecutionResult result) {
  ExecutionConsole console = result.getExecutionConsole();
  if (!(console instanceof SMTRunnerConsoleView)) {
    return null;
  }
  SMTRunnerConsoleView smConsole = (SMTRunnerConsoleView) console;
  TestConsoleProperties consoleProperties = smConsole.getProperties();
  if (!(consoleProperties instanceof BlazeTestConsoleProperties)) {
    return null;
  }
  BlazeTestConsoleProperties properties = (BlazeTestConsoleProperties) consoleProperties;
  AbstractRerunFailedTestsAction action = properties.createRerunFailedTestsAction(smConsole);
  if (action != null) {
    action.init(properties);
    action.setModelProvider(smConsole::getResultsViewer);
  }
  return action;
}
 
Example #6
Source File: GeneralToSMTRunnerEventsConvertorTest.java    From consulo with Apache License 2.0 6 votes vote down vote up
@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();
}
 
Example #7
Source File: SMTRunnerConsoleTest.java    From consulo with Apache License 2.0 6 votes vote down vote up
@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.getRunnerSettings(), environment.getConfigurationSettings());
  myConsole.initUI();
  myResultsViewer = myConsole.getResultsViewer();
  myRootSuite = myResultsViewer.getTestsRootNode();
  myEventsProcessor = new GeneralToSMTRunnerEventsConvertor(getProject(), myResultsViewer.getTestsRootNode(), "SMTestFramework");

  myEventsProcessor.onStartTesting();
}
 
Example #8
Source File: SMTestRunnerResultsFormTest.java    From consulo with Apache License 2.0 6 votes vote down vote up
public void testRuby_1767() throws InterruptedException {
  TestConsoleProperties.HIDE_PASSED_TESTS.set(myConsoleProperties, true);

  myEventsProcessor.onStartTesting();
  myEventsProcessor.onSuiteStarted(new TestSuiteStartedEvent("suite", null));
  myResultsViewer.performUpdate();

  myEventsProcessor.onTestStarted(new TestStartedEvent("test_failed", null));
  myResultsViewer.performUpdate();
  myEventsProcessor.onTestFailure(new TestFailedEvent("test_failed", "", "", false, null, null));
  myResultsViewer.performUpdate();
  myEventsProcessor.onTestFinished(new TestFinishedEvent("test_failed", 10l));
  myResultsViewer.performUpdate();

  myEventsProcessor.onTestStarted(new TestStartedEvent("test", null));
  myResultsViewer.performUpdate();
  assertEquals(2, myTreeModel.getChildCount(myTreeModel.getChild(myTreeModel.getRoot(), 0)));

  myEventsProcessor.onTestFinished(new TestFinishedEvent("test", 10l));
  assertEquals(2, myTreeModel.getChildCount(myTreeModel.getChild(myTreeModel.getRoot(), 0)));

  myEventsProcessor.onSuiteFinished(new TestSuiteFinishedEvent("suite"));
  myEventsProcessor.onFinishTesting();

  assertEquals(1, myTreeModel.getChildCount(myTreeModel.getChild(myTreeModel.getRoot(), 0)));
}
 
Example #9
Source File: SMTestRunnerResultsFormTest.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
protected void setUp() throws Exception {
  super.setUp();

  myConsoleProperties = createConsoleProperties();
  TestConsoleProperties.HIDE_PASSED_TESTS.set(myConsoleProperties, false);
  TestConsoleProperties.OPEN_FAILURE_LINE.set(myConsoleProperties, false);
  TestConsoleProperties.SCROLL_TO_SOURCE.set(myConsoleProperties, false);
  TestConsoleProperties.SELECT_FIRST_DEFECT.set(myConsoleProperties, false);
  TestConsoleProperties.TRACK_RUNNING_TEST.set(myConsoleProperties, false);

  final ExecutionEnvironment environment = new ExecutionEnvironment();

  myConsole = new SMTRunnerConsoleView(myConsoleProperties);
  myConsole.initUI();
  myResultsViewer = myConsole.getResultsViewer();
  myTestsRootNode = myResultsViewer.getTestsRootNode();
  myEventsProcessor = new GeneralToSMTRunnerEventsConvertor(myConsoleProperties.getProject(), myResultsViewer.getTestsRootNode(), "SMTestFramework");
  myEventsProcessor.addEventsListener(myResultsViewer);
  myTreeModel = myResultsViewer.getTreeView().getModel();
}
 
Example #10
Source File: SMTRunnerUIActionsHandlerTest.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
protected void setUp() throws Exception {
  super.setUp();

  myProperties = createConsoleProperties();
  myResultsViewer = new MockTestResultsViewer(myProperties, mySuite) {
    @Override
    public void selectAndNotify(@javax.annotation.Nullable final AbstractTestProxy proxy) {
      super.selectAndNotify(proxy);
      mySelectedTestProxy = proxy;
    }
  };

  myUIActionsHandler = new SMTRunnerUIActionsHandler(myProperties);

  TestConsoleProperties.HIDE_PASSED_TESTS.set(myProperties, false);
  TestConsoleProperties.OPEN_FAILURE_LINE.set(myProperties, false);
  TestConsoleProperties.SCROLL_TO_SOURCE.set(myProperties, false);
  TestConsoleProperties.SELECT_FIRST_DEFECT.set(myProperties, false);
  TestConsoleProperties.TRACK_RUNNING_TEST.set(myProperties, false);
}
 
Example #11
Source File: SMTRunnerUIActionsHandlerTest.java    From consulo with Apache License 2.0 6 votes vote down vote up
public void testSelectFirstDefect_Priority_Pending() {
  // Priority: error -> failure
  TestConsoleProperties.SELECT_FIRST_DEFECT.set(myProperties, true);
  mySuite.setStarted();

  final SMTestProxy testsSuite = createSuiteProxy("my suite", mySuite);
  testsSuite.setStarted();

  // pending test
  final SMTestProxy testPending = createTestProxy("testPending", testsSuite);
  testPending.setStarted();
  myUIActionsHandler.onTestNodeAdded(myResultsViewer, testPending);
  testPending.setTestIgnored("", "");

  // finish suite
  testsSuite.setFinished();
  assertNull(mySelectedTestProxy);

  //testing finished
  mySuite.setFinished();
  assertNull(mySelectedTestProxy);

  myUIActionsHandler.onTestingFinished(myResultsViewer);
  // pending tests shouldn't be considered as errors/failures
  assertNull(mySelectedTestProxy);
}
 
Example #12
Source File: SMTestRunnerConnectionUtil.java    From consulo with Apache License 2.0 6 votes vote down vote up
/**
 * @deprecated use {@link #initConsoleView(SMTRunnerConsoleView, String)} (to be removed in IDEA 16)
 */
@SuppressWarnings({"unused", "deprecation"})
public static void initConsoleView(@Nonnull final SMTRunnerConsoleView consoleView,
                                   @Nonnull final String testFrameworkName,
                                   @javax.annotation.Nullable final TestLocationProvider locator,
                                   final boolean idBasedTreeConstruction,
                                   @Nullable final TestProxyFilterProvider filterProvider) {
  consoleView.addAttachToProcessListener(new AttachToProcessListener() {
    @Override
    public void onAttachToProcess(@Nonnull ProcessHandler processHandler) {
      TestConsoleProperties properties = consoleView.getProperties();

      SMTestLocator testLocator = new CompositeTestLocationProvider(locator);

      TestProxyPrinterProvider printerProvider = null;
      if (filterProvider != null) {
        printerProvider = new TestProxyPrinterProvider(consoleView, filterProvider);
      }

      SMTestRunnerResultsForm resultsForm = consoleView.getResultsViewer();
      attachEventsProcessors(properties, resultsForm, resultsForm.getStatisticsPane(), processHandler, testFrameworkName, testLocator, idBasedTreeConstruction, printerProvider);
    }
  });
  consoleView.setHelpId("reference.runToolWindow.testResultsTab");
  consoleView.initUI();
}
 
Example #13
Source File: TestsPresentationUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nullable
private static Image getIcon(final SMTestProxy testProxy,
                             final TestConsoleProperties consoleProperties) {
  final TestStateInfo.Magnitude magnitude = testProxy.getMagnitudeInfo();

  final boolean hasErrors = testProxy.hasErrors();

  switch (magnitude) {
    case ERROR_INDEX:
      return ERROR_ICON;
    case FAILED_INDEX:
      return hasErrors ? FAILED_E_ICON : FAILED_ICON;
    case IGNORED_INDEX:
      return hasErrors ? IGNORED_E_ICON : IGNORED_ICON;
    case NOT_RUN_INDEX:
      return NOT_RAN;
    case COMPLETE_INDEX:
    case PASSED_INDEX:
      return hasErrors ? PASSED_E_ICON : PASSED_ICON;
    case RUNNING_INDEX:
      if (consoleProperties.isPaused()) {
        return hasErrors ? PAUSED_E_ICON : AllIcons.RunConfigurations.TestPaused;
      }
      else {
        final int frameIndex = TestsProgressAnimator.getCurrentFrameIndex();
        return hasErrors ? FRAMES_E[frameIndex] : TestsProgressAnimator.FRAMES[frameIndex];
      }
    case SKIPPED_INDEX:
      return hasErrors ? SKIPPED_E_ICON : SKIPPED_ICON;
    case TERMINATED_INDEX:
      return hasErrors ? TERMINATED_E_ICON : TERMINATED_ICON;
  }
  return null;
}
 
Example #14
Source File: ThriftTestExecutionUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
public static BaseTestsOutputConsoleView createConsoleWithCustomLocator(@Nonnull final String testFrameworkName,
                                                                        @Nonnull final TestConsoleProperties consoleProperties,
                                                                        @Nonnull ExecutionEnvironment environment,
                                                                        @Nonnull ThriftTestHandlerFactory factory,
                                                                        @javax.annotation.Nullable final TestLocationProvider locator) {
  return createConsoleWithCustomLocator(testFrameworkName, consoleProperties, environment, locator, factory, null);
}
 
Example #15
Source File: DartTestEventsConverterZ.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public DartTestEventsConverterZ(@NotNull final String testFrameworkName,
                                @NotNull final TestConsoleProperties consoleProperties,
                                @NotNull final DartUrlResolver urlResolver) {
  super(testFrameworkName, consoleProperties);
  myUrlResolver = urlResolver;
  myTestIdToTimestamp = new TIntLongHashMap();
  myTestData = new HashMap<>();
  myGroupData = new HashMap<>();
  mySuiteData = new HashMap<>();
}
 
Example #16
Source File: SMTRunnerToolbarPanel.java    From consulo with Apache License 2.0 5 votes vote down vote up
public SMTRunnerToolbarPanel(final TestConsoleProperties properties,
                             final TestFrameworkRunningModel model, JComponent contentPane) {
  super(properties, contentPane);
  //TODO rerun failed test
  //TODO coverage
  setModel(model);
}
 
Example #17
Source File: SMTestRunnerConnectionUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
/**
 * @deprecated use {@link #createConsole(String, TestConsoleProperties)} (to be removed in IDEA 16)
 */
@SuppressWarnings({"unused", "deprecation"})
public static ConsoleView createConsole(@Nonnull String testFrameworkName, @Nonnull CommandLineState commandLineState, @Nonnull ModuleRunConfiguration config, @Nonnull Executor executor)
        throws ExecutionException {
  TestConsoleProperties consoleProperties = new SMTRunnerConsoleProperties(config, testFrameworkName, executor);
  return createConsole(testFrameworkName, consoleProperties, commandLineState.getEnvironment());
}
 
Example #18
Source File: SMTestRunnerConnectionUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
public static void initConsoleView(@Nonnull final SMTRunnerConsoleView consoleView, @Nonnull final String testFrameworkName) {
  consoleView.addAttachToProcessListener(new AttachToProcessListener() {
    @Override
    public void onAttachToProcess(@Nonnull ProcessHandler processHandler) {
      TestConsoleProperties properties = consoleView.getProperties();

      TestProxyPrinterProvider printerProvider = null;
      if (properties instanceof SMTRunnerConsoleProperties) {
        TestProxyFilterProvider filterProvider = ((SMTRunnerConsoleProperties)properties).getFilterProvider();
        if (filterProvider != null) {
          printerProvider = new TestProxyPrinterProvider(consoleView, filterProvider);
        }
      }

      SMTestLocator testLocator = FileUrlProvider.INSTANCE;
      if (properties instanceof SMTRunnerConsoleProperties) {
        SMTestLocator customLocator = ((SMTRunnerConsoleProperties)properties).getTestLocator();
        if (customLocator != null) {
          testLocator = new CombinedTestLocator(customLocator);
        }
      }

      boolean idBasedTestTree = false;
      if (properties instanceof SMTRunnerConsoleProperties) {
        idBasedTestTree = ((SMTRunnerConsoleProperties)properties).isIdBasedTestTree();
      }

      SMTestRunnerResultsForm resultsForm = consoleView.getResultsViewer();
      attachEventsProcessors(properties, resultsForm, resultsForm.getStatisticsPane(), processHandler, testFrameworkName, testLocator, idBasedTestTree, printerProvider);
    }
  });
  consoleView.setHelpId("reference.runToolWindow.testResultsTab");
  consoleView.initUI();
}
 
Example #19
Source File: ThriftTestExecutionUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
public static SMTRunnerConsoleView createConsoleWithCustomLocator(@Nonnull final String testFrameworkName,
                                                                  @Nonnull final TestConsoleProperties consoleProperties,
                                                                  ExecutionEnvironment environment,
                                                                  @javax.annotation.Nullable final TestLocationProvider locator,
                                                                  final ThriftTestHandlerFactory factory,
                                                                  @Nullable final TestProxyFilterProvider filterProvider) {
  String splitterPropertyName = SMTestRunnerConnectionUtil.getSplitterPropertyName(testFrameworkName);
  SMTRunnerConsoleView consoleView = new SMTRunnerConsoleView(consoleProperties, splitterPropertyName);
  initConsoleView(consoleView, testFrameworkName, locator, factory, filterProvider);
  return consoleView;
}
 
Example #20
Source File: SMTestRunnerConnectionUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
public static BaseTestsOutputConsoleView createConsole(@Nonnull String testFrameworkName, @Nonnull TestConsoleProperties consoleProperties) {
  String splitterPropertyName = getSplitterPropertyName(testFrameworkName);
  SMTRunnerConsoleView consoleView = new SMTRunnerConsoleView(consoleProperties, splitterPropertyName);
  initConsoleView(consoleView, testFrameworkName);
  return consoleView;
}
 
Example #21
Source File: SMTRunnerUIActionsHandler.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void onTestingFinished(final TestResultsViewer sender) {
  // select first defect at the end (my be TRACK_RUNNING_TEST was enabled and affects on the fly selection)
  final SMTestProxy testsRootNode = sender.getTestsRootNode();
  if (TestConsoleProperties.SELECT_FIRST_DEFECT.value(myConsoleProperties)) {
    final AbstractTestProxy firstDefect;

    // defects priority:
    // ERROR -> FAILURE -> GENERAL DEFECTIVE NODE
    final List<SMTestProxy> allTests = testsRootNode.getAllTests();
    final AbstractTestProxy firstError = ProxyFilters.ERROR_LEAF.detectIn(allTests);
    if (firstError != null) {
      firstDefect = firstError;
    }
    else {
      final AbstractTestProxy firstFailure = ProxyFilters.FAILURE_LEAF.detectIn(allTests);
      if (firstFailure != null) {
        firstDefect = firstFailure;
      }
      else {
        firstDefect = null;
      }
    }

    // select if detected
    if (firstDefect != null) {
      sender.selectAndNotify(firstDefect);
    }
  }
}
 
Example #22
Source File: ImportedToGeneralTestEventsConverter.java    From consulo with Apache License 2.0 5 votes vote down vote up
public ImportedToGeneralTestEventsConverter(@Nonnull String testFrameworkName,
                                            @Nonnull TestConsoleProperties consoleProperties,
                                            @Nonnull File file,
                                            @Nonnull ProcessHandler handler) {
  super(testFrameworkName, consoleProperties);
  myConsoleProperties = consoleProperties;
  myFile = file;
  myHandler = handler;
}
 
Example #23
Source File: BaseSMTRunnerTestCase.java    From consulo with Apache License 2.0 5 votes vote down vote up
protected TestConsoleProperties createConsoleProperties() {
  final RuntimeConfiguration runConfiguration = createRunConfiguration();

  final TestConsoleProperties consoleProperties = new SMTRunnerConsoleProperties(runConfiguration, "SMRunnerTests", DefaultDebugExecutor.getDebugExecutorInstance());
  TestConsoleProperties.HIDE_PASSED_TESTS.set(consoleProperties, false);
  
  return consoleProperties;
}
 
Example #24
Source File: SMTRunnerConsoleTest.java    From consulo with Apache License 2.0 5 votes vote down vote up
private MyConsoleView(final TestConsoleProperties consoleProperties, final RunnerSettings runnerSettings,
                      final ConfigurationPerRunnerSettings configurationPerRunnerSettings) {
  super(consoleProperties, "SMTRunnerConsoleTest");

  myTestsOutputConsolePrinter = new TestsOutputConsolePrinter(MyConsoleView.this, consoleProperties, null) {
    @Override
    public void print(final String text, final ConsoleViewContentType contentType) {
      myMockResettablePrinter.print(text, contentType);
    }
  };
}
 
Example #25
Source File: SMTRunnerUIActionsHandlerTest.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void testSelectFirstDefect_Priority_Failure() {
  // Priority: error -> failure
  TestConsoleProperties.SELECT_FIRST_DEFECT.set(myProperties, true);
  mySuite.setStarted();

  final SMTestProxy testsSuite = createSuiteProxy("my suite", mySuite);
  testsSuite.setStarted();

  // pending test
  final SMTestProxy testPending = createTestProxy("testPending", testsSuite);
  testPending.setStarted();
  myUIActionsHandler.onTestNodeAdded(myResultsViewer, testPending);
  testPending.setTestIgnored("", "");

  //failed test
  final SMTestProxy testFailed = createTestProxy("testFailed", testsSuite);
  testFailed.setStarted();
  myUIActionsHandler.onTestNodeAdded(myResultsViewer, testFailed);
  testFailed.setTestFailed("", "", false);

  // Second failed test just to check that first failed will be selected
  final SMTestProxy testFailed2 = createTestProxy("testFailed2", testsSuite);
  testFailed2.setStarted();
  myUIActionsHandler.onTestNodeAdded(myResultsViewer, testFailed2);
  testFailed2.setTestFailed("", "", false);

  // finish suite
  testsSuite.setFinished();
  assertNull(mySelectedTestProxy);

  //testing finished
  mySuite.setFinished();
  assertNull(mySelectedTestProxy);

  myUIActionsHandler.onTestingFinished(myResultsViewer);
  assertEquals(testFailed, mySelectedTestProxy);
}
 
Example #26
Source File: SMTRunnerStatisticsPanelTest.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
protected void setUp() throws Exception {
  super.setUp();

  myRootSuite = createSuiteProxy("root");

  final TestConsoleProperties consoleProperties = createConsoleProperties();
  myResultsForm = new SMTestRunnerResultsForm(new JLabel(), consoleProperties);
  myResultsForm.initUI();
  myStatisticsPanel = myResultsForm.getStatisticsPane();
  myTestEventsListener = myStatisticsPanel.createTestEventsListener();
}
 
Example #27
Source File: GeneralToSMTRunnerEventsConvertorTest.java    From consulo with Apache License 2.0 5 votes vote down vote up
private MyConsoleView(final TestConsoleProperties consoleProperties, final ExecutionEnvironment environment) {
  super(consoleProperties);

  myTestsOutputConsolePrinter = new TestsOutputConsolePrinter(MyConsoleView.this, consoleProperties, null) {
    @Override
    public void print(final String text, final ConsoleViewContentType contentType) {
      myMockResettablePrinter.print(text, contentType);
    }
  };
}
 
Example #28
Source File: AbstractRerunFailedTestsAction.java    From consulo with Apache License 2.0 5 votes vote down vote up
@TestOnly
public static Filter<?> getFailuresFilter(TestConsoleProperties consoleProperties) {
  if (TestConsoleProperties.INCLUDE_NON_STARTED_IN_RERUN_FAILED.value(consoleProperties)) {
    return Filter.NOT_PASSED.or(Filter.FAILED_OR_INTERRUPTED).and(Filter.IGNORED.not());
  }
  return Filter.FAILED_OR_INTERRUPTED.and(Filter.IGNORED.not());
}
 
Example #29
Source File: TestFrameworkActions.java    From consulo with Apache License 2.0 5 votes vote down vote up
private static Filter getFilter(TestConsoleProperties properties) {
  final boolean shouldFilterPassed = TestConsoleProperties.HIDE_PASSED_TESTS.value(properties);
  final Filter hidePassedFilter = shouldFilterPassed ? Filter.NOT_PASSED.or(Filter.DEFECT) : Filter.NO_FILTER;

  final boolean shouldFilterIgnored = TestConsoleProperties.HIDE_IGNORED_TEST.value(properties);
  final Filter hideIgnoredFilter = shouldFilterIgnored ? Filter.IGNORED.not() : Filter.NO_FILTER;
  return hidePassedFilter.and(hideIgnoredFilter);
}
 
Example #30
Source File: TrackCoverageAction.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void setSelected(final AnActionEvent e, final boolean state) {
  super.setSelected(e, state);
  if (!TestConsoleProperties.TRACK_CODE_COVERAGE.value(myProperties)) {
    restoreMergedCoverage();
  } else {
    selectSubCoverage();
  }
}