IJ-CR-135039 Replace usages of PlatformTestUtil.newPerformanceTest with PerformanceTestUtil.newPerformanceTest

GitOrigin-RevId: 4edcfadc23f7305d68b8c08cd6ae634ee4869a2e
This commit is contained in:
Maxim.Kolmakov
2024-05-31 19:28:45 +02:00
committed by intellij-monorepo-bot
parent 79ffafd27a
commit 71168cb8a9
125 changed files with 414 additions and 376 deletions

View File

@@ -3,7 +3,7 @@ package com.intellij.spellchecker.dataset
import com.intellij.spellchecker.SpellCheckerManager
import com.intellij.spellchecker.inspection.SpellcheckerInspectionTestCase
import com.intellij.testFramework.PlatformTestUtil
import com.intellij.tools.ide.metrics.benchmark.PerformanceTestUtil
class DataSetPerformanceTest: SpellcheckerInspectionTestCase() {
@@ -12,7 +12,7 @@ class DataSetPerformanceTest: SpellcheckerInspectionTestCase() {
val manager = SpellCheckerManager.getInstance(project)
val total = Datasets.missp.flatMap { it.misspellings + it.word }.size
PlatformTestUtil.newPerformanceTest("highlight ${total} words in missp") {
PerformanceTestUtil.newPerformanceTest("highlight ${total} words in missp") {
for (word in Datasets.missp) {
manager.hasProblem(word.word)
for (missp in word.misspellings) {
@@ -26,7 +26,7 @@ class DataSetPerformanceTest: SpellcheckerInspectionTestCase() {
val manager = SpellCheckerManager.getInstance(project)
val total = Datasets.words.flatMap { it.misspellings + it.word }.size
PlatformTestUtil.newPerformanceTest("highlight ${total} words in words") {
PerformanceTestUtil.newPerformanceTest("highlight ${total} words in words") {
for (word in Datasets.words) {
manager.hasProblem(word.word)
for (missp in word.misspellings) {
@@ -41,7 +41,7 @@ class DataSetPerformanceTest: SpellcheckerInspectionTestCase() {
val manager = SpellCheckerManager.getInstance(project)
val total = Datasets.wordsCamelCase.flatMap { it.misspellings + it.word }.size
PlatformTestUtil.newPerformanceTest("highlight ${total} words in camel-case") {
PerformanceTestUtil.newPerformanceTest("highlight ${total} words in camel-case") {
for (word in Datasets.wordsCamelCase) {
manager.hasProblem(word.word)
for (missp in word.misspellings) {

View File

@@ -23,7 +23,7 @@ import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.spellchecker.inspections.*;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.tools.ide.metrics.benchmark.PerformanceTestUtil;
import com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl;
import com.intellij.util.ArrayUtil;
import org.jetbrains.annotations.NotNull;
@@ -57,7 +57,7 @@ public class SpellcheckerPerformanceTest extends SpellcheckerInspectionTestCase
DaemonCodeAnalyzer.getInstance(getProject()).restart();
int[] toIgnore = ignoreEverythingExceptInspections();
PlatformTestUtil.newPerformanceTest("many typos highlighting", () -> {
PerformanceTestUtil.newPerformanceTest("many typos highlighting", () -> {
assertSize(typoCount, CodeInsightTestFixtureImpl.instantiateAndRun(myFixture.getFile(), myFixture.getEditor(), toIgnore, false));
}).start();
}
@@ -79,7 +79,7 @@ public class SpellcheckerPerformanceTest extends SpellcheckerInspectionTestCase
assertEmpty(infos);
LOG.debug("warm-up took " + (System.currentTimeMillis() - start) + " ms");
PlatformTestUtil.newPerformanceTest("many whitespaces highlighting", () -> {
PerformanceTestUtil.newPerformanceTest("many whitespaces highlighting", () -> {
DaemonCodeAnalyzer.getInstance(getProject()).restart();
assertEmpty(runLocalInspections());
}).start();
@@ -123,7 +123,7 @@ public class SpellcheckerPerformanceTest extends SpellcheckerInspectionTestCase
}
private static void doSplitterPerformanceTest(String text, Splitter splitter) {
PlatformTestUtil.newPerformanceTest("long word for spelling", () -> {
PerformanceTestUtil.newPerformanceTest("long word for spelling", () -> {
try {
splitter.split(text, TextRange.allOf(text), (textRange) -> {});
}