• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2010 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.android.tradefed.testtype.testdefs;
17 
18 /**
19  * Container object for a single test def's data
20  */
21 class InstrumentationTestDef {
22     private final String mName;
23     private final String mPackage;
24     private String mRunner = null;
25     private String mClassName = null;
26     private boolean mIsContinuous = false;
27     private String mCoverageTarget = null;
28 
29     /**
30      * Creates a {@link InstrumentationTestDef}.
31      *
32      * @param testName the unique test name
33      * @param packageName the Android manifest package name of the test.
34      */
InstrumentationTestDef(String testName, String packageName)35     public InstrumentationTestDef(String testName, String packageName) {
36         mName = testName;
37         mPackage = packageName;
38     }
39 
setRunner(String runnerName)40     void setRunner(String runnerName) {
41         mRunner = runnerName;
42     }
43 
setClassName(String className)44     void setClassName(String className) {
45         mClassName = className;
46     }
47 
setContinuous(boolean isContinuous)48     void setContinuous(boolean isContinuous) {
49         mIsContinuous = isContinuous;
50     }
51 
setCoverageTarget(String coverageTarget)52     void setCoverageTarget(String coverageTarget) {
53         mCoverageTarget = coverageTarget;
54     }
55 
56     /**
57      * Returns the unique name of the test definition.
58      */
getName()59     String getName() {
60         return mName;
61     }
62 
63     /**
64      * Returns the Android Manifest package name of the test application.
65      */
getPackage()66     String getPackage() {
67         return mPackage;
68     }
69 
70     /**
71      * Returns the fully specified  name of the instrumentation runner to use. <code>null</code>
72      * if not specified.
73      */
getRunner()74     String getRunner() {
75         return mRunner;
76     }
77 
78     /**
79      * Returns the fully specified  name of the test class to run. <code>null</code> if not
80      * specified.
81      */
getClassName()82     String getClassName() {
83         return mClassName;
84     }
85 
86     /**
87      * Returns <code>true</code> if test is part of the continuous test.
88      */
isContinuous()89     boolean isContinuous() {
90         return mIsContinuous;
91     }
92 
93     /**
94      * Returns the coverage target for the test.
95      */
getCoverageTarget()96     String getCoverageTarget() {
97         return mCoverageTarget;
98     }
99 }
100