0

I am following the steps exactly as mentioned here to create instrumentation unit test cases. This is my Test class in the androidTest->Java->com.mypackage.name package

@RunWith(AndroidJUnit4.class)
@SmallTest
public class Test {

  private List<String> list;
  @Before
  public void initList(){
    list = new ArrayList<>();
  }

  @org.junit.Test
  public void searchPlace() {
    assert list.size() == 0;

  }
}

But when I execute this test case, I get a message saying

Process finished with exit code 1
Class not found: "com.package.base.Test"Empty test suite.

Is there anything that I am doing wrong?

Ashwin
  • 12,691
  • 31
  • 118
  • 190

2 Answers2

0

I've seen this error when the test instrumentation runner isn't set correctly. It should be set to android.support.test.runner.AndroidJUnitRunner in the build file. Also double-check the class package name is correct in the test configuration.

Kevin Brotcke
  • 3,765
  • 26
  • 34
0

This happens if you Cut-Paste the test from Unit to Instrumental. Simply goto Main menu -> Run -> Debug -> Edit config... Delete old and broken tests. And re-run.

tim4dev
  • 2,846
  • 2
  • 24
  • 30