mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[jvm] Add documentation JVM test API
GitOrigin-RevId: a05f30bea33866ef770cc6db081c7ec7426fd083
This commit is contained in:
committed by
intellij-monorepo-bot
parent
dc7805f3a9
commit
ebd72b26b4
@@ -7,13 +7,21 @@ import com.intellij.testFramework.IdeaTestUtil
|
||||
import com.intellij.testFramework.LightProjectDescriptor
|
||||
import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture
|
||||
|
||||
/**
|
||||
* A base test class that allows setting language level and mock SDK.
|
||||
*/
|
||||
abstract class JvmSdkInspectionTestBase : JvmInspectionTestBase() {
|
||||
open val languageLevel: LanguageLevel = LanguageLevel.HIGHEST
|
||||
|
||||
/**
|
||||
* The mock JDK to use.
|
||||
* When the mock JDK for this language level is not available, the mock SDK will be chosen according to [IdeaTestUtil.getMockJdk].
|
||||
*/
|
||||
open val sdkLevel: LanguageLevel = LanguageLevel.HIGHEST
|
||||
|
||||
override fun getProjectDescriptor(): LightProjectDescriptor = ProjectDescriptor(sdkLevel)
|
||||
|
||||
/**
|
||||
* Sets the current project and module language level to [languageLevel].
|
||||
*/
|
||||
protected fun JavaCodeInsightTestFixture.setLanguageLevel(languageLevel: LanguageLevel) {
|
||||
LanguageLevelProjectExtension.getInstance(project).languageLevel = languageLevel
|
||||
IdeaTestUtil.setModuleLanguageLevel(myFixture.module, languageLevel, testRootDisposable)
|
||||
|
||||
@@ -4,6 +4,9 @@ import com.intellij.ide.actions.GotoRelatedSymbolAction
|
||||
import com.intellij.navigation.GotoRelatedItem
|
||||
import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture
|
||||
|
||||
/**
|
||||
* A test base for testing [com.intellij.navigation.GotoRelatedProvider] implementations in all JVM languages.
|
||||
*/
|
||||
abstract class JvmGoToRelatedTestBase : LightJvmCodeInsightFixtureTestCase() {
|
||||
protected fun JavaCodeInsightTestFixture.testGoToRelatedAction(
|
||||
lang: JvmLanguage,
|
||||
|
||||
@@ -9,6 +9,9 @@ import com.intellij.testFramework.InspectionTestUtil
|
||||
import com.intellij.testFramework.LightProjectDescriptor
|
||||
import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture
|
||||
|
||||
/**
|
||||
* A base class for testing JVM inspections.
|
||||
*/
|
||||
abstract class JvmInspectionTestBase : LightJvmCodeInsightFixtureTestCase() {
|
||||
abstract val inspection: InspectionProfileEntry
|
||||
|
||||
|
||||
Reference in New Issue
Block a user