Fix running JUnit test method in abstract class
Previously led to running all methods in an inheritor class Untested because behaviour is rare and we don't have test covering JUnit run configuration #KT-28080 Fixed
This commit is contained in:
+2
-1
@@ -107,7 +107,8 @@ class KotlinJUnitRunConfigurationProducer : RunConfigurationProducer<JUnitConfig
|
||||
|
||||
override fun onFirstRun(fromContext: ConfigurationFromContext, context: ConfigurationContext, performRunnable: Runnable) {
|
||||
val leaf = fromContext.sourceElement
|
||||
val sourceElement = getTestClass(leaf) ?: return super.onFirstRun(fromContext, context, performRunnable)
|
||||
val sourceElement =
|
||||
getTestMethod(leaf) as? PsiMember ?: getTestClass(leaf) ?: return super.onFirstRun(fromContext, context, performRunnable)
|
||||
|
||||
val contextWithLightElement = createDelegatingContextWithLightElement(fromContext, sourceElement)
|
||||
// TODO: use TestClassConfigurationProducer when constructor becomes public
|
||||
|
||||
Reference in New Issue
Block a user