0
這裏是在build.gradle
文件中的配置:Android的 - 空測試套件(AbstractMethodError)
testCompile 'junit:junit:4.12'
androidTestCompile('com.android.support:multidex-instrumentation:1.0.1') {
exclude group: 'com.android.support', module: 'multidex'
}
androidTestCompile 'com.android.support:support-annotations:24.2.1'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.6.3'
androidTestCompile 'com.squareup.okhttp3:mockwebserver:3.4.1'
androidTestCompile 'com.google.truth:truth:0.30'
androidTestCompile 'com.github.ignaciotcrespo:frutilla:0.7.1'
androidTestCompile 'org.mockito:mockito-core:2.2.9'
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
androidTestCompile 'com.squareup.okhttp3:okhttp-testing-support:3.4.1'
開始all my tests,或者乾脆one of them如:
@Test
public void test_Parse_JSONRepo_ParsesRepoDTO() throws IOException {
ObjectMapper loJSONMapper = new ObjectMapper();
String lsRepoData = mLocalifyClient.localify().loadRawFile(R.raw.repo_octocat);
DTORepo loRepoDTO = loJSONMapper.readValue(lsRepoData, DTORepo.class);
assertThat(loRepoDTO).isNotNull();
assertThat(loRepoDTO.name).isEqualTo("git-consortium");
}
我拿到Android的以下信息工作室:
Started running tests
Test running failed: Instrumentation run failed due to 'java.lang.AbstractMethodError'
Empty test suite.
加上一個使用這個詞簡潔的和一個好主意 – JPM