Stay organized with collections
Save and categorize content based on your preferences.
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-05-15 UTC.
[null,null,["Last updated 2025-05-15 UTC."],[],[],null,["# androidx.test.ext.junit.rules\n=============================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/androidx/test/ext/junit/rules/package-summary \"View this page in Kotlin\") \\|Java\n\nClasses\n-------\n\n|---------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ActivityScenarioRule](/reference/androidx/test/ext/junit/rules/ActivityScenarioRule) | ActivityScenarioRule launches a given activity before the test starts and closes after the test. |\n| [ActivityScenarioRuleKt](/reference/androidx/test/ext/junit/rules/ActivityScenarioRuleKt) | |\n| [AppComponentFactoryRule](/reference/androidx/test/ext/junit/rules/AppComponentFactoryRule) | JUnit [Rule](https://junit.org/junit4/javadoc/4.12/org/junit/Rule.html) that let you define a [AppComponentFactory](https://developer.android.com/reference/android/app/AppComponentFactory.html) before the tests starts and clean-up the factory after the test. |\n| [DeleteFilesRule](/reference/androidx/test/ext/junit/rules/DeleteFilesRule) | Deletes files recursively in Android storage directories after each test. |"]]