Skip to content
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

Unit test - No runnable methods in LoaderTestCase, ObaLoaderTestCase, and ObaTestCase #881

Closed
barbeau opened this issue May 25, 2018 · 0 comments
Labels
Milestone

Comments

@barbeau
Copy link
Member

barbeau commented May 25, 2018

Summary:

For the superclasses of the the unit tests, LoaderTestCase, ObaLoaderTestCase, and ObaTestCase, when running "All Tests" in Android Studio I get the below stack trace:

java.lang.Exception: No runnable methods
at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191)
at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128)
at org.junit.runners.ParentRunner.validate(ParentRunner.java:416)
at org.junit.runners.ParentRunner.<init>(ParentRunner.java:84)
at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:65)
at android.support.test.internal.runner.junit4.AndroidJUnit4ClassRunner.<init>(AndroidJUnit4ClassRunner.java:39)
at android.support.test.runner.AndroidJUnit4.<init>(AndroidJUnit4.java:49)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
at android.support.test.internal.runner.junit4.AndroidAnnotatedBuilder.buildAndroidRunner(AndroidAnnotatedBuilder.java:71)
at android.support.test.internal.runner.junit4.AndroidAnnotatedBuilder.runnerForClass(AndroidAnnotatedBuilder.java:48)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at android.support.test.internal.runner.AndroidRunnerBuilder.runnerForClass(AndroidRunnerBuilder.java:153)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at android.support.test.internal.runner.TestLoader.doCreateRunner(TestLoader.java:73)
at android.support.test.internal.runner.TestLoader.getRunnersFor(TestLoader.java:104)
at android.support.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:789)
at android.support.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:539)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:382)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2106)

I believe this is just a configuration issue - we need to tell AndroidJUnit4ClassRunner not to treat these classes as runnable unit tests

Steps to reproduce:

  1. Right-click on the androidTest/java folder
  2. Click "Run 'All Tests'"

Expected behavior:

All unit tests run should pass

Observed behavior:

LoaderTestCase, ObaLoaderTestCase, and ObaTestCase have an initialization error with java.lang.Exception: No runnable methods

Device and Android version:

Master branch as of 144d045, with Android Studio 3.1.2

@barbeau barbeau added the bug label May 25, 2018
@barbeau barbeau added this to the v2.3.x milestone May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant