2

I am writing unit tests. I am extending the unit tests classes from ActivityInstrumentationTestCase2. I was running tests finely. But I don't know what happened. Now when I am running unit test are not running and it throws following exception

`No tests were found`

Please Help.

Here is my unit test class

public class UnitTest extends ActivityInstrumentationTestCase2<TREResults> {
    TREResults trainingReinforcementResults;

    public UnitTest(Class<TREResults>activityClass) {
        super(activityClass);
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        trainingReinforcementResults= getActivity();
    }
    public void testDownLoadTRESetting(){
    String userId = trainingReinforcementResults.getUS_USER_ID();
    Realm realm = 
    RealmSaveRestoreHelper.initRealm(trainingReinforcementResults);
    TRESettingsModelTest treSettings = 
    realm.where(TRESettingsModelTest.class).contains("userId", 
    userId).findFirst();`
    realm.beginTransaction();
    treSettings = realm.createObject(TRESettingsModelTest.class);
    treSettings.userId = userId;
    realm.commitTransaction();


}
    @Override
    protected void tearDown() throws Exception {
        super.tearDown();
    }
Vladyslav Matviienko
  • 10,610
  • 4
  • 33
  • 52
Basit Ali
  • 81
  • 10

1 Answers1

0

Are you using JUnit3? Whysetup() and tearDown() methods are protected? Shouldn't they be public?

azizbekian
  • 60,783
  • 13
  • 169
  • 249
Venkat
  • 56
  • 4