Cts框架解析(12)-ITargetPreparer
測试开启前的设备系统准备工作。
接口
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.tradefed.targetprep; import com.android.tradefed.build.IBuildInfo;
import com.android.tradefed.device.DeviceNotAvailableException;
import com.android.tradefed.device.ITestDevice; /**
* Prepares the test environment for the test run.
* <p/>
* For example, installs software, tweaks env settings for testing, launches targets etc.
* <p/>
* Note that multiple {@link ITargetPreparer} can specified in a configuration. It is recommended
* that each ITargetPreparer clearly document its expected environment pre-setup and post-setUp.
* e.g. a ITargetPreparer that configures a device for testing must be run after the ITargetPreparer
* that installs software.
*/
public interface ITargetPreparer { /**
* Perform the target setup for testing.
*
* @param device the {@link ITestDevice} to prepare.
* @param buildInfo data about the build under test.
* @throws TargetSetupError if fatal error occurred setting up environment
* @throws DeviceNotAvailableException if device became unresponsive
*/
public void setUp(ITestDevice device, IBuildInfo buildInfo) throws TargetSetupError,
BuildError, DeviceNotAvailableException;
}
就一个方法:setUp(),比方你要安装系统、安装apk或者其它都是case要求的安装事务都要在这种方法中完毕。
实现类
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.tradefed.targetprep; import com.android.ddmlib.Log;
import com.android.tradefed.build.IBuildInfo;
import com.android.tradefed.device.ITestDevice; /**
* Placeholder empty implementation of a {@link ITargetPreparer}.
*/
public class StubTargetPreparer implements ITargetPreparer { /**
* {@inheritDoc}
*/
@Override
public void setUp(ITestDevice device, IBuildInfo buildInfo) throws TargetSetupError {
Log.d("TargetPreparer", "skipping target prepare step");
}
}
这个类里面的方法就是打印了一句话。没做不论什么处理。可是真正要是满足自己特定的需求就要自己写一个类继承与该接口才行。
Cts框架解析(12)-ITargetPreparer的更多相关文章
- Cts框架解析(2)-cts调试环境的搭建
上一篇文章中说了怎样在windows搭建cts以及执行cts进行測试.这篇文章来讲讲怎样在eclipse中配置源代码,进行debug调试. 下载 cts源代码地址:https://android.go ...
- Cts框架解析(8)-IBuildProvider
IBuildProvider接口中定义了三个方法 /* * Copyright (C) 2010 The Android Open Source Project * * Licensed under ...
- Cts框架解析(7)-任务运行的调度室
TestInvocation /** * {@inheritDoc} */ @Override public void invoke(ITestDevice device, IConfiguratio ...
- Cts框架解析(6)-任务的运行
前两篇讲了任务的加入和9大项配置,这篇讲任务的运行. 任务的运行 任务的运行在CommandScheduler的run方法中,所以删除全部的断点,在run方法中打上断点,重新启动启动debug: 先看 ...
- Cts框架解析(1)-windows下cts配置
环境搭建 下载 cts工具的下载地址:http://source.android.com/compatibility/downloads.html windows选择Android4.4 R3 Com ...
- Cts框架解析(15)-任务运行完
case运行完成后.会回到CtsTest的run方法中: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRmb290YmFsbA==/font/5a6L ...
- [源码解析] 深度学习分布式训练框架 horovod (12) --- 弹性训练总体架构
[源码解析] 深度学习分布式训练框架 horovod (12) --- 弹性训练总体架构 目录 [源码解析] 深度学习分布式训练框架 horovod (12) --- 弹性训练总体架构 0x00 摘要 ...
- Poco::TCPServer框架解析
Poco::TCPServer框架解析 POCO C++ Libraries提供一套 C++ 的类库用以开发基于网络的可移植的应用程序,功能涉及线程.文件.流,网络协议包括:HTTP.FTP.SMTP ...
- AlexeyAB DarkNet YOLOv3框架解析与应用实践(六)
AlexeyAB DarkNet YOLOv3框架解析与应用实践(六) 1. Tiny Darknet 听过很多人谈论SqueezeNet. SqueezeNet很酷,但它只是优化参数计数.当大多数高 ...
随机推荐
- [译]LINT TO SQL 介绍(数据库查询) - Part.3
出处:Linq To Sql (Part.3 – Querying our database) 术语表 Built-in:内置的 Clause:子句 Debugger:调试器 Object Relat ...
- C#主线程等待子线程运行结束
佐左佑右 原文 C#主线程等待子线程运行结束 由于主程序中调用matlab的dll文件进行计算要用较长的时间,主界面会有很长时间的卡顿,造成的用户感受十分不好,因此我想在调用时,将调用放入子线程中,然 ...
- ORACLE临时表总结[转]
临时表概念 临时表就是用来暂时保存临时数据(亦或叫中间数据)的一个数据库对象,它和普通表有些类似,然而又有很大区别.它只能存储在临时表空间,而非用户的表空间.ORACLE临时表是会话或事务级别的,只对 ...
- linux 常用命令基础
linux常用的命令 shell 是命令语句,命令解释程序以及程序设计语言的统称,它不仅仅拥有自己内建的shell命令集,同时也能被系统中其他应用程序所调用 shell 的一个重要特性是它本身就是一个 ...
- CodeForce---Educational Codeforces Round 3 Load Balancing 正题
看到这题是我的想法就是肯定跟平均值有关但是接下来就不知道怎么做了 看完大神的正解数之后,原来发现是这么简单,但是就是不知道为啥一定是平均值和平均值加1,而不是平均值和平均值减1: 好啦下面就贴出大神的 ...
- Dictionary<实体,List<实体>>的比较
当Dictionary中Key为实体时,进行用ContainsKey比较会发现,就算Model为一样但是结果比较为不存在: 故用以下代码即可,现将Keys转换ToArray(),再用数组的Contai ...
- bzoj 3620 似乎在梦中见过的样子(KMP)
[题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=3620 [题意] 给定一个字符串,统计有多少形如A+B+A的子串,要求A>=K,B ...
- C++ 之高效使用STL ( STL 算法分类)
http://blog.csdn.net/zhoukuo1981/article/details/3452118
- 【转】并发编程之Operation Queue
http://blog.xcodev.com/blog/2013/10/28/operation-queue-intro/ 随着移动设备的更新换代,移动设备的性能也不断提高,现在流行的CPU已经进入双 ...
- JSF 2 hidden value example
In JSF, you can use the <h:inputHidden /> tag to render a HTML hidden value field. For example ...