я аннотированный мой класс, как здесьAndroidJUnit4 тест не нашел
@RunWith(AndroidJUnit4.class)
public class WorkdayProviderTest
Futhermore, аннотированный также мой метод испытания, как этот
@Test
public void insert_dataInsertsCorrectly()
Наконец, настроил мой build.gradle defaultConfig и зависимостей, как этот
defaultConfig {
applicationId 'com.jueggs.workinghours'
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
androidTestCompile "junit:junit:4.12"
androidTestCompile "com.android.support:support-annotations:23.3.0"
androidTestCompile "com.android.support.test:runner:0.4.1"
androidTestCompile "com.android.support.test:rules:0.4.1"
androidTestCompile "com.android.support.test.espresso:espresso-core:2.2.1"
androidTestCompile "com.android.support.test.espresso:espresso-contrib:2.2.1"
androidTestCompile "org.hamcrest:hamcrest-library:1.3"
и сконфигурировали тестовый прогон следующим образом:
и подмигнули говорит мне
No tests were found
Test running failed: Instrumentation run failed due to 'java.lang.ClassNotFoundException'
Как исправить эту проблему?
yes У меня есть эти зависимости, см. update – Lemao1981
delete '@RunWith (AndroidJUnit4.class)' и запустить тест. Вы также можете изменить '@RunWith (AndroidJUnit4.class)' с '@RunWith (JUnit4.class)' и он должен работать. – piotrek1543
не решает проблему, в обоих случаях не удается найти какой-либо тест. в версии 0.4.1 класс AndroidJUnit4 существует – Lemao1981