CTS Frame Resolution (-itargetpreparer)

Source: Internet
Author: User
Tags prepare

Test device system readiness before opening.


Interface


/* Copyright (C) The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "Licens
 E ");
 * You are not a use this file except in compliance with the License. * Obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * unless required by a Pplicable law or agreed to in writing, software * Distributed under the License are distributed on a "as is" BASIS, * WI
 Thout 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 *, Itargetpreparer clearly document its expected environment Pre-setup and Post-setup. * e.g. a itargetpreparer, configures a device for testing must is run after the itargetpreparer * that installs SOFTW
 Is.
     */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 de
            Vice became unresponsive */public void setUp (Itestdevice device, Ibuildinfo buildinfo) throws Targetsetuperror,
Builderror, devicenotavailableexception;
 }

One way: Setup (), such as installing a system, installing an APK, or any other installation transaction that is a case requirement, should be done in this method.


Implementation Class


/* Copyright (C) The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "Licens
 E ");
 * You are not a use this file except in compliance with the License. * Obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * unless required by a Pplicable law or agreed to in writing, software * Distributed under the License are distributed on a "as is" BASIS, * WI
 Thout 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 PU Blic void SetUp (ITeStdevice device, Ibuildinfo buildinfo) throws Targetsetuperror {log.d ("targetpreparer", "skipping target prepare
    Step ");
 }
}

The method in this class is to print a word, do not do any processing. But if you really want to meet your specific needs, write a class that inherits from that interface.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.