-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error message for Robolectric.buildActivity()
if provided an abstract class
#8997
Comments
@david-allison I have tried it with Java's abstract class, and compiler prohibit I pass the abstract class extends from |
seems reproducible in Java package com.ichi2.anki.dialogs.tags;
import android.app.Activity;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import androidx.test.ext.junit.runners.AndroidJUnit4;
@RunWith(AndroidJUnit4.class)
public class ActivityJavaTest {
@Test
public void robolectricTest() {
Robolectric.buildActivity(TestActivity.class);
}
}
abstract class TestActivity extends Activity {
}
|
Thanks. I will try it again. Looks like Android Studio gives me wrong hints. |
@david-allison You can try it with 4.13 snapshot tomorrow or wait 4.13 stable. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
A developer wanted help with their code producing the following error message
Kotlin
Stack Trace
Describe the solution you'd like
The error message should state that the provided class is abstract (and that abstract classes are not supported)
Describe alternatives you've considered
N/A
Additional context
Sample
isAbstract
checking codehttps://stackoverflow.com/a/1072895
robolectric/shadowapi/src/main/java/org/robolectric/util/ReflectionHelpers.java
Lines 446 to 469 in 76048c0
The text was updated successfully, but these errors were encountered: