xref: /aosp_15_r20/prebuilts/sdk/31/public/api/android.test.base.txt (revision 344a7f5ef16c479e7a7f54ee6567a9d112f9e72b)
1*344a7f5eSAndroid Build Coastguard Worker// Signature format: 2.0
2*344a7f5eSAndroid Build Coastguard Workerpackage android.test {
3*344a7f5eSAndroid Build Coastguard Worker
4*344a7f5eSAndroid Build Coastguard Worker  @Deprecated public class AndroidTestCase extends junit.framework.TestCase {
5*344a7f5eSAndroid Build Coastguard Worker    ctor @Deprecated public AndroidTestCase();
6*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void assertActivityRequiresPermission(String, String, String);
7*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void assertReadingContentUriRequiresPermission(android.net.Uri, String);
8*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void assertWritingContentUriRequiresPermission(android.net.Uri, String);
9*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public android.content.Context getContext();
10*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public android.content.Context getTestContext();
11*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated protected void scrubClass(Class<?>) throws java.lang.IllegalAccessException;
12*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void setContext(android.content.Context);
13*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void setTestContext(android.content.Context);
14*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated @android.test.suitebuilder.annotation.Suppress public void testAndroidTestCaseSetupProperly();
15*344a7f5eSAndroid Build Coastguard Worker    field @Deprecated protected android.content.Context mContext;
16*344a7f5eSAndroid Build Coastguard Worker  }
17*344a7f5eSAndroid Build Coastguard Worker
18*344a7f5eSAndroid Build Coastguard Worker  @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.METHOD) public @interface FlakyTest {
19*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public abstract int tolerance() default 1;
20*344a7f5eSAndroid Build Coastguard Worker  }
21*344a7f5eSAndroid Build Coastguard Worker
22*344a7f5eSAndroid Build Coastguard Worker  @Deprecated public class InstrumentationTestCase extends junit.framework.TestCase {
23*344a7f5eSAndroid Build Coastguard Worker    ctor @Deprecated public InstrumentationTestCase();
24*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public android.app.Instrumentation getInstrumentation();
25*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void injectInsrumentation(android.app.Instrumentation);
26*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void injectInstrumentation(android.app.Instrumentation);
27*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public final <T extends android.app.Activity> T launchActivity(String, Class<T>, android.os.Bundle);
28*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public final <T extends android.app.Activity> T launchActivityWithIntent(String, Class<T>, android.content.Intent);
29*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void runTestOnUiThread(Runnable) throws java.lang.Throwable;
30*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void sendKeys(String);
31*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void sendKeys(int...);
32*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void sendRepeatedKeys(int...);
33*344a7f5eSAndroid Build Coastguard Worker  }
34*344a7f5eSAndroid Build Coastguard Worker
35*344a7f5eSAndroid Build Coastguard Worker  @Deprecated public class InstrumentationTestSuite extends junit.framework.TestSuite {
36*344a7f5eSAndroid Build Coastguard Worker    ctor @Deprecated public InstrumentationTestSuite(android.app.Instrumentation);
37*344a7f5eSAndroid Build Coastguard Worker    ctor @Deprecated public InstrumentationTestSuite(String, android.app.Instrumentation);
38*344a7f5eSAndroid Build Coastguard Worker    ctor @Deprecated public InstrumentationTestSuite(Class, android.app.Instrumentation);
39*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void addTestSuite(Class);
40*344a7f5eSAndroid Build Coastguard Worker  }
41*344a7f5eSAndroid Build Coastguard Worker
42*344a7f5eSAndroid Build Coastguard Worker  @Deprecated public interface PerformanceTestCase {
43*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public boolean isPerformanceOnly();
44*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public int startPerformance(android.test.PerformanceTestCase.Intermediates);
45*344a7f5eSAndroid Build Coastguard Worker  }
46*344a7f5eSAndroid Build Coastguard Worker
47*344a7f5eSAndroid Build Coastguard Worker  @Deprecated public static interface PerformanceTestCase.Intermediates {
48*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void addIntermediate(String);
49*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void addIntermediate(String, long);
50*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void finishTiming(boolean);
51*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void setInternalIterations(int);
52*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public void startTiming(boolean);
53*344a7f5eSAndroid Build Coastguard Worker  }
54*344a7f5eSAndroid Build Coastguard Worker
55*344a7f5eSAndroid Build Coastguard Worker  @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.METHOD) public @interface RepetitiveTest {
56*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public abstract int numIterations() default 1;
57*344a7f5eSAndroid Build Coastguard Worker  }
58*344a7f5eSAndroid Build Coastguard Worker
59*344a7f5eSAndroid Build Coastguard Worker  @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.METHOD) public @interface UiThreadTest {
60*344a7f5eSAndroid Build Coastguard Worker  }
61*344a7f5eSAndroid Build Coastguard Worker
62*344a7f5eSAndroid Build Coastguard Worker}
63*344a7f5eSAndroid Build Coastguard Worker
64*344a7f5eSAndroid Build Coastguard Workerpackage android.test.suitebuilder.annotation {
65*344a7f5eSAndroid Build Coastguard Worker
66*344a7f5eSAndroid Build Coastguard Worker  @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.TYPE}) public @interface LargeTest {
67*344a7f5eSAndroid Build Coastguard Worker  }
68*344a7f5eSAndroid Build Coastguard Worker
69*344a7f5eSAndroid Build Coastguard Worker  @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.TYPE}) public @interface MediumTest {
70*344a7f5eSAndroid Build Coastguard Worker  }
71*344a7f5eSAndroid Build Coastguard Worker
72*344a7f5eSAndroid Build Coastguard Worker  @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.TYPE}) public @interface SmallTest {
73*344a7f5eSAndroid Build Coastguard Worker  }
74*344a7f5eSAndroid Build Coastguard Worker
75*344a7f5eSAndroid Build Coastguard Worker  @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.TYPE}) public @interface Smoke {
76*344a7f5eSAndroid Build Coastguard Worker  }
77*344a7f5eSAndroid Build Coastguard Worker
78*344a7f5eSAndroid Build Coastguard Worker  @Deprecated @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.TYPE}) public @interface Suppress {
79*344a7f5eSAndroid Build Coastguard Worker  }
80*344a7f5eSAndroid Build Coastguard Worker
81*344a7f5eSAndroid Build Coastguard Worker}
82*344a7f5eSAndroid Build Coastguard Worker
83*344a7f5eSAndroid Build Coastguard Workerpackage com.android.internal.util {
84*344a7f5eSAndroid Build Coastguard Worker
85*344a7f5eSAndroid Build Coastguard Worker  @Deprecated public interface Predicate<T> {
86*344a7f5eSAndroid Build Coastguard Worker    method @Deprecated public boolean apply(T);
87*344a7f5eSAndroid Build Coastguard Worker  }
88*344a7f5eSAndroid Build Coastguard Worker
89*344a7f5eSAndroid Build Coastguard Worker}
90*344a7f5eSAndroid Build Coastguard Worker
91*344a7f5eSAndroid Build Coastguard Workerpackage junit.framework {
92*344a7f5eSAndroid Build Coastguard Worker
93*344a7f5eSAndroid Build Coastguard Worker  public class Assert {
94*344a7f5eSAndroid Build Coastguard Worker    ctor protected Assert();
95*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(String, Object, Object);
96*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(Object, Object);
97*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(String, String, String);
98*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(String, String);
99*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(String, double, double, double);
100*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(double, double, double);
101*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(String, float, float, float);
102*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(float, float, float);
103*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(String, long, long);
104*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(long, long);
105*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(String, boolean, boolean);
106*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(boolean, boolean);
107*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(String, byte, byte);
108*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(byte, byte);
109*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(String, char, char);
110*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(char, char);
111*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(String, short, short);
112*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(short, short);
113*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(String, int, int);
114*344a7f5eSAndroid Build Coastguard Worker    method public static void assertEquals(int, int);
115*344a7f5eSAndroid Build Coastguard Worker    method public static void assertFalse(String, boolean);
116*344a7f5eSAndroid Build Coastguard Worker    method public static void assertFalse(boolean);
117*344a7f5eSAndroid Build Coastguard Worker    method public static void assertNotNull(Object);
118*344a7f5eSAndroid Build Coastguard Worker    method public static void assertNotNull(String, Object);
119*344a7f5eSAndroid Build Coastguard Worker    method public static void assertNotSame(String, Object, Object);
120*344a7f5eSAndroid Build Coastguard Worker    method public static void assertNotSame(Object, Object);
121*344a7f5eSAndroid Build Coastguard Worker    method public static void assertNull(Object);
122*344a7f5eSAndroid Build Coastguard Worker    method public static void assertNull(String, Object);
123*344a7f5eSAndroid Build Coastguard Worker    method public static void assertSame(String, Object, Object);
124*344a7f5eSAndroid Build Coastguard Worker    method public static void assertSame(Object, Object);
125*344a7f5eSAndroid Build Coastguard Worker    method public static void assertTrue(String, boolean);
126*344a7f5eSAndroid Build Coastguard Worker    method public static void assertTrue(boolean);
127*344a7f5eSAndroid Build Coastguard Worker    method public static void fail(String);
128*344a7f5eSAndroid Build Coastguard Worker    method public static void fail();
129*344a7f5eSAndroid Build Coastguard Worker    method public static void failNotEquals(String, Object, Object);
130*344a7f5eSAndroid Build Coastguard Worker    method public static void failNotSame(String, Object, Object);
131*344a7f5eSAndroid Build Coastguard Worker    method public static void failSame(String);
132*344a7f5eSAndroid Build Coastguard Worker    method public static String format(String, Object, Object);
133*344a7f5eSAndroid Build Coastguard Worker  }
134*344a7f5eSAndroid Build Coastguard Worker
135*344a7f5eSAndroid Build Coastguard Worker  public class AssertionFailedError extends java.lang.AssertionError {
136*344a7f5eSAndroid Build Coastguard Worker    ctor public AssertionFailedError();
137*344a7f5eSAndroid Build Coastguard Worker    ctor public AssertionFailedError(String);
138*344a7f5eSAndroid Build Coastguard Worker  }
139*344a7f5eSAndroid Build Coastguard Worker
140*344a7f5eSAndroid Build Coastguard Worker  public class ComparisonFailure extends junit.framework.AssertionFailedError {
141*344a7f5eSAndroid Build Coastguard Worker    ctor public ComparisonFailure(String, String, String);
142*344a7f5eSAndroid Build Coastguard Worker    method public String getActual();
143*344a7f5eSAndroid Build Coastguard Worker    method public String getExpected();
144*344a7f5eSAndroid Build Coastguard Worker  }
145*344a7f5eSAndroid Build Coastguard Worker
146*344a7f5eSAndroid Build Coastguard Worker  public interface Protectable {
147*344a7f5eSAndroid Build Coastguard Worker    method public void protect() throws java.lang.Throwable;
148*344a7f5eSAndroid Build Coastguard Worker  }
149*344a7f5eSAndroid Build Coastguard Worker
150*344a7f5eSAndroid Build Coastguard Worker  public interface Test {
151*344a7f5eSAndroid Build Coastguard Worker    method public int countTestCases();
152*344a7f5eSAndroid Build Coastguard Worker    method public void run(junit.framework.TestResult);
153*344a7f5eSAndroid Build Coastguard Worker  }
154*344a7f5eSAndroid Build Coastguard Worker
155*344a7f5eSAndroid Build Coastguard Worker  public abstract class TestCase extends junit.framework.Assert implements junit.framework.Test {
156*344a7f5eSAndroid Build Coastguard Worker    ctor public TestCase();
157*344a7f5eSAndroid Build Coastguard Worker    ctor public TestCase(String);
158*344a7f5eSAndroid Build Coastguard Worker    method public int countTestCases();
159*344a7f5eSAndroid Build Coastguard Worker    method protected junit.framework.TestResult createResult();
160*344a7f5eSAndroid Build Coastguard Worker    method public String getName();
161*344a7f5eSAndroid Build Coastguard Worker    method public junit.framework.TestResult run();
162*344a7f5eSAndroid Build Coastguard Worker    method public void run(junit.framework.TestResult);
163*344a7f5eSAndroid Build Coastguard Worker    method public void runBare() throws java.lang.Throwable;
164*344a7f5eSAndroid Build Coastguard Worker    method protected void runTest() throws java.lang.Throwable;
165*344a7f5eSAndroid Build Coastguard Worker    method public void setName(String);
166*344a7f5eSAndroid Build Coastguard Worker    method protected void setUp() throws java.lang.Exception;
167*344a7f5eSAndroid Build Coastguard Worker    method protected void tearDown() throws java.lang.Exception;
168*344a7f5eSAndroid Build Coastguard Worker  }
169*344a7f5eSAndroid Build Coastguard Worker
170*344a7f5eSAndroid Build Coastguard Worker  public class TestFailure {
171*344a7f5eSAndroid Build Coastguard Worker    ctor public TestFailure(junit.framework.Test, Throwable);
172*344a7f5eSAndroid Build Coastguard Worker    method public String exceptionMessage();
173*344a7f5eSAndroid Build Coastguard Worker    method public junit.framework.Test failedTest();
174*344a7f5eSAndroid Build Coastguard Worker    method public boolean isFailure();
175*344a7f5eSAndroid Build Coastguard Worker    method public Throwable thrownException();
176*344a7f5eSAndroid Build Coastguard Worker    method public String trace();
177*344a7f5eSAndroid Build Coastguard Worker    field protected junit.framework.Test fFailedTest;
178*344a7f5eSAndroid Build Coastguard Worker    field protected Throwable fThrownException;
179*344a7f5eSAndroid Build Coastguard Worker  }
180*344a7f5eSAndroid Build Coastguard Worker
181*344a7f5eSAndroid Build Coastguard Worker  public interface TestListener {
182*344a7f5eSAndroid Build Coastguard Worker    method public void addError(junit.framework.Test, Throwable);
183*344a7f5eSAndroid Build Coastguard Worker    method public void addFailure(junit.framework.Test, junit.framework.AssertionFailedError);
184*344a7f5eSAndroid Build Coastguard Worker    method public void endTest(junit.framework.Test);
185*344a7f5eSAndroid Build Coastguard Worker    method public void startTest(junit.framework.Test);
186*344a7f5eSAndroid Build Coastguard Worker  }
187*344a7f5eSAndroid Build Coastguard Worker
188*344a7f5eSAndroid Build Coastguard Worker  public class TestResult {
189*344a7f5eSAndroid Build Coastguard Worker    ctor public TestResult();
190*344a7f5eSAndroid Build Coastguard Worker    method public void addError(junit.framework.Test, Throwable);
191*344a7f5eSAndroid Build Coastguard Worker    method public void addFailure(junit.framework.Test, junit.framework.AssertionFailedError);
192*344a7f5eSAndroid Build Coastguard Worker    method public void addListener(junit.framework.TestListener);
193*344a7f5eSAndroid Build Coastguard Worker    method public void endTest(junit.framework.Test);
194*344a7f5eSAndroid Build Coastguard Worker    method public int errorCount();
195*344a7f5eSAndroid Build Coastguard Worker    method public java.util.Enumeration<junit.framework.TestFailure> errors();
196*344a7f5eSAndroid Build Coastguard Worker    method public int failureCount();
197*344a7f5eSAndroid Build Coastguard Worker    method public java.util.Enumeration<junit.framework.TestFailure> failures();
198*344a7f5eSAndroid Build Coastguard Worker    method public void removeListener(junit.framework.TestListener);
199*344a7f5eSAndroid Build Coastguard Worker    method protected void run(junit.framework.TestCase);
200*344a7f5eSAndroid Build Coastguard Worker    method public int runCount();
201*344a7f5eSAndroid Build Coastguard Worker    method public void runProtected(junit.framework.Test, junit.framework.Protectable);
202*344a7f5eSAndroid Build Coastguard Worker    method public boolean shouldStop();
203*344a7f5eSAndroid Build Coastguard Worker    method public void startTest(junit.framework.Test);
204*344a7f5eSAndroid Build Coastguard Worker    method public void stop();
205*344a7f5eSAndroid Build Coastguard Worker    method public boolean wasSuccessful();
206*344a7f5eSAndroid Build Coastguard Worker    field protected java.util.Vector<junit.framework.TestFailure> fErrors;
207*344a7f5eSAndroid Build Coastguard Worker    field protected java.util.Vector<junit.framework.TestFailure> fFailures;
208*344a7f5eSAndroid Build Coastguard Worker    field protected java.util.Vector<junit.framework.TestListener> fListeners;
209*344a7f5eSAndroid Build Coastguard Worker    field protected int fRunTests;
210*344a7f5eSAndroid Build Coastguard Worker  }
211*344a7f5eSAndroid Build Coastguard Worker
212*344a7f5eSAndroid Build Coastguard Worker  public class TestSuite implements junit.framework.Test {
213*344a7f5eSAndroid Build Coastguard Worker    ctor public TestSuite();
214*344a7f5eSAndroid Build Coastguard Worker    ctor public TestSuite(Class<?>);
215*344a7f5eSAndroid Build Coastguard Worker    ctor public TestSuite(Class<? extends junit.framework.TestCase>, String);
216*344a7f5eSAndroid Build Coastguard Worker    ctor public TestSuite(String);
217*344a7f5eSAndroid Build Coastguard Worker    ctor public TestSuite(Class<?>...);
218*344a7f5eSAndroid Build Coastguard Worker    ctor public TestSuite(Class<? extends junit.framework.TestCase>[], String);
219*344a7f5eSAndroid Build Coastguard Worker    method public void addTest(junit.framework.Test);
220*344a7f5eSAndroid Build Coastguard Worker    method public void addTestSuite(Class<? extends junit.framework.TestCase>);
221*344a7f5eSAndroid Build Coastguard Worker    method public int countTestCases();
222*344a7f5eSAndroid Build Coastguard Worker    method public static junit.framework.Test createTest(Class<?>, String);
223*344a7f5eSAndroid Build Coastguard Worker    method public String getName();
224*344a7f5eSAndroid Build Coastguard Worker    method public static java.lang.reflect.Constructor<?> getTestConstructor(Class<?>) throws java.lang.NoSuchMethodException;
225*344a7f5eSAndroid Build Coastguard Worker    method public void run(junit.framework.TestResult);
226*344a7f5eSAndroid Build Coastguard Worker    method public void runTest(junit.framework.Test, junit.framework.TestResult);
227*344a7f5eSAndroid Build Coastguard Worker    method public void setName(String);
228*344a7f5eSAndroid Build Coastguard Worker    method public junit.framework.Test testAt(int);
229*344a7f5eSAndroid Build Coastguard Worker    method public int testCount();
230*344a7f5eSAndroid Build Coastguard Worker    method public java.util.Enumeration<junit.framework.Test> tests();
231*344a7f5eSAndroid Build Coastguard Worker    method public static junit.framework.Test warning(String);
232*344a7f5eSAndroid Build Coastguard Worker  }
233*344a7f5eSAndroid Build Coastguard Worker
234*344a7f5eSAndroid Build Coastguard Worker}
235*344a7f5eSAndroid Build Coastguard Worker
236