{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

AndroidJUnit4

class AndroidJUnit4 : Runner, Filterable, Sortable

kotlin.Any
   ↳ org.junit.runner.Runner
     ↳ androidx.test.runner.AndroidJUnit4

Aliases the current default Android JUnit 4 class runner, for future-proofing. If future versions of JUnit change the default Runner class, they will also change the definition of this class. Developers wanting to explicitly tag a class as an Android JUnit 4 class should use @RunWith(AndroidJUnit4.class)

Summary

Public constructors

AndroidJUnit4(klass: Class<Any!>!)

Used when executed with standard junit runner.

Public functions

Unit
filter(filter: Filter!)
Description!
Unit
run(runNotifier: RunNotifier!)
Unit
sort(sorter: Sorter!)

Inherited functions

From class org.junit.runner.Runner

Public constructors

AndroidJUnit4

AndroidJUnit4(klass: Class<Any!>!)

Used when executed with standard junit runner. Will attempt to delegate to RobolectricTestRunner or delegate provided by android.junit.runner system property.

Public functions

filter

fun filter(filter: Filter!): Unit
Throws
org.junit.runner.manipulation.NoTestsRemainException: org.junit.runner.manipulation.NoTestsRemainException

getDescription

fun getDescription(): Description!

run

fun run(runNotifier: RunNotifier!): Unit

sort

fun sort(sorter: Sorter!): Unit