-
Notifications
You must be signed in to change notification settings - Fork 331
Closed
Description
Description
In an instrumentation test class which is to run as a Parameterized test, if any of the parameters is an enum value and {0}
, {1}
etc is used in the Parameterized.Parameters.name pattern, then Android Test Orchestrator fails to run the parameterized test and throws a ClassNotFoundException with a message of "Invalid name"
.
Steps to Reproduce
- Define a parameterized test class in the
androidTest
folder of an Android project. - Ensure that one of the parameters is an enum value.
- Set the Parameterized.Parameters.name value (which is passed into the Parameterized.Parameters annotation) to
"{0}"
. - Add
testOptions.execution 'ANDROIDX_TEST_ORCHESTRATOR'
to the Android project'sbuild.gradle
file so that the instrumentation tests run with Android Test Orchestrator. - Run the test class.
Expected Results
The parameterized tests runs fine.
Actual Results
The parameterized tests throw ClassNotFoundException with a message of "Invalid name"
.
AndroidX Test and Android OS Versions
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestUtil 'androidx.test:orchestrator:1.3.0'
Attempted with an Android 5.1, Android 10.0 and Android 11.0 emulator. All exhibit the same behaviour.
Link to a public git repo demonstrating the problem:
See the BadParameterizedTest.kt, GoodParameterizedTest.kt and build.gradle files in particular.
Metadata
Metadata
Assignees
Labels
No labels