【发布时间】:2016-09-02 09:22:08
【问题描述】:
我在这里注释了我的课程
@RunWith(AndroidJUnit4.class)
public class WorkdayProviderTest
此外,还像这样注释了我的测试方法
@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'
如何解决这个问题?
【问题讨论】:
标签: android android-testing android-junit