zoukankan      html  css  js  c++  java
  • Android CTS 结果 testResult.xml 修改 fail 项 为 notExecuted 项 分析

    这两天一直在搞 Android 4.1 CTS ,每次完整跑完一遍后总有几百项 failed,用编辑器手动改为 notExecuted 项后重新跑,有很多项第二次都跑过了。

    但是发现直接修改也带来很多问题。如下:

    1. 最初是这样的

    <Test name="testVolume" result="fail" starttime="Thu Jun 13 22:41:08 CST 2013" endtime="Thu Jun 13 22:41:10 CST 2013">
    <FailedScene message="junit.framework.AssertionFailedError: expected:<2> but was:<1>
    at android.media.cts.AudioManagerTest.testVolume(AudioManagerTest.java:337)
    ">
    <StackTrace>junit.framework.AssertionFailedError: expected:<2> but was:<1>
    at android.media.cts.AudioManagerTest.testVolume(AudioManagerTest.java:337)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
    at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
    at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
    at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1584)
    </StackTrace>
    </FailedScene>
    </Test>


    2. 然后我直接修改 result="fail" 为 result="notExecuted",重新全部跑了一遍后,虽然这条执行通过了,但是:

    <Test name="testVolume" result="pass" starttime="Thu Jun 13 22:41:08 CST 2013" endtime="Thu Jun 13 22:41:10 CST 2013">

    <FailedScene message="junit.framework.AssertionFailedError: expected:<2> but was:<1>
    at android.media.cts.AudioManagerTest.testVolume(AudioManagerTest.java:337)
    ">
    <StackTrace>junit.framework.AssertionFailedError: expected:<2> but was:<1>
    at android.media.cts.AudioManagerTest.testVolume(AudioManagerTest.java:337)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
    at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
    at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
    at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1584)
    </StackTrace>
    </FailedScene>
    </Test>

    可以看到仅仅是结果 改掉了,其他第一次运行时失败信息却保留了下来。。

    这样似乎是有点问题的。于是我在 linux 下面写了一个 小程序,用于 修改 testResult.xml。完美解决问题。

    源码下载地址:


    http://download.csdn.net/detail/langrenyijiu/5627199



  • 相关阅读:
    相对路径与绝对路径问题
    javaee自定义servlet的步骤
    Struts1.X与Spring集成——另外一种方案
    菜鸟也能学cocos2dx3.0 浅析刀塔传奇(下)
    JAVA之了解类载入器Classloader
    IOS 编程中引用第三方的方类库的方法及常见问题
    通过eclipse的egit插件提交提示Auth fail
    定时器0的方式1 定时器1的方式1 数码管和led
    MongoDB入门学习(四):MongoDB的索引
    J2EE--JDBC
  • 原文地址:https://www.cnblogs.com/dyllove98/p/3149520.html
Copyright © 2011-2022 走看看