共 12 篇文章
显示摘要每页显示  条
单元测试相关的一些文档EasyMock:EasyMock 使用方法与原理剖析。使用 EasyMock 更轻松地进行测试。@skydream写的EasyMock教程。Spring TestContext Framework:官方文档。使用 Spring 2.5 TestContext 测试框架。Junit官网。JUnit Cookbook.Unit Testing with Stubs and Mocks.Mocks Aren''t Stubs.不要把Mock当作你的设计利器。
//将需要排序的mock对象放入InOrder InOrder inOrder = inOrder(list,list2); //下面的代码不能颠倒顺序,验证执行顺序 inOrder.verify(list).add(1); inOrder.verify(list2).add("hello"); inOrder.verify(list).add(2); inOrder.verify(list2).add("world"); } 7、确保模拟对象上无互动...
Android测试基础整理篇Android test framework转载请注明来自:http://blog.csdn.net/liaoqianchuan00/article/details/23032357.注意:android.test.ActivityInstrumentationTestCase从Android1.5开始已经不建议使用了,可以是用android.test.ActivityInstrumentationTestCase2替代。package com.vogella.android.test.simpleactivity.test;im...
If you use the same package names to name the packages of your class, and this is a fairly common and intuitive practice, then you will face a big trouble : you will only be able to test your public methods : a test class inside a package named foo.bar.tests won’t be able to access the private and protected methods o...
//To make mockito work System.setProperty("dexmaker.dexcache", mContext.getCacheDir().toString());public void testStartActivity() { Intent intent = new Intent(Intent.intent.putExtra(Intent.mReceiver.onReceive(mContext, intent);ArgumentCaptor<Intent> argument = ArgumentCapt...
Emma如何实现Android黑盒手工测试的代码覆盖率?本文app package为com.example.android.snake,假设工程文件位置为C:\Workspace\Snake。2)Eclipse中打开Snake工程,src下面新建一个package为com.example.android.snake.EmmaInstrument。3)将step1的四个文件拷贝到C:\Workspace\Snake\src\com\example\android\snake\EmmaInstrument下。adb she...
[android]android自动化测试十一之代码覆盖率报告EMMA以下代码时监听测试程序结束后将Emma测试报告写入到虚拟机上,然后可以使用adb pull命令发送至硬盘上,这里需要测试程序集成Emma jar包,并需要修改ant build文件。
Android Service Test 前两篇文章对Android Service和ServiceTestCase做了简单的分析,在本文中将一步步实现对一个Service的测试,由于参考的资料非常有限,大部分都是自己研究摸索的,不保证正确性。import android.app.public class MyService extends Service {1.在ECLIPSE中运行File>New >Project >Android >Android Tes...
><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hustophone.sample" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> ...
结合junit + ant + emma实现Android项目单元测试代码覆盖率统计。设置对应于Demo项目的测试项目名为:DemoTest.assertTrue("Add result should be "+ ADD_NEGATIVE_RESULT + "but was "+ mathResult, mathResult.equals(ADD_NEGATIVE_RESULT));4.用ant编译一个覆盖率统计版,运行并得到测试项目对于应用项目的代码覆盖率...
帮助 | 留言交流 | 联系我们 | 服务条款 | 下载网文摘手 | 下载手机客户端
北京六智信息技术股份有限公司 Copyright© 2005-2024 360doc.com , All Rights Reserved
京ICP证090625号 京ICP备05038915号 京网文[2016]6433-853号 京公网安备11010502030377号
返回
顶部