Skip to content Skip to sidebar Skip to footer

Junit 4 Runner In Android Test Project "sample Project"

Provide me Android sample test project with only 2-3 java files,by using JUnit 4. I was trying to do this. My main test file. import org.junit.runner.RunWith; import org.junit.runn

Solution 1:

The following steps worked for me:

  1. Create new JUnit (and NOT "Android Junit Test") Testconfiguration: enter image description here
  2. Add a new test launcher: enter image description here
  3. Choose the following launcher: enter image description here

With this configuration I can run my unit tests. They run on the pc and not on the phone. Hope this helps.

Solution 2:

You don't have any @Test methods.

Add:

@Testpublicvoidtest()  {
    //Test code here
}

Post a Comment for "Junit 4 Runner In Android Test Project "sample Project""