Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package de.mannodermaus.junit5.inheritance

import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.Test

abstract class TestExecutor {

@Test
fun executeTest() {
assertNotNull(getFilename())
}

abstract fun getFilename(): String?
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package de.mannodermaus.junit5.inheritance;

public class TestImplementation extends TestExecutor {

@Override
public String getFilename() {
return "test";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ public class AndroidJUnit5Builder : RunnerBuilder() {
}

if (testClass.jupiterTestMethods().isEmpty()) {

var C: Class<*>? = testClass
while (C != null) {

C = C.superclass

if(C != null) {
if(!C.jupiterTestMethods().isEmpty()) {
return createJUnit5Runner(testClass)
}
}
}

return null
}

Expand Down