* * * * * */publi">
当前位置:   article > 正文

android测试类Test

android测试类Test

测试类(见天气预报项目)

/**

 * 在清单文件里进行配置

 * <!--配置test工具类第1步-->

 * <application在本标签外配置

 *<instrumentation

 *    android:name="android.test.InstrumentationTestRunner"

 *     android:targetPackage="com.example.weather">   

 *</instrumentation>

*

 * <!--配置test工具类第2步-->

 * <application在本标签内配置

 *<uses-library android:name="android.test.runner"/>

 */

publicclassTest extendsAndroidTestCase {

   /*

    * 在方法里添加测试内容

    */

   publicvoid test(){

     

      HttpUtil.loadWeather(mContext, "guangzhou",newOnLoadWeatherFinash() {

        

         @Override

         publicvoid onFinish(WeatherBeanweatherBean) {

            // TODO Auto-generated method stub

            Log.d("TAG",weatherBean.toString());

           

         }

      });

   }

}

 

test工具类使用

1)清单文件中配置instrumentation

2)在Application里面,Activity外面

加上uses-library

3)创建一个Test类

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/木道寻08/article/detail/925538
推荐阅读
相关标签
  

闽ICP备14008679号