IJPL-797 intellij.platform.testRunner review internal API

GitOrigin-RevId: 290fe8b8df9d75add60b06bb7705beb227563920
This commit is contained in:
Anna Kozlova
2024-05-14 15:21:53 +02:00
committed by intellij-monorepo-bot
parent a4347f87bd
commit fd5ffab05e
24 changed files with 95 additions and 267 deletions

View File

@@ -46,7 +46,7 @@ class JvmTestDiffProvider : TestDiffProvider {
searchStacktrace.lines().forEach { line ->
lineParser.execute(line, line.length) ?: return@findExpected null
val file = lineParser.file ?: return@findExpected null
val diffProvider = TestDiffProvider.TEST_DIFF_PROVIDER_LANGUAGE_EXTENSION.forLanguage(file.language).asSafely<JvmTestDiffProvider>()
val diffProvider = TestDiffProvider.getProviderByLanguage(file.language).asSafely<JvmTestDiffProvider>()
?: return@findExpected null
val failedCall = findFailedCall(file, lineParser.info.lineNumber, expectedParam?.getContainingUMethod()) ?: return@findExpected null
expectedArgCandidates.addAll(failedCall.valueArguments.mapNotNull { diffProvider.getExpectedElement(it, expected) })

View File

@@ -2,6 +2,7 @@
package com.intellij.execution.testframework.sm.runner.ui;
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
import com.intellij.execution.ExecutionBundle;
import com.intellij.execution.TestStateStorage;
import com.intellij.execution.configurations.RunConfiguration;
import com.intellij.execution.configurations.RunProfile;
@@ -20,6 +21,7 @@ import com.intellij.execution.testframework.sm.runner.history.actions.AbstractIm
import com.intellij.execution.testframework.sm.runner.states.TestStateInfo;
import com.intellij.execution.testframework.ui.TestResultsPanel;
import com.intellij.execution.ui.ConsoleView;
import com.intellij.history.LocalHistory;
import com.intellij.ide.util.treeView.IndexComparator;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.AnAction;
@@ -85,6 +87,8 @@ public class SMTestRunnerResultsForm extends TestResultsPanel
@NonNls private static final String DEFAULT_SM_RUNNER_SPLITTER_PROPERTY = "SMTestRunner.Splitter.Proportion";
private static final Logger LOG = Logger.getInstance(SMTestRunnerResultsForm.class);
private static final Color RED = new JBColor(new Color(250, 220, 220), new Color(104, 67, 67));
private static final Color GREEN = new JBColor(new Color(220, 250, 220), new Color(44, 66, 60));
private SMTRunnerTestTreeView myTreeView;
@@ -263,7 +267,7 @@ public class SMTestRunnerResultsForm extends TestResultsPanel
myUpdateTreeRequests.cancelAllRequests();
myTreeBuilder.updateFromRoot();
LvcsHelper.addLabel(this);
addLabel(this);
if (myLastSelected == null) {
selectAndNotify(myTestsRootNode);
@@ -773,9 +777,9 @@ public class SMTestRunnerResultsForm extends TestResultsPanel
return myHistoryFileName;
}
AnAction[] getToolbarActions() { return myToolbarPanel.actionsToMerge; }
AnAction[] getToolbarActions() { return myToolbarPanel.getActionsToMerge(); }
AnAction[] getAdditionalToolbarActions() { return myToolbarPanel.additionalActionsToMerge; }
AnAction[] getAdditionalToolbarActions() { return myToolbarPanel.getAdditionalActionsToMerge(); }
@Override
@@ -784,6 +788,33 @@ public class SMTestRunnerResultsForm extends TestResultsPanel
myToolbarPanel.setVisible(false);
}
private static void addLabel(final TestFrameworkRunningModel model) {
AbstractTestProxy root = model.getRoot();
if (root.isInterrupted()) return;
TestConsoleProperties consoleProperties = model.getProperties();
String configName = consoleProperties.getConfiguration().getName();
String name;
int color;
if (root.isPassed() || root.isIgnored()) {
color = GREEN.getRGB();
name = ExecutionBundle.message("junit.running.info.tests.passed.with.test.name.label", configName);
}
else {
color = RED.getRGB();
name = ExecutionBundle.message("junit.running.info.tests.failed.with.test.name.label", configName);
}
Project project = consoleProperties.getProject();
if (project.isDisposed()) return;
LocalHistory.getInstance().putSystemLabel(project, name, color);
}
private static class MySaveHistoryTask extends Task.Backgroundable {
private final TestConsoleProperties myConsoleProperties;

View File

@@ -7,7 +7,7 @@ a:com.intellij.execution.testframework.AbstractTestProxy
- addLast(com.intellij.execution.testframework.Printable):V
- createHyperlink(java.lang.String,java.lang.String,java.lang.String,java.lang.String,Z):com.intellij.execution.testframework.stacktrace.DiffHyperlink
- dispose():V
- fireOnNewPrintable(com.intellij.execution.testframework.Printable):V
- p:fireOnNewPrintable(com.intellij.execution.testframework.Printable):V
- a:getAllTests():java.util.List
- a:getChildren():java.util.List
- a:getDescriptor(com.intellij.execution.Location,com.intellij.execution.testframework.TestConsoleProperties):com.intellij.pom.Navigatable
@@ -72,24 +72,6 @@ c:com.intellij.execution.testframework.DeferingPrinter
- print(java.lang.String,com.intellij.execution.ui.ConsoleViewContentType):V
- printAndForget(com.intellij.execution.testframework.Printer):V
- printHyperlink(java.lang.String,com.intellij.execution.filters.HyperlinkInfo):V
c:com.intellij.execution.testframework.FailedTestsNavigator
- com.intellij.ide.OccurenceNavigator
- <init>():V
- getActionUpdateThread():com.intellij.openapi.actionSystem.ActionUpdateThread
- getNextOccurenceActionName():java.lang.String
- getPreviousOccurenceActionName():java.lang.String
- goNextOccurence():com.intellij.ide.OccurenceNavigator$OccurenceInfo
- goPreviousOccurence():com.intellij.ide.OccurenceNavigator$OccurenceInfo
- hasNextOccurence():Z
- hasPreviousOccurence():Z
- setModel(com.intellij.execution.testframework.TestFrameworkRunningModel):V
pa:com.intellij.execution.testframework.FailedTestsNavigator$FailedTestInfo
- p:<init>(com.intellij.execution.testframework.FailedTestsNavigator):V
- execute():com.intellij.execution.testframework.FailedTestsNavigator$FailedTestInfo
- pa:getBoundIndex():I
- getDefect():com.intellij.execution.testframework.AbstractTestProxy
- p:getDefectsCount():I
- pa:nextIndex(I):I
a:com.intellij.execution.testframework.Filter
- sf:DEFECT:com.intellij.execution.testframework.Filter
- sf:DEFECTIVE_LEAF:com.intellij.execution.testframework.Filter
@@ -113,9 +95,6 @@ c:com.intellij.execution.testframework.HyperLink
- com.intellij.execution.testframework.Printable
- <init>(java.lang.String,com.intellij.execution.filters.HyperlinkInfo):V
- printOn(com.intellij.execution.testframework.Printer):V
f:com.intellij.execution.testframework.LvcsHelper
- <init>():V
- s:addLabel(com.intellij.execution.testframework.TestFrameworkRunningModel):V
com.intellij.execution.testframework.Printable
- a:printOn(com.intellij.execution.testframework.Printer):V
com.intellij.execution.testframework.Printer
@@ -126,10 +105,6 @@ com.intellij.execution.testframework.Printer
- printExpectedActualHeader(java.lang.String,java.lang.String):V
- a:printHyperlink(java.lang.String,com.intellij.execution.filters.HyperlinkInfo):V
- printWithAnsiColoring(java.lang.String,com.intellij.openapi.util.Key):V
c:com.intellij.execution.testframework.PrinterMark
- com.intellij.execution.testframework.Printable
- <init>():V
- printOn(com.intellij.execution.testframework.Printer):V
a:com.intellij.execution.testframework.SourceScope
- <init>():V
- a:getGlobalSearchScope():com.intellij.psi.search.GlobalSearchScope
@@ -199,10 +174,6 @@ com.intellij.execution.testframework.TestFrameworkRunningModel
- a:isRunning():Z
- a:selectAndNotify(com.intellij.execution.testframework.AbstractTestProxy):V
- a:setFilter(com.intellij.execution.testframework.Filter):V
f:com.intellij.execution.testframework.TestIconProvider
- com.intellij.ide.IconProvider
- <init>():V
- getIcon(com.intellij.psi.PsiElement,I):javax.swing.Icon
com.intellij.execution.testframework.TestProxyRoot
- a:getComment():java.lang.String
- a:getPresentation():java.lang.String
@@ -227,7 +198,6 @@ c:com.intellij.execution.testframework.TestSearchScope$Wrapper
- toString():java.lang.String
- writeExternal(org.jdom.Element):V
a:com.intellij.execution.testframework.TestStatusListener
- sf:EP_NAME:com.intellij.openapi.extensions.ExtensionPointName
- <init>():V
- s:notifySuiteFinished(com.intellij.execution.testframework.AbstractTestProxy,com.intellij.openapi.project.Project):V
- a:testSuiteFinished(com.intellij.execution.testframework.AbstractTestProxy):V
@@ -251,10 +221,6 @@ a:com.intellij.execution.testframework.TestTreeView
- isCopyVisible(com.intellij.openapi.actionSystem.DataContext):Z
- performCopy(com.intellij.openapi.actionSystem.DataContext):V
com.intellij.execution.testframework.TestTreeViewAction
c:com.intellij.execution.testframework.TestTreeViewActionsPromoter
- com.intellij.openapi.actionSystem.ActionPromoter
- <init>():V
- promote(java.util.List,com.intellij.openapi.actionSystem.DataContext):java.util.List
a:com.intellij.execution.testframework.TestTreeViewStructure
- com.intellij.ide.util.treeView.AbstractTreeStructure
- <init>():V
@@ -266,7 +232,6 @@ f:com.intellij.execution.testframework.TestsUIUtil
- s:clearIconProgress(com.intellij.openapi.project.Project):V
- s:getOpenFileDescriptor(com.intellij.execution.testframework.AbstractTestProxy,com.intellij.execution.testframework.TestConsoleProperties):com.intellij.pom.Navigatable
- s:getOpenFileDescriptor(com.intellij.execution.testframework.AbstractTestProxy,com.intellij.execution.testframework.TestFrameworkRunningModel):com.intellij.pom.Navigatable
- s:getTestShortSummary(com.intellij.execution.testframework.AbstractTestProxy):java.lang.String
- s:getTestSummary(com.intellij.execution.testframework.AbstractTestProxy):java.lang.String
- s:isMultipleSelectionImpossible(com.intellij.openapi.actionSystem.DataContext):Z
- s:notifyByBalloon(com.intellij.openapi.project.Project,com.intellij.execution.testframework.AbstractTestProxy,com.intellij.execution.testframework.TestConsoleProperties,com.intellij.execution.testframework.TestsUIUtil$TestResultPresentation):V
@@ -297,14 +262,11 @@ c:com.intellij.execution.testframework.ToolbarPanel
- javax.swing.JPanel
- com.intellij.ide.OccurenceNavigator
- com.intellij.openapi.Disposable
- f:actionsToMerge:com.intellij.openapi.actionSystem.AnAction[]
- f:additionalActionsToMerge:com.intellij.openapi.actionSystem.AnAction[]
- pf:myOccurenceNavigator:com.intellij.execution.testframework.FailedTestsNavigator
- pf:myScrollToSource:com.intellij.execution.testframework.actions.ScrollToTestSourceAction
- pf:myTreeExpander:com.intellij.execution.testframework.actions.TestTreeExpander
- <init>(com.intellij.execution.testframework.TestConsoleProperties,javax.swing.JComponent):V
- dispose():V
- getActionUpdateThread():com.intellij.openapi.actionSystem.ActionUpdateThread
- getActionsToMerge():com.intellij.openapi.actionSystem.AnAction[]
- getAdditionalActionsToMerge():com.intellij.openapi.actionSystem.AnAction[]
- getNextOccurenceActionName():java.lang.String
- getPreviousOccurenceActionName():java.lang.String
- goNextOccurence():com.intellij.ide.OccurenceNavigator$OccurenceInfo
@@ -355,26 +317,9 @@ pa:com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction$M
- writeExternal(org.jdom.Element):V
com.intellij.execution.testframework.actions.ConsolePropertiesProvider
- createTestConsoleProperties(com.intellij.execution.Executor):com.intellij.execution.testframework.TestConsoleProperties
c:com.intellij.execution.testframework.actions.ScrollToTestSourceAction
- com.intellij.util.config.ToggleBooleanProperty$Disablable
- <init>(com.intellij.execution.testframework.TestConsoleProperties):V
- p:isEnabled():Z
- s:isScrollEnabled(com.intellij.execution.testframework.TestFrameworkRunningModel):Z
- p:isVisible():Z
- setModel(com.intellij.execution.testframework.TestFrameworkRunningModel):V
f:com.intellij.execution.testframework.actions.TestDiffContent
- com.intellij.diff.contents.DiffContentBase
- com.intellij.diff.contents.DocumentContent
- sf:Companion:com.intellij.execution.testframework.actions.TestDiffContent$Companion
- <init>(com.intellij.openapi.project.Project,com.intellij.diff.contents.DocumentContent,java.lang.String,com.intellij.psi.SmartPsiElementPointer):V
- getContentType():com.intellij.openapi.fileTypes.FileType
- getDocument():com.intellij.openapi.editor.Document
- onAssigned(Z):V
f:com.intellij.execution.testframework.actions.TestDiffContent$Companion
- f:create(com.intellij.openapi.project.Project,java.lang.String,com.intellij.psi.SmartPsiElementPointer):com.intellij.execution.testframework.actions.TestDiffContent
com.intellij.execution.testframework.actions.TestDiffProvider
- sf:TEST_DIFF_PROVIDER_LANGUAGE_EXTENSION:com.intellij.lang.LanguageExtension
- a:findExpected(com.intellij.openapi.project.Project,java.lang.String,java.lang.String):com.intellij.psi.PsiElement
- s:getProviderByLanguage(com.intellij.lang.Language):com.intellij.execution.testframework.actions.TestDiffProvider
- a:updateExpected(com.intellij.psi.PsiElement,java.lang.String):V
f:com.intellij.execution.testframework.actions.TestDiffRequestProcessor
- <init>():V
@@ -383,14 +328,6 @@ f:com.intellij.execution.testframework.actions.TestFrameworkActions
- <init>():V
- s:addPropertyListener(com.intellij.util.config.AbstractProperty,com.intellij.execution.testframework.TestFrameworkPropertyListener,com.intellij.execution.testframework.TestFrameworkRunningModel,Z):V
- s:installFilterAction(com.intellij.execution.testframework.TestFrameworkRunningModel):V
c:com.intellij.execution.testframework.actions.TestTreeExpander
- com.intellij.ide.TreeExpander
- <init>():V
- canCollapse():Z
- canExpand():Z
- collapseAll():V
- expandAll():V
- setModel(com.intellij.execution.testframework.TestFrameworkRunningModel):V
c:com.intellij.execution.testframework.actions.ViewAssertEqualsDiffAction
- com.intellij.openapi.actionSystem.AnAction
- com.intellij.execution.testframework.TestTreeViewAction
@@ -413,17 +350,6 @@ a:com.intellij.execution.testframework.autotest.AbstractAutoTestManager
- p:restartAllAutoTests(java.util.function.BooleanSupplier):V
c:com.intellij.execution.testframework.autotest.AbstractAutoTestManager$State
- <init>():V
c:com.intellij.execution.testframework.autotest.AdjustAutotestDelayActionGroup
- com.intellij.openapi.actionSystem.ActionGroup
- sf:MAX_DELAY:I
- <init>(javax.swing.JComponent):V
- getActionUpdateThread():com.intellij.openapi.actionSystem.ActionUpdateThread
- getChildren(com.intellij.openapi.actionSystem.AnActionEvent):com.intellij.openapi.actionSystem.AnAction[]
- update(com.intellij.openapi.actionSystem.AnActionEvent):V
f:com.intellij.execution.testframework.autotest.AutoTestManager
- com.intellij.execution.testframework.autotest.AbstractAutoTestManager
- <init>(com.intellij.openapi.project.Project):V
- s:getInstance(com.intellij.openapi.project.Project):com.intellij.execution.testframework.autotest.AutoTestManager
com.intellij.execution.testframework.autotest.AutoTestWatcher
- a:activate():V
- a:deactivate():V
@@ -442,87 +368,6 @@ c:com.intellij.execution.testframework.autotest.ToggleAutoTestAction
- isDelayApplicable():Z
- isSelected(com.intellij.openapi.actionSystem.AnActionEvent):Z
- setSelected(com.intellij.openapi.actionSystem.AnActionEvent,Z):V
f:com.intellij.execution.testframework.export.ExportTestResultsAction
- com.intellij.openapi.project.DumbAwareAction
- <init>():V
- actionPerformed(com.intellij.openapi.actionSystem.AnActionEvent):V
- s:create(java.lang.String,com.intellij.execution.configurations.RunConfiguration,javax.swing.JComponent):com.intellij.execution.testframework.export.ExportTestResultsAction
- getActionUpdateThread():com.intellij.openapi.actionSystem.ActionUpdateThread
- setModel(com.intellij.execution.testframework.TestFrameworkRunningModel):V
- update(com.intellij.openapi.actionSystem.AnActionEvent):V
c:com.intellij.execution.testframework.export.ExportTestResultsConfiguration
- com.intellij.openapi.components.PersistentStateComponent
- <init>():V
- getExportFormat():com.intellij.execution.testframework.export.ExportTestResultsConfiguration$ExportFormat
- s:getInstance(com.intellij.openapi.project.Project):com.intellij.execution.testframework.export.ExportTestResultsConfiguration
- getOutputFolder():java.lang.String
- getState():com.intellij.execution.testframework.export.ExportTestResultsConfiguration$State
- getUserTemplatePath():java.lang.String
- isOpenResults():Z
- loadState(com.intellij.execution.testframework.export.ExportTestResultsConfiguration$State):V
- setExportFormat(com.intellij.execution.testframework.export.ExportTestResultsConfiguration$ExportFormat):V
- setOpenResults(Z):V
- setOutputFolder(java.lang.String):V
- setUserTemplatePath(java.lang.String):V
e:com.intellij.execution.testframework.export.ExportTestResultsConfiguration$ExportFormat
- java.lang.Enum
- sf:BundledTemplate:com.intellij.execution.testframework.export.ExportTestResultsConfiguration$ExportFormat
- sf:UserTemplate:com.intellij.execution.testframework.export.ExportTestResultsConfiguration$ExportFormat
- sf:Xml:com.intellij.execution.testframework.export.ExportTestResultsConfiguration$ExportFormat
- getDefaultExtension():java.lang.String
- s:valueOf(java.lang.String):com.intellij.execution.testframework.export.ExportTestResultsConfiguration$ExportFormat
- s:values():com.intellij.execution.testframework.export.ExportTestResultsConfiguration$ExportFormat[]
c:com.intellij.execution.testframework.export.ExportTestResultsConfiguration$State
- openResultsInEditor:Z
- outputFolder:java.lang.String
- userTemplatePath:java.lang.String
- <init>():V
- getExportFormat():java.lang.String
- setExportFormat(java.lang.String):V
c:com.intellij.execution.testframework.export.ExportTestResultsDialog
- com.intellij.openapi.ui.DialogWrapper
- <init>(com.intellij.openapi.project.Project,com.intellij.execution.testframework.export.ExportTestResultsConfiguration,java.lang.String):V
- p:createCenterPanel():javax.swing.JComponent
- p:doOKAction():V
- p:getDimensionServiceKey():java.lang.String
- getFileName():java.lang.String
- p:getHelpId():java.lang.String
- getPreferredFocusedComponent():javax.swing.JComponent
c:com.intellij.execution.testframework.export.ExportTestResultsForm
- b:$$$getRootComponent$$$():javax.swing.JComponent
- <init>(com.intellij.execution.testframework.export.ExportTestResultsConfiguration,java.lang.String,java.lang.String):V
- addChangeListener(javax.swing.event.ChangeListener):V
- apply(com.intellij.execution.testframework.export.ExportTestResultsConfiguration):V
- getContentPane():javax.swing.JComponent
- getFileName():java.lang.String
- getPreferredFocusedComponent():javax.swing.JComponent
- s:shouldOpenInBrowser(java.lang.String):Z
- showMessage(java.lang.String):V
- validate():java.lang.String
f:com.intellij.execution.testframework.export.TestResultsXmlFormatter
- sf:ACTUAL:java.lang.String
- sf:ATTR_CONFIG:java.lang.String
- sf:ATTR_DURATION:java.lang.String
- sf:ATTR_LOCATION:java.lang.String
- sf:ATTR_METAINFO:java.lang.String
- sf:ATTR_NAME:java.lang.String
- sf:ATTR_OUTPUT_TYPE:java.lang.String
- sf:ATTR_STATUS:java.lang.String
- sf:ATTR_VALUE:java.lang.String
- sf:DIFF:java.lang.String
- sf:ELEM_COUNT:java.lang.String
- sf:ELEM_OUTPUT:java.lang.String
- sf:ELEM_SUITE:java.lang.String
- sf:ELEM_TEST:java.lang.String
- sf:EXPECTED:java.lang.String
- sf:ROOT_ELEM:java.lang.String
- sf:STATUS_ERROR:java.lang.String
- sf:STATUS_FAILED:java.lang.String
- sf:STATUS_IGNORED:java.lang.String
- sf:STATUS_PASSED:java.lang.String
- sf:STATUS_SKIPPED:java.lang.String
- sf:TOTAL_STATUS:java.lang.String
- s:execute(com.intellij.execution.testframework.AbstractTestProxy,com.intellij.execution.configurations.RunConfiguration,com.intellij.execution.testframework.TestConsoleProperties,org.xml.sax.ContentHandler):V
c:com.intellij.execution.testframework.stacktrace.DiffHyperlink
- com.intellij.execution.testframework.Printable
- pf:myActualFilePath:java.lang.String
@@ -590,11 +435,6 @@ a:com.intellij.execution.testframework.ui.BaseTestsOutputConsoleView
- scrollTo(I):V
- setHelpId(java.lang.String):V
- setOutputPaused(Z):V
c:com.intellij.execution.testframework.ui.SameHeightPanel
- com.intellij.ui.components.panels.NonOpaquePanel
- <init>(java.awt.LayoutManager,javax.swing.JComponent):V
- getPreferredSize():java.awt.Dimension
- s:wrap(javax.swing.JComponent,javax.swing.JComponent):com.intellij.execution.testframework.ui.SameHeightPanel
a:com.intellij.execution.testframework.ui.TestResultsPanel
- javax.swing.JPanel
- com.intellij.openapi.Disposable
@@ -650,5 +490,4 @@ c:com.intellij.execution.testframework.ui.TestsOutputConsolePrinter
- printExpectedActualHeader(java.lang.String,java.lang.String):V
- printHyperlink(java.lang.String,com.intellij.execution.filters.HyperlinkInfo):V
- printWithAnsiColoring(java.lang.String,com.intellij.openapi.util.Key):V
- p:scrollToBeginning():V
- updateOnTestSelected(com.intellij.execution.testframework.AbstractTestProxy):V

View File

@@ -1 +0,0 @@
org/xml/sax/ContentHandler

View File

@@ -68,7 +68,7 @@ public abstract class AbstractTestProxy extends CompositePrintable {
public abstract boolean shouldSkipRootNodeForExport();
public void fireOnNewPrintable(@NotNull final Printable printable) {
protected void fireOnNewPrintable(@NotNull final Printable printable) {
if (myPrinter != null) {
myPrinter.onNewAvailable(printable);
}

View File

@@ -49,7 +49,7 @@ public class DeferingPrinter implements Printer {
@Override
public void mark() {
myCompositePrintable.addLast(new PrinterMark());
myCompositePrintable.addLast(printer -> printer.mark());
}
public void printAndForget(final Printer printer) {

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.execution.testframework;
import com.intellij.execution.ExecutionBundle;
@@ -15,7 +15,7 @@ import javax.swing.tree.TreeNode;
import java.util.ArrayList;
import java.util.List;
public class FailedTestsNavigator implements OccurenceNavigator {
class FailedTestsNavigator implements OccurenceNavigator {
private TestFrameworkRunningModel myModel;
@Override
@@ -79,7 +79,7 @@ public class FailedTestsNavigator implements OccurenceNavigator {
return new PreviousFailedTestInfo().execute();
}
protected abstract class FailedTestInfo {
private abstract class FailedTestInfo {
private AbstractTestProxy myDefect = null;
private List<AbstractTestProxy> myAllTests;
private List<AbstractTestProxy> myDefects;
@@ -92,7 +92,7 @@ public class FailedTestsNavigator implements OccurenceNavigator {
return myDefect == null ? getDefectsCount() : myDefects.indexOf(myDefect) + 1;
}
public FailedTestInfo execute() {
FailedTestInfo execute() {
myAllTests = new ArrayList<>();
collectTests(myAllTests, (TreeNode)myModel.getTreeView().getModel().getRoot());
myDefects = Filter.DEFECTIVE_LEAF.select(myAllTests);

View File

@@ -1,41 +0,0 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.execution.testframework;
import com.intellij.execution.ExecutionBundle;
import com.intellij.history.LocalHistory;
import com.intellij.openapi.project.Project;
import com.intellij.ui.JBColor;
import java.awt.*;
public final class LvcsHelper {
private static final Color RED = new JBColor(new Color(250, 220, 220), new Color(104, 67, 67));
private static final Color GREEN = new JBColor(new Color(220, 250, 220), new Color(44, 66, 60));
public static void addLabel(final TestFrameworkRunningModel model) {
String name;
int color;
AbstractTestProxy root = model.getRoot();
if (root.isInterrupted()) return;
TestConsoleProperties consoleProperties = model.getProperties();
String configName = consoleProperties.getConfiguration().getName();
if (root.isPassed() || root.isIgnored()) {
color = GREEN.getRGB();
name = ExecutionBundle.message("junit.running.info.tests.passed.with.test.name.label", configName);
}
else {
color = RED.getRGB();
name = ExecutionBundle.message("junit.running.info.tests.failed.with.test.name.label", configName);
}
Project project = consoleProperties.getProject();
if (project.isDisposed()) return;
LocalHistory.getInstance().putSystemLabel(project, name, color);
}
}

View File

@@ -1,33 +0,0 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.execution.testframework;
public class PrinterMark implements Printable {
@Override
public void printOn(final Printer printer) {
printer.mark();
}
}

View File

@@ -10,11 +10,13 @@ import com.intellij.testIntegration.TestFramework;
import com.intellij.ui.IconManager;
import com.intellij.ui.LayeredIcon;
import com.intellij.util.PlatformIcons;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import java.util.List;
@ApiStatus.Internal
public final class TestIconProvider extends IconProvider {
@Override
public Icon getIcon(@NotNull PsiElement element, int flags) {

View File

@@ -6,7 +6,7 @@ import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.Nullable;
public abstract class TestStatusListener {
public static final ExtensionPointName<TestStatusListener> EP_NAME = ExtensionPointName.create("com.intellij.testStatusListener");
private static final ExtensionPointName<TestStatusListener> EP_NAME = ExtensionPointName.create("com.intellij.testStatusListener");
public abstract void testSuiteFinished(@Nullable AbstractTestProxy root);

View File

@@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
import java.util.Collections;
import java.util.List;
public class TestTreeViewActionsPromoter implements ActionPromoter {
class TestTreeViewActionsPromoter implements ActionPromoter {
@Override
public List<AnAction> promote(@NotNull List<? extends AnAction> actions, @NotNull DataContext context) {
if (AbstractTestProxy.DATA_KEY.getData(context) != null) {

View File

@@ -130,11 +130,6 @@ public final class TestsUIUtil {
return new TestResultPresentation(proxy).getPresentation().getBalloonText();
}
@NlsContexts.SystemNotificationText
public static String getTestShortSummary(AbstractTestProxy proxy) {
return new TestResultPresentation(proxy).getPresentation().getText();
}
public static void showIconProgress(Project project, int n, final int maximum, final int problemsCounter, boolean updateWithAttention) {
AppIcon icon = AppIcon.getInstance();
if (n < maximum || !updateWithAttention) {

View File

@@ -34,15 +34,15 @@ import java.util.ArrayList;
public class ToolbarPanel extends JPanel implements OccurenceNavigator, Disposable {
private static final Logger LOG = Logger.getInstance(ToolbarPanel.class);
protected final TestTreeExpander myTreeExpander = new TestTreeExpander();
protected final FailedTestsNavigator myOccurenceNavigator;
protected final ScrollToTestSourceAction myScrollToSource;
private final TestTreeExpander myTreeExpander = new TestTreeExpander();
private final FailedTestsNavigator myOccurenceNavigator;
private final ScrollToTestSourceAction myScrollToSource;
private @Nullable ExportTestResultsAction myExportAction;
private final ArrayList<ToggleModelAction> myActions = new ArrayList<>();
public final AnAction[] actionsToMerge;
public final AnAction[] additionalActionsToMerge;
private final AnAction[] actionsToMerge;
private final AnAction[] additionalActionsToMerge;
public ToolbarPanel(final TestConsoleProperties properties,
final JComponent parent) {
@@ -181,6 +181,14 @@ public class ToolbarPanel extends JPanel implements OccurenceNavigator, Disposab
TestFrameworkActions.addPropertyListener(TestConsoleProperties.SUITES_ALWAYS_ON_TOP, createComparatorPropertyListener(model), model, true);
}
public AnAction[] getActionsToMerge() {
return actionsToMerge;
}
public AnAction[] getAdditionalActionsToMerge() {
return additionalActionsToMerge;
}
private static TestFrameworkPropertyListener<Boolean> createComparatorPropertyListener(TestFrameworkRunningModel model) {
return new TestFrameworkPropertyListener<>() {
@Override

View File

@@ -20,7 +20,9 @@ import com.intellij.execution.testframework.TestConsoleProperties;
import com.intellij.execution.testframework.TestFrameworkRunningModel;
import com.intellij.ui.UIBundle;
import com.intellij.util.config.ToggleBooleanProperty;
import org.jetbrains.annotations.ApiStatus;
@ApiStatus.Internal
public class ScrollToTestSourceAction extends ToggleBooleanProperty.Disablable {
private TestFrameworkRunningModel myModel;
public ScrollToTestSourceAction(final TestConsoleProperties properties) {

View File

@@ -23,8 +23,10 @@ import com.intellij.psi.PsiElement
import com.intellij.psi.SmartPsiElementPointer
import com.intellij.psi.util.startOffset
import com.intellij.util.concurrency.annotations.RequiresEdt
import org.jetbrains.annotations.ApiStatus
import java.util.function.IntUnaryOperator
@ApiStatus.Internal
class TestDiffContent(
private val project: Project,
private val original: DocumentContent,
@@ -52,7 +54,7 @@ class TestDiffContent(
try {
myDuringModification = true
val element = elemPtr.element ?: return
TestDiffProvider.TEST_DIFF_PROVIDER_LANGUAGE_EXTENSION.forLanguage(element.language).updateExpected(element, event.document.text)
TestDiffProvider.getProviderByLanguage(element.language).updateExpected(element, event.document.text)
}
finally {
myDuringModification = false

View File

@@ -1,11 +1,13 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.execution.testframework.actions;
import com.intellij.lang.Language;
import com.intellij.lang.LanguageExtension;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import com.intellij.util.concurrency.annotations.RequiresReadLock;
import com.intellij.util.concurrency.annotations.RequiresWriteLock;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -14,6 +16,10 @@ import org.jetbrains.annotations.Nullable;
* code.
*/
public interface TestDiffProvider {
/**
* Please use {@link #getProviderByLanguage(Language)} to retrieve requited provider.
*/
@ApiStatus.Internal
LanguageExtension<TestDiffProvider> TEST_DIFF_PROVIDER_LANGUAGE_EXTENSION = new LanguageExtension<>("com.intellij.testDiffProvider");
@RequiresWriteLock
@@ -26,4 +32,11 @@ public interface TestDiffProvider {
@Nullable
@RequiresReadLock
PsiElement findExpected(@NotNull Project project, @NotNull String stackTrace, @NotNull String expected);
/**
* Retrieves the TestDiffProvider implementation based on the specified language.
*/
static TestDiffProvider getProviderByLanguage(Language language) {
return TEST_DIFF_PROVIDER_LANGUAGE_EXTENSION.forLanguage(language);
}
}

View File

@@ -112,7 +112,7 @@ public final class TestDiffRequestProcessor {
if (testRoot == null) return null;
Location<?> loc = testProxy.getLocation(myProject, testRoot.getTestConsoleProperties().getScope());
if (loc == null) return null;
return TestDiffProvider.TEST_DIFF_PROVIDER_LANGUAGE_EXTENSION.forLanguage(loc.getPsiElement().getLanguage());
return TestDiffProvider.getProviderByLanguage(loc.getPsiElement().getLanguage());
}
private @Nullable PsiElement getExpected(@NotNull TestDiffProvider provider, @NotNull AbstractTestProxy testProxy) {

View File

@@ -20,7 +20,9 @@ import com.intellij.ide.TreeExpander;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.util.Disposer;
import com.intellij.util.ui.tree.TreeUtil;
import org.jetbrains.annotations.ApiStatus;
@ApiStatus.Internal
public class TestTreeExpander implements TreeExpander {
private TestFrameworkRunningModel myModel;

View File

@@ -20,6 +20,7 @@ import com.intellij.execution.ui.RunContentDescriptor;
import com.intellij.ide.DataManager;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -28,6 +29,7 @@ import javax.swing.*;
/**
* @author Dennis.Ushakov
*/
@ApiStatus.Internal
public class AdjustAutotestDelayActionGroup extends ActionGroup {
public static final int MAX_DELAY = 10;
private final DataContext myDataContext;

View File

@@ -15,12 +15,12 @@ import java.util.function.Predicate;
@Service(Service.Level.PROJECT)
@State(name = "AutoTestManager", storages = @Storage(StoragePathMacros.PRODUCT_WORKSPACE_FILE))
public final class AutoTestManager extends AbstractAutoTestManager {
final class AutoTestManager extends AbstractAutoTestManager {
public static @NotNull AutoTestManager getInstance(Project project) {
return project.getService(AutoTestManager.class);
}
public AutoTestManager(@NotNull Project project) {
AutoTestManager(@NotNull Project project) {
super(project);
}

View File

@@ -0,0 +1,5 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
@ApiStatus.Internal
package com.intellij.execution.testframework.export;
import org.jetbrains.annotations.ApiStatus;

View File

@@ -17,10 +17,12 @@
package com.intellij.execution.testframework.ui;
import com.intellij.ui.components.panels.NonOpaquePanel;
import org.jetbrains.annotations.ApiStatus;
import javax.swing.*;
import java.awt.*;
@ApiStatus.Internal
public class SameHeightPanel extends NonOpaquePanel {
private final JComponent myOriginalHeightComponent;

View File

@@ -150,7 +150,7 @@ public class TestsOutputConsolePrinter implements Printer, Disposable {
return myCurrentTest != null && myCurrentTest.isInProgress();
}
protected void scrollToBeginning() {
private void scrollToBeginning() {
EdtInvocationManager.invokeLaterIfNeeded(() -> {
if (!myDisposed) {
myConsole.performWhenNoDeferredOutput(() -> {