diff --git a/java/execution/impl/src/com/intellij/execution/testframework/JvmTestDiffProvider.kt b/java/execution/impl/src/com/intellij/execution/testframework/JvmTestDiffProvider.kt index 74799d6aca20..282ff92a8f9d 100644 --- a/java/execution/impl/src/com/intellij/execution/testframework/JvmTestDiffProvider.kt +++ b/java/execution/impl/src/com/intellij/execution/testframework/JvmTestDiffProvider.kt @@ -18,11 +18,12 @@ abstract class JvmTestDiffProvider : TestDiffProvider { var enclosingMethod: UMethod? = null val lineParser = ExceptionLineParserFactory.getInstance().create(ExceptionInfoCache(project, GlobalSearchScope.allScope(project))) stackTrace.lineSequence().forEach { line -> - lineParser.execute(line, line.length) ?: return@findExpected null + lineParser.execute(line, line.length) ?: return@forEach + if (isTestFramework(lineParser.uClass)) return@forEach val file = lineParser.file ?: return@findExpected null val diffProvider = TestDiffProvider.TEST_DIFF_PROVIDER_LANGUAGE_EXTENSION.forLanguage(file.language).asSafely() if (diffProvider == null) return@findExpected null - if (diffProvider.isCompiled(file)) return@forEach + if (diffProvider.isCompiled(file)) return@findExpected null val virtualFile = file.virtualFile ?: return@findExpected null val document = FileDocumentManager.getInstance().getDocument(virtualFile) ?: return@findExpected null val lineNumber = lineParser.info.lineNumber @@ -38,6 +39,10 @@ abstract class JvmTestDiffProvider : TestDiffProvider { return null } + private fun isTestFramework(clazz: UClass?): Boolean { + return clazz?.qualifiedName?.startsWith("org.junit") == true || clazz?.qualifiedName?.startsWith("org.testng") == true + } + abstract fun isCompiled(file: PsiFile): Boolean abstract fun failedCall(file: PsiFile, startOffset: Int, endOffset: Int, method: UMethod?): PsiElement?