[英]Maven won't run Android instrumentation tests
How should Android instrumentation tests be run for automatic testing with jayway's maven-android-plugin? 如何使用Jayway的maven-android-plugin进行Android工具测试以进行自动测试?
I checked out apidemos-android-16 and ran them with mvn clean install
, but only 7 unit tests were executed. 我签出了apidemos-android-16并使用
mvn clean install
运行了它们,但是仅执行了7个单元测试。 Focus2ActivityTest
for example didn't run. 例如,
Focus2ActivityTest
没有运行。 mvn android:instrument
gives the same results. mvn android:instrument
给出相同的结果。
The Maven output: Maven输出:
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter not set, using all attached devices
[INFO] Emulator emulator-5554_myDefaultAVD_unknown_google_sdk found.
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : Successfully installed C:\dev\jayway-maven-android-plugin-samples\apidemos-android-16\instrumen
tationtests\target\instrumentationtests-1.0.0-SNAPSHOT.apk to emulator-5554_myDefaultAVD_unknown_google_sdk
[INFO]
[INFO] --- android-maven-plugin:3.7.0:internal-integration-test (default-internal-integration-test) @ instrumentationtests ---
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter not set, using all attached devices
[INFO] Emulator emulator-5554_myDefaultAVD_unknown_google_sdk found.
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : Running instrumentation tests in com.example.android.apis.tests
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : Run started: com.example.android.apis.tests, 7 tests:
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : Start [1/7]: com.example.android.apis.ApiDemosApplicationTests#testPreconditions
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : End [1/7]: com.example.android.apis.ApiDemosApplicationTests#testPreconditions
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : Start [2/7]: com.example.android.apis.app.LocalServiceTest#testPreconditions
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : End [2/7]: com.example.android.apis.app.LocalServiceTest#testPreconditions
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : Start [3/7]: com.example.android.apis.app.LocalServiceTest#testStartable
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : End [3/7]: com.example.android.apis.app.LocalServiceTest#testStartable
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : Start [4/7]: com.example.android.apis.os.MorseCodeConverterTest#testCharacterS
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : End [4/7]: com.example.android.apis.os.MorseCodeConverterTest#testCharacterS
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : Start [5/7]: com.example.android.apis.view.Focus2AndroidTest#testGoingLeftFromRightButtonGoesToCent
er
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : End [5/7]: com.example.android.apis.view.Focus2AndroidTest#testGoingLeftFromRightButtonGoesToCenter
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : Start [6/7]: com.example.android.apis.view.Focus2AndroidTest#testGoingRightFromLeftButtonJumpsOverC
enterToRight
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : End [6/7]: com.example.android.apis.view.Focus2AndroidTest#testGoingRightFromLeftButtonJumpsOverCen
terToRight
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : Start [7/7]: com.example.android.apis.view.Focus2AndroidTest#testPreconditions
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : End [7/7]: com.example.android.apis.view.Focus2AndroidTest#testPreconditions
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : Run ended: 212 ms
[INFO] Tests run: 7, Failures: 0, Errors: 0
[INFO] emulator-5554_myDefaultAVD_unknown_google_sdk : Report file written to C:\dev\jayway-maven-android-plugin-samples\apidemos-android-16\instrumen
tationtests\target\surefire-reports\TEST-emulator-5554_myDefaultAVD_unknown_google_sdk.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:05.798s
[INFO] Finished at: Tue Oct 15 22:26:49 CEST 2013
[INFO] Final Memory: 23M/350M
[INFO] ------------------------------------------------------------------------
My maven version: 我的Maven版本:
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 14:51:28+0100)
Apache Maven 3.0.5(r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 14:51:28 + 0100)
Maven home: C:\\dev\\apache-maven-3.0.5\\bin..Maven主页:C:\\ dev \\ apache-maven-3.0.5 \\ bin ..
Java version: 1.7.0_25, vendor: Oracle CorporationJava版本:1.7.0_25,供应商:Oracle Corporation
Java home: C:\\Program Files\\Java\\jdk1.7.0_25\\jreJava主页:C:\\ Program Files \\ Java \\ jdk1.7.0_25 \\ jre
Default locale: de_DE, platform encoding: Cp1252默认语言环境:de_DE,平台编码:Cp1252
OS name: "windows 8", version: "6.2", arch: "amd64", family: "windows"操作系统名称:“ windows 8”,版本:“ 6.2”,拱门:“ amd64”,家族:“ windows”
I tried several configuration changes in pom.xml without success. 我在pom.xml中尝试了几次配置更改,但没有成功。 What's wrong?
怎么了?
I believe it is working correctly. 我相信它工作正常。 The reason that the activity tests are not run is that they are "medium" tests and the test configuration is configured to only run "small" tests.
活动测试未运行的原因是它们是“中等”测试,并且测试配置被配置为仅运行“小型”测试。
See https://github.com/jayway/maven-android-plugin-samples/blob/master/apidemos-android-16/instrumentationtests/pom.xml 参见https://github.com/jayway/maven-android-plugin-samples/blob/master/apidemos-android-16/instrumentationtests/pom.xml
Specifically 特别
<configuration>
<test>
<testSize>small</testSize>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.