/frameworks/base/core/tests/coretests/src/android/text/format/ |
D | TimeTest.java | 19 import android.test.suitebuilder.annotation.SmallTest; 20 import android.test.suitebuilder.annotation.Suppress; 184 DateTest test = dayTests[index]; in testNormalize1() local 185 local.set(0, test.minute1, test.hour1, test.day1, test.month1, test.year1); in testNormalize1() 188 local.monthDay += test.offset; in testNormalize1() 190 if (local.year != test.year2 || local.month != test.month2 in testNormalize1() 191 || local.monthDay != test.day2 || local.hour != test.hour2 in testNormalize1() 192 || local.minute != test.minute2) { in testNormalize1() 194 test.year2, test.month2, test.day2, test.hour2, test.minute2); in testNormalize1() 202 local.set(0, test.minute1, test.hour1, test.day1, test.month1, test.year1); in testNormalize1() [all …]
|
/frameworks/base/test-runner/src/android/test/ |
D | TouchUtils.java | 17 package android.test; 46 public static void dragQuarterScreenDown(ActivityInstrumentationTestCase test) { in dragQuarterScreenDown() argument 47 dragQuarterScreenDown(test, test.getActivity()); in dragQuarterScreenDown() 55 public static void dragQuarterScreenDown(InstrumentationTestCase test, Activity activity) { in dragQuarterScreenDown() argument 64 drag(test, x, x, fromY, toY, 4); in dragQuarterScreenDown() 76 public static void dragQuarterScreenUp(ActivityInstrumentationTestCase test) { in dragQuarterScreenUp() argument 77 dragQuarterScreenUp(test, test.getActivity()); in dragQuarterScreenUp() 85 public static void dragQuarterScreenUp(InstrumentationTestCase test, Activity activity) { in dragQuarterScreenUp() argument 94 drag(test, x, x, fromY, toY, 4); in dragQuarterScreenUp() 109 public static void scrollToBottom(ActivityInstrumentationTestCase test, ViewGroup v) { in scrollToBottom() argument [all …]
|
D | TestCaseUtil.java | 17 package android.test; 44 public static List<String> getTestCaseNames(Test test, boolean flatten) { in getTestCaseNames() argument 45 List<Test> tests = (List<Test>) getTests(test, flatten); in getTestCaseNames() 53 public static List<? extends Test> getTests(Test test, boolean flatten) { in getTests() argument 54 return getTests(test, flatten, new HashSet<Class<?>>()); in getTests() 57 private static List<? extends Test> getTests(Test test, boolean flatten, in getTests() argument 60 if (test != null) { in getTests() 68 if (test instanceof TestCase && in getTests() 69 ((TestCase)test).getName() == null) { in getTests() 70 workingTest = invokeSuiteMethodIfPossible(test.getClass(), in getTests() [all …]
|
D | TestPrinter.java | 17 package android.test; 88 private void failed(Test test, Throwable t) { in failed() argument 89 mFailedTests.add(test.toString()); in failed() 90 failed(test.toString(), t); in failed() 93 public void addError(Test test, Throwable t) { in addError() argument 94 failed(test, t); in addError() 97 public void addFailure(Test test, junit.framework.AssertionFailedError t) { in addFailure() argument 98 failed(test, t); in addFailure() 101 public void endTest(Test test) { in endTest() argument 102 finished(test.toString()); in endTest() [all …]
|
D | InstrumentationCoreTestRunner.java | 17 package android.test; 35 import android.test.suitebuilder.TestMethod; 36 import android.test.suitebuilder.annotation.HasAnnotation; 104 public void startTest(Test test) { in getAndroidTestRunner() 105 if (test.getClass() != lastClass) { in getAndroidTestRunner() 106 lastClass = test.getClass(); in getAndroidTestRunner() 107 printMemory(test.getClass()); in getAndroidTestRunner() 111 test.getClass().getClassLoader()); in getAndroidTestRunner() 116 public void endTest(Test test) { in getAndroidTestRunner() 117 if (test instanceof TestCase) { in getAndroidTestRunner() [all …]
|
D | TestRunner.java | 17 package android.test; 100 public void startTest(Test test) { in startTest() argument 101 started(test.toString()); in startTest() 110 public void endTest(Test test) { in endTest() argument 111 finished(test.toString()); in endTest() 113 passed(test.toString()); in endTest() 123 public void addError(Test test, Throwable t) { in addError() argument 125 failed(test.toString(), t); in addError() 128 public void addFailure(Test test, junit.framework.AssertionFailedError t) { in addFailure() argument 130 failed(test.toString(), t); in addFailure() [all …]
|
D | AndroidTestRunner.java | 17 package android.test; 61 public void setTest(Test test) { in setTest() argument 62 setTest(test, test.getClass()); in setTest() 65 private void setTest(Test test, Class<? extends Test> testClass) { in setTest() argument 66 mTestCases = (List<TestCase>) TestCaseUtil.getTests(test, true); in setTest() 68 mTestClassName = TestCaseUtil.getTestName(test); in setTest() 195 private void setContextIfAndroidTestCase(Test test, Context context, Context testContext) { in setContextIfAndroidTestCase() argument 196 if (AndroidTestCase.class.isAssignableFrom(test.getClass())) { in setContextIfAndroidTestCase() 197 ((AndroidTestCase) test).setContext(context); in setContextIfAndroidTestCase() 198 ((AndroidTestCase) test).setTestContext(testContext); in setContextIfAndroidTestCase() [all …]
|
/frameworks/testing/androidtestlib/src/com/android/test/runner/junit3/ |
D | AndroidTestSuite.java | 16 package com.android.test.runner.junit3; 27 import android.test.AndroidTestCase; 28 import android.test.InstrumentationTestCase; 30 import com.android.test.BundleTest; 55 public void runTest(Test test, TestResult result) { in runTest() argument 56 if (test instanceof AndroidTestCase) { in runTest() 57 ((AndroidTestCase)test).setContext(mInstr.getTargetContext()); in runTest() 59 if (test instanceof InstrumentationTestCase) { in runTest() 60 ((InstrumentationTestCase)test).injectInstrumentation(mInstr); in runTest() 62 if (test instanceof BundleTest) { in runTest() [all …]
|
/frameworks/base/docs/html/tools/testing/ |
D | testing_android.jd | 57 <li>{@link android.test.InstrumentationTestRunner}</li> 58 <li>{@link android.test}</li> 59 <li>{@link android.test.mock}</li> 90 provides an architecture and powerful tools that help you test every aspect of your application 98 Android test suites are based on JUnit. You can use plain JUnit to test a class that doesn't 99 call the Android API, or Android's JUnit extensions to test Android components. If you're 100 new to Android testing, you can start with general-purpose test case classes such as {@link 101 android.test.AndroidTestCase} and then go on to use more sophisticated classes. 104 The Android JUnit extensions provide component-specific test case classes. These classes 109 Test suites are contained in test packages that are similar to main application packages, so [all …]
|
D | testing_eclipse.jd | 33 It lets you quickly create a test project and link it to the application under test. 34 When it creates the test project, it automatically inserts the necessary 35 <code><instrumentation></code> element in the test package's manifest file. 38 It lets you quickly import the classes of the application under test, so that your 42 It lets you create run configurations for your test package and include in 46 It lets you run your test package without leaving Eclipse. ADT builds both the 47 application under test and the test package automatically, installs them if 48 necessary to your device or emulator, runs the test package, and displays the 59 To set up a test environment for your Android application, you must first create a separate 60 project that holds the test code. The new project follows the directory structure [all …]
|
D | testing_otheride.jd | 14 <a href="#CreateTestProject">Creating a test project</a> 17 <a href="#UpdateTestProject">Updating a test project</a> 76 You use the <code>android</code> tool to create test projects. 77 You also use <code>android</code> to convert existing test code into an Android test project, 78 or to add the <code>test</code> Ant target to an existing Android test project. 80 Updating a test project</a>. The <code>test</code> target is described in 83 <h3 id="CreateTestProject">Creating a test project</h3> 85 To create a test project with the <code>android</code> tool, enter: 88 android create test-project -m <main_path> -n <project_name> -p <test_path> 102 Path to the project of the application under test, relative to the test package [all …]
|
D | activity_test.jd | 25 <a href="#AddTestCaseClass">Adding the test case class file</a> 28 <a href="#AddConstructor">Adding the test case constructor</a> 34 <a href="#AddPreConditionsTest">Adding an initial conditions test</a> 37 <a href="#AddUITest">Adding a UI test</a> 69 {@link android.test.ActivityInstrumentationTestCase2} 75 {@link android.test.InstrumentationTestRunner} 86 …id application and then leading you step-by-step through the creation of a test application for it. 87 The test application demonstrates these key points: 91 …An Android test is itself an Android application that is linked to the application under test by e… 94 …Instead of Android components, an Android test application contains one or more test cases. Each o… [all …]
|
D | service_testing.jd | 25 <li>{@link android.test.InstrumentationTestRunner}</li> 26 <li>{@link android.test.ServiceTestCase}</li> 27 <li>{@link android.test.mock.MockApplication}</li> 28 <li>{@link android.test.RenamingDelegatingContext}</li> 51 isolation and provides mock objects. The test case class for Service objects is 52 {@link android.test.ServiceTestCase}. Since the Service class assumes that it is separate 53 from its clients, you can test a Service object without using instrumentation. 72 Most other testing is facilitated by the methods in the {@link android.test.ServiceTestCase} 73 test case class. For example, the {@link android.test.ServiceTestCase#getService()} method 74 returns a handle to the Service under test, which you can test to confirm that the Service is [all …]
|
D | contentprovider_testing.jd | 33 <li>{@link android.test.InstrumentationTestRunner}</li> 34 <li>{@link android.test.ProviderTestCase2}</li> 35 <li>{@link android.test.IsolatedContext}</li> 36 <li>{@link android.test.mock.MockContentResolver}</li> 65 own public providers for use by other applications. If you do, then you should test them 69 This document describes how to test public content providers, although the information is 87 The base test case class for content providers, 88 {@link android.test.ProviderTestCase2}, allows you to test your content provider in an 89 isolated environment. Android mock objects such as {@link android.test.IsolatedContext} and 90 {@link android.test.mock.MockContentResolver} also help provide an isolated test environment. [all …]
|
/frameworks/base/test-runner/tests/src/android/test/suitebuilder/ |
D | ListTestCaseNames.java | 17 package android.test.suitebuilder; 32 for (Test test : tests) { in getTestCaseNames() 33 if (test instanceof TestCase) { in getTestCaseNames() 34 testCaseNames.add(((TestCase) test).getName()); in getTestCaseNames() 35 } else if (test instanceof TestSuite) { in getTestCaseNames() 36 testCaseNames.addAll(getTestCaseNames((TestSuite) test)); in getTestCaseNames() 48 for (Test test : tests) { in getTestNames() 49 if (test instanceof TestCase) { in getTestNames() 50 String className = test.getClass().getName(); in getTestNames() 51 String testName = ((TestCase) test).getName(); in getTestNames() [all …]
|
D | InstrumentationTestSuiteBuilderTest.java | 17 package android.test.suitebuilder; 19 import static android.test.suitebuilder.ListTestCaseNames.getTestCaseNames; 20 import android.test.suitebuilder.examples.OuterTest; 21 import android.test.suitebuilder.examples.instrumentation.InstrumentationTest; 80 public void addError(Test test, Throwable t) { in addError() argument 81 errors.add(testName(test)); in addError() 84 public void addFailure(Test test, AssertionFailedError t) { in addFailure() argument 85 failures.add(testName(test)); in addFailure() 88 public void endTest(Test test) { in endTest() argument 91 public void startTest(Test test) { in startTest() argument [all …]
|
D | TestSuiteBuilderTest.java | 17 package android.test.suitebuilder; 20 import static android.test.suitebuilder.ListTestCaseNames.getTestCaseNames; 21 import android.test.suitebuilder.examples.OuterTest; 22 import android.test.suitebuilder.examples.suppress.SuppressedTest; 23 import android.test.suitebuilder.examples.error.ErrorTest; 24 import android.test.suitebuilder.examples.error.FailingTest; 25 import android.test.suitebuilder.examples.nested.Level1Test; 26 import android.test.suitebuilder.examples.nested.nested.Level2Test; 27 import android.test.suitebuilder.examples.simple.SimpleTest; 28 import android.test.suitebuilder.examples.subclass.SubclassTest; [all …]
|
D | UnitTestSuiteBuilderTest.java | 17 package android.test.suitebuilder; 19 import android.test.suitebuilder.examples.instrumentation.InstrumentationTest; 73 public void addError(Test test, Throwable t) { in addError() argument 74 errors.add(testName(test)); in addError() 77 public void addFailure(Test test, AssertionFailedError t) { in addFailure() argument 78 failures.add(testName(test)); in addFailure() 81 public void endTest(Test test) { in endTest() argument 84 public void startTest(Test test) { in startTest() argument 85 testsSeen.add(testName(test)); in startTest() 104 private String testName(Test test) { in testName() argument [all …]
|
/frameworks/base/docs/html/training/activity-testing/ |
D | activity-basic-testing.jd | 32 create a test for each {@link android.app.Activity} in your application. For 33 each test, you need to create the individual parts of a test case, including 34 the test fixture, preconditions test method, and {@link android.app.Activity} 35 test methods. You can then run your test to get a test report. If any test 40 just enough production code to satisfy your test dependencies, update your 41 test cases to reflect new functional requirements, and iterate repeatedly this 47 test.</p> 48 <p>By convention, your test package name should follow the same name as the 49 application package, suffixed with <strong>".tests"</strong>. In the test package 50 you created, add the Java class for your test case. By convention, your test case [all …]
|
D | activity-ui-testing.jd | 36 you can test an {@link android.app.Activity} with a simple push-button UI. You 37 can use the same general steps to test other, more sophisticated types of UI 42 source code for the application that you want to test. The Android 47 is useful when you want to test how your app interacts with other apps or with 51 <p>For a complete test case example, take a look at 56 the {@link android.app.Activity} under test runs in the UI thread. However, the 57 test application itself runs in a separate thread in the same process as the 58 application under test. This means that your test app can reference objects 63 {@link android.app.Activity} or run test methods on the UI thread, you can 64 extend your test class to use {@link android.test.ActivityInstrumentationTestCase2}. [all …]
|
/frameworks/base/packages/DocumentsUI/src/com/android/documentsui/ |
D | MimePredicate.java | 50 for (String test : tests) { in mimeMatches() 51 if (mimeMatches(filters, test)) { in mimeMatches() 62 for (String test : tests) { in mimeMatches() 63 if (mimeMatches(filter, test)) { in mimeMatches() 70 public static boolean mimeMatches(String[] filters, String test) { in mimeMatches() argument 75 if (mimeMatches(filter, test)) { in mimeMatches() 82 public static boolean mimeMatches(String filter, String test) { in mimeMatches() argument 83 if (test == null) { in mimeMatches() 87 } else if (filter.equals(test)) { in mimeMatches() 90 return filter.regionMatches(0, test, 0, filter.indexOf('/')); in mimeMatches()
|
/frameworks/testing/androidtestlib/src/com/android/test/runner/junit4/ |
D | AndroidJUnit4ClassRunner.java | 16 package com.android.test.runner.junit4; 23 import com.android.test.InjectBundle; 24 import com.android.test.InjectContext; 25 import com.android.test.InjectInstrumentation; 60 Object test = super.createTest(); in createTest() local 61 inject(test); in createTest() 62 return test; in createTest() 105 private void inject(Object test) { in inject() argument 109 setFieldValue(test, instrField.getField(), mInstr); in inject() 114 setFieldValue(test, contextField.getField(), mInstr.getTargetContext()); in inject() [all …]
|
/frameworks/base/core/tests/coretests/src/android/util/ |
D | TouchModeFlexibleAsserts.java | 21 import android.test.InstrumentationTestCase; 22 import android.test.TouchUtils; 36 public static void assertInTouchModeAfterClick(InstrumentationTestCase test, View viewToTouch) { in assertInTouchModeAfterClick() argument 40 TouchUtils.clickView(test, viewToTouch); in assertInTouchModeAfterClick() 48 public static void assertInTouchModeAfterTap(InstrumentationTestCase test, View viewToTouch) { in assertInTouchModeAfterTap() argument 52 TouchUtils.tapView(test, viewToTouch); in assertInTouchModeAfterTap() 60 …public static void assertNotInTouchModeAfterKey(InstrumentationTestCase test, int keyCode, View ch… in assertNotInTouchModeAfterKey() argument 61 test.sendKeys(keyCode); in assertNotInTouchModeAfterKey()
|
/frameworks/base/test-runner/src/android/test/suitebuilder/ |
D | TestPredicates.java | 17 package android.test.suitebuilder; 19 import android.test.InstrumentationTestCase; 20 import android.test.suitebuilder.annotation.HasAnnotation; 21 import android.test.suitebuilder.annotation.Suppress; 22 import android.test.suitebuilder.annotation.LargeTest; 23 import android.test.suitebuilder.annotation.MediumTest; 24 import android.test.suitebuilder.annotation.SmallTest; 25 import android.test.suitebuilder.annotation.Smoke;
|
/frameworks/testing/uiautomator/instrumentation/testrunner-src/com/android/uiautomator/testrunner/ |
D | UiAutomatorInstrumentationTestRunner.java | 19 import android.test.AndroidTestRunner; 20 import android.test.InstrumentationTestRunner; 58 public void startTest(Test test) { in getAndroidTestRunner() 59 if (test instanceof UiAutomatorTestCase) { in getAndroidTestRunner() 60 ((UiAutomatorTestCase)test).initialize(getArguments()); in getAndroidTestRunner() 65 public void endTest(Test test) { in getAndroidTestRunner() 69 public void addFailure(Test test, AssertionFailedError e) { in getAndroidTestRunner() 73 public void addError(Test test, Throwable t) { in getAndroidTestRunner()
|