- 浏览: 22117070 次
- 性别:
- 来自: 杭州
最新评论
-
ZY199266:
配置文件还需要额外的配置ma
Android 客户端通过内置API(HttpClient) 访问 服务器(用Spring MVC 架构) 返回的json数据全过程 -
ZY199266:
我的一访问为什么是 /mavenwebdemo/WEB-I ...
Android 客户端通过内置API(HttpClient) 访问 服务器(用Spring MVC 架构) 返回的json数据全过程 -
lvgaga:
我又一个问题就是 如果像你的这种形式写。配置文件还需要额外的 ...
Android 客户端通过内置API(HttpClient) 访问 服务器(用Spring MVC 架构) 返回的json数据全过程 -
lvgaga:
我的一访问为什么是 /mavenwebdemo/WEB-I ...
Android 客户端通过内置API(HttpClient) 访问 服务器(用Spring MVC 架构) 返回的json数据全过程 -
y1210251848:
你的那个错误应该是项目所使用的目标框架不支持吧
log4net配置(web中使用log4net,把web.config放在单独的文件中)
Instrumentation Testing
In this document
* Instrumentation Framework
* Platform Test Suites
* Running Tests
* Writing Tests
* Troubleshooting
This document describes how to use the Instrumentation Framework to write test cases. Instrumentation testing allows you to verify a particular feature or behavior with an automated JUnit TestCase. You can launch activities and providers within an application, send key events, and make assertions about various UI elements.
You should have a working knowledge of the following:
* Android Application Framework
* Using adb, am and various logging functionality
* A brief understanding of the application of interest, that is, the names of the classes which handle the intents etc.
* JUnit testing.
Each Android application runs in its own process. Instrumentation kills the application process and restarts the process with Instrumentation. Instrumentation gives a handle to the application context used to poke around the application to validate test assertions, allowing you to write test cases to test applications at a much lower level than UI screen shot tests. Note that Instrumentation cannot catch UI bugs.
Instrumentation Framework
Classes
The following classes help glue together Instrumentation with JUnit testing.
Class Description
InstrumentationTestCase
This extends the standard JUnit TestCase and offers access to an Instrumentation class. Write tests inside your instrumentation class any way you see fit. For example, your test might launch activities and send key events. For this to work properly, the instrumentation needs to be injected into the test case.
InstrumentationTestRunner The instrumentation test runner is an instrumentation that runs instrumentation test cases and injects itself into each test case. Instrumentation test cases need to be grouped together with an instrumentation test runner with the appropriate target package.
InstrumentationTestSuite The instrumentation test suite is a simple extension of the standard JUnit TestSuite that keeps a member Instrumentation variable on hand to inject into each TestCase before running them. It is used by InstrumentationTestRunner.
Three additional base classes extend InstrumentationTestCase to allow you to test Activity and Provider classes:
Class Description
ActivityTestCase
This class can be used to write tests for a specific activity. An activity is launched in its setUp() method and finished with tearDown. If you write a test case that extends ActivityTestCase, you can write tests that access the activity using getActivity() and assume it has been set up properly.
ServiceTestCase This test case provides a framework in which you can test Service classes in a controlled environment. It provides basic support for the lifecycle of a Service, and hooks by which you can inject various dependencies and control the environment in which your Service is tested.
SingleLaunchActivityTestCase This class is similar to ActivityTestCase except that the activity is launched once per class instead of every time the test case calls setup.
ProviderTestCase This class is similar to ActivityTestCase except that it will setup, tear down, and provide access to the Provider of your choice.
Understanding the am Command
The am command is a command-line interface to the ActivityManager (see http://code.google.com/android/reference/android/app/ActivityManager.html for details). am is used to start and instrument activities using the adb shell command, as shown in the snippet below:
> adb shell am
usage: am [start|instrument]
am start [-a <action>] [-d </action>
相关推荐
5. **Instrumentation Testing**:这是Android的原生测试框架,用于在设备或模拟器上执行更全面的集成测试。"InstrumentationTest"目录可能包含了如何设置和运行基于Instrumentation的测试的步骤。 6. **AndroidX ...
5. **Instrumentation Testing**: Android的测试模型是基于Instrumentation的,意味着测试代码运行在目标设备或模拟器上,与应用的主进程并行执行。这允许对实际运行环境进行精确的测试。 **使用步骤:** 1. **...
Wyant的Optical Testing and Testing Instrumentation课程对光学测试和测试仪器进行了全面的介绍。在这篇笔记中,我们将概括光学测试的基本概念和技术,并对James C. Wyant的课程进行总结。 一、基本干涉仪器 ...
Instrumentation Testing 107 In this document 107 Instrumentation Framework 108 Platform Test Suites 109 Running Tests 110 Writing Tests 114 Debugging with GDB 116 In this document 116 Debugging 117 ...
11. **Unit Testing & Instrumentation Testing**:为了确保代码质量,源码可能包含了测试用例,展示了如何进行单元测试和Instrumentation测试。 12. **Android Studio IDE**:Android开发主要使用Android Studio,...
12. **Unit Testing & Instrumentation Testing**:为了确保应用的质量,开发者可能编写了单元测试和Instrumentation测试,位于`app/src/test`和`app/src/androidTest`目录下。 13. **Android Permissions**:应用...
12. **Unit Testing & Instrumentation Testing**:通过JUnit和Espresso等工具进行应用的测试,确保代码的质量和功能的正确性。 13. **Release Process**:完成开发后,需要对应用进行签名,优化APK大小,然后发布...
2. 仪器化测试(Instrumentation Testing):通过Android SDK的Instrumentation API,可以在真实设备或模拟器上运行测试代码,直接控制应用的生命周期。JUnit4和 Espresso 是常见的Android仪器化测试工具,Espresso...
11. **Unit Testing and Instrumentation Testing**: 为了确保代码质量,源码可能包含了测试用例,对各个模块进行单元测试和集成测试。 12. **Gradle Build System**: Android项目通常使用Gradle作为构建工具,用于...
13. **Unit Testing** 和 **Instrumentation Testing**:确保代码质量和功能正确性的测试方法。 通过分析这个压缩包,开发者或学生可以深入学习Android应用开发,了解如何使用拖放控件实现用户友好的界面,以及如何...
12. **Unit Testing and Instrumentation Testing**:为了确保代码质量,项目可能包含测试代码,使用JUnit进行单元测试,以及 Espresso 进行UI自动化测试。 13. **Android Studio**:这是Google提供的官方集成开发...
5. **仪器测试(Instrumentation Testing)**:这种测试需要Android SDK的Instrumentation API,可以在真机或模拟器上运行,执行更复杂的测试,包括应用程序的完整生命周期管理和设备交互。 6. **Mockito**:在...
10. **测试与调试**:Android Studio提供了丰富的测试工具,如单元测试、仪器测试(Instrumentation Testing),以及调试工具,帮助开发者确保应用的质量和性能。 11. **发布流程**:完成应用开发后,需要打包成APK...
10. **Unit Testing/Instrumentation Testing**: 用于验证应用功能的测试框架,如 JUnit 和 Espresso,确保代码质量。 11. **Material Design**: Google 提倡的界面设计指南,提供了一套统一的视觉元素和交互规范,...
11. **Android测试**:涵盖单元测试、UI测试、仪器测试(Instrumentation Testing)等,是保证应用质量的重要环节。 12. **Gradle构建系统**:Android项目通常使用Gradle进行构建,理解Gradle脚本和依赖管理是必要...
在“android-testing-master”这个压缩包中,包含了关于这两种测试方式的实例代码,开发者可以通过阅读和运行这些代码来实践和学习: 1. UIAutomator的用法:可以找到使用UIAutomator编写的测试类,这些类通常以"Ui...
9. **Unit Testing & Instrumentation Testing**:为了确保代码质量,Stocked可能会包含单元测试和集成测试,使用JUnit、Mockito等工具进行测试。 10. **Gradle Build System**:Stocked的构建系统基于Gradle,通过...
10. **Unit Testing与Instrumentation Testing**:为了确保代码质量,项目可能包含了单元测试和针对Android设备的集成测试。 通过对"Bodomemo"项目中的Kotlin技术和潜在架构的分析,我们可以看到一个全面的Android...
8. **Unit Testing 和 Instrumentation Testing**:作为一个测试工具,TestMessenger 应该包含相应的测试代码。Kotlin 支持 JUnit 和 Espresso 等测试框架,用于单元测试和 UI 测试。 9. **Gradle Build System**:...