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