測试开启前的设备系统准备工作。

接口

/*
* 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的更多相关文章

  1. Cts框架解析(2)-cts调试环境的搭建

    上一篇文章中说了怎样在windows搭建cts以及执行cts进行測试.这篇文章来讲讲怎样在eclipse中配置源代码,进行debug调试. 下载 cts源代码地址:https://android.go ...

  2. Cts框架解析(8)-IBuildProvider

    IBuildProvider接口中定义了三个方法 /* * Copyright (C) 2010 The Android Open Source Project * * Licensed under ...

  3. Cts框架解析(7)-任务运行的调度室

    TestInvocation /** * {@inheritDoc} */ @Override public void invoke(ITestDevice device, IConfiguratio ...

  4. Cts框架解析(6)-任务的运行

    前两篇讲了任务的加入和9大项配置,这篇讲任务的运行. 任务的运行 任务的运行在CommandScheduler的run方法中,所以删除全部的断点,在run方法中打上断点,重新启动启动debug: 先看 ...

  5. Cts框架解析(1)-windows下cts配置

    环境搭建 下载 cts工具的下载地址:http://source.android.com/compatibility/downloads.html windows选择Android4.4 R3 Com ...

  6. Cts框架解析(15)-任务运行完

    case运行完成后.会回到CtsTest的run方法中: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaXRmb290YmFsbA==/font/5a6L ...

  7. [源码解析] 深度学习分布式训练框架 horovod (12) --- 弹性训练总体架构

    [源码解析] 深度学习分布式训练框架 horovod (12) --- 弹性训练总体架构 目录 [源码解析] 深度学习分布式训练框架 horovod (12) --- 弹性训练总体架构 0x00 摘要 ...

  8. Poco::TCPServer框架解析

    Poco::TCPServer框架解析 POCO C++ Libraries提供一套 C++ 的类库用以开发基于网络的可移植的应用程序,功能涉及线程.文件.流,网络协议包括:HTTP.FTP.SMTP ...

  9. AlexeyAB DarkNet YOLOv3框架解析与应用实践(六)

    AlexeyAB DarkNet YOLOv3框架解析与应用实践(六) 1. Tiny Darknet 听过很多人谈论SqueezeNet. SqueezeNet很酷,但它只是优化参数计数.当大多数高 ...

随机推荐

  1. logback.xml配置

    一:根节点<configuration>包含的属性: scan: 当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true. scanPeriod: 设置监测配置文 ...

  2. Linux操作系统上用数据泵导库

    1.在Linux上 创建物理目录dp_dir,存放数据库.dmp文件: 用root用户登录,切换到oracle用户,用oralce身份创建物理目录如下: [root@server36 oracle]# ...

  3. 用duilib制作仿QQ2013动态背景登录器

    转载请说明原出处,谢谢~~ 在上一篇博客里,我修复了CActiveXUI控件的bug,从而可以使用flash动画来制作程序的背景,这篇博客说明一下应该怎么使用CActiveXUI控件创建透明无窗体的背 ...

  4. PHP:产生不重复随机数的方法

    来源:http://www.ido321.com/1217.html 无论是Web应用,还是WAP或者移动应用,随机数都有其用武之地.在最近接触的几个小项目中,我也经常需要和随机数或者随机数组打交道, ...

  5. c#调用c++ dll的几种类型(转)

    http://www.sosuo8.com/article-2012/dllleixingzhuanhuan.htm   在合作开发时,C#时常需要调用C++DLL,当传递参数时时常遇到问题,尤其是传 ...

  6. zabbix统一脚本监控方式

    几周的zabbix使用之后几点心得,暂时记在这儿 简单命令监控,直接配置Userparameter参数,以应用来分类conf文件,将不同应用的配置写在不同的conf文件里,并将之放到统一的配置引入目录 ...

  7. 对ArrayList 进行深拷贝

    ArrayList arr = new ArrayList(); arr.Add()); arr.Add()); arr.Add()); ArrayList arr2 = new ArrayList( ...

  8. 20150913K-means聚类

    1.聚类的思想: 将一个有N个对象的数据集,构造成k(k<=n)个划分,每个划分代表一个簇.使得每个簇包含一个对象,每个对象有且仅属于一个簇.对于给定的k,算法首先给出一个初始的划分方法,以后通 ...

  9. 为Android游戏接入第三方登录功能

    1. “游戏客户端”调用“SDK客户端”的登录功能向“SDK服务端”进行身份认证 2. 验证通过后,“游戏客户端”可得到用户信息,根据游戏逻辑可将用户信息传给“游戏服务器”进行验证 3. “游戏服务器 ...

  10. js滑动门及对像的使用

    function scrollDoor() { } scrollDoor.prototype = { sd: function (menus, divs, openClass, closeClass) ...