AndroidJUnit4
This package is part of the
Android support library which
is no longer maintained.
The support library has been superseded by AndroidX
which is part of Jetpack .
We recommend using the AndroidX libraries in all new projects. You should also consider
migrating existing projects to AndroidX.
To find the AndroidX class that maps to this deprecated class, see the AndroidX
support library class
mappings .
public
final
class
AndroidJUnit4
extends Runner
implements
Filterable,
Sortable
java.lang.Object
↳
org.junit.runner.Runner
↳
android.support.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 (Class <?> klass, AndroidRunnerParams runnerParams)
Constructs a new instance of the default runner
AndroidJUnit4 (Class <?> klass)
Used when executed with standard junit runner.
Inherited methods
From
class
org.junit.runner.Runner
abstract
Description
getDescription()
abstract
void
run(RunNotifier arg0)
int
testCount()
From
class
java.lang.Object
Object
clone()
boolean
equals(Object arg0)
void
finalize()
final
Class <?>
getClass()
int
hashCode()
final
void
notify()
final
void
notifyAll()
String
toString()
final
void
wait(long arg0, int arg1)
final
void
wait(long arg0)
final
void
wait()
From
interface
org.junit.runner.Describable
abstract
Description
getDescription()
From
interface
org.junit.runner.manipulation.Filterable
abstract
void
filter(Filter arg0)
From
interface
org.junit.runner.manipulation.Sortable
abstract
void
sort(Sorter arg0)
Public constructors
AndroidJUnit4
AndroidJUnit4 (Class <?> klass,
AndroidRunnerParams runnerParams)
Constructs a new instance of the default runner
Parameters
klass
Class
runnerParams
AndroidRunnerParams
Throws
InitializationError
AndroidJUnit4
AndroidJUnit4 (Class <?> klass)
Used when executed with standard junit runner. Will attempt to delegate to
RobolectricTestRunner or delegate provided by android.junit.runner system property.
Throws
InitializationError
Public methods
filter
void filter (Filter filter)
Throws
NoTestsRemainException
getDescription
Description getDescription ()
run
void run (RunNotifier runNotifier)
Parameters
runNotifier
RunNotifier
sort
void sort (Sorter sorter)
Content and code samples on this page are subject to the licenses described in the Content License . Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[]]