diff options
author | Brett Chabot <brettchabot@android.com> | 2010-02-19 10:31:05 -0800 |
---|---|---|
committer | Brett Chabot <brettchabot@android.com> | 2010-02-19 10:31:05 -0800 |
commit | c1ca8c51c616d1517b18bf24feaa9f8f1430c835 (patch) | |
tree | d4b1e47a6cbcb24f8f278d93c69041d3bcf1d38b /test-runner | |
parent | 9db619e5d3420c53d94866a02b8f3ed298afe636 (diff) | |
download | frameworks_base-c1ca8c51c616d1517b18bf24feaa9f8f1430c835.zip frameworks_base-c1ca8c51c616d1517b18bf24feaa9f8f1430c835.tar.gz frameworks_base-c1ca8c51c616d1517b18bf24feaa9f8f1430c835.tar.bz2 |
Revert "Move framework test-runner unit tests to be closer to their source."
This reverts commit 12093976a4842a795491cfd2b1d3b71e18503f2d.
Diffstat (limited to 'test-runner')
-rw-r--r-- | test-runner/Android.mk | 5 | ||||
-rw-r--r-- | test-runner/android/test/ActivityInstrumentationTestCase.java (renamed from test-runner/src/android/test/ActivityInstrumentationTestCase.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/ActivityInstrumentationTestCase2.java (renamed from test-runner/src/android/test/ActivityInstrumentationTestCase2.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/ActivityTestCase.java (renamed from test-runner/src/android/test/ActivityTestCase.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/ActivityUnitTestCase.java (renamed from test-runner/src/android/test/ActivityUnitTestCase.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/AndroidTestRunner.java (renamed from test-runner/src/android/test/AndroidTestRunner.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/ApplicationTestCase.java (renamed from test-runner/src/android/test/ApplicationTestCase.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/AssertionFailedError.java (renamed from test-runner/src/android/test/AssertionFailedError.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/BundlePrinter.java (renamed from test-runner/src/android/test/BundlePrinter.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/BundleTestListener.java (renamed from test-runner/src/android/test/BundleTestListener.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/ClassPathPackageInfo.java (renamed from test-runner/src/android/test/ClassPathPackageInfo.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/ClassPathPackageInfoSource.java (renamed from test-runner/src/android/test/ClassPathPackageInfoSource.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/ComparisonFailure.java (renamed from test-runner/src/android/test/ComparisonFailure.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/DatabaseTestUtils.java (renamed from test-runner/src/android/test/DatabaseTestUtils.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/InstrumentationCoreTestRunner.java (renamed from test-runner/src/android/test/InstrumentationCoreTestRunner.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/InstrumentationTestRunner.java (renamed from test-runner/src/android/test/InstrumentationTestRunner.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/InstrumentationUtils.java (renamed from test-runner/src/android/test/InstrumentationUtils.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/IsolatedContext.java (renamed from test-runner/src/android/test/IsolatedContext.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/LaunchPerformanceBase.java (renamed from test-runner/src/android/test/LaunchPerformanceBase.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/MoreAsserts.java (renamed from test-runner/src/android/test/MoreAsserts.java) | 0 | ||||
-rwxr-xr-x | test-runner/android/test/NoExecTestResult.java (renamed from test-runner/src/android/test/NoExecTestResult.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/PackageInfoSources.java (renamed from test-runner/src/android/test/PackageInfoSources.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/PerformanceCollectorTestCase.java (renamed from test-runner/src/android/test/PerformanceCollectorTestCase.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/PerformanceTestBase.java (renamed from test-runner/src/android/test/PerformanceTestBase.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/ProviderTestCase.java (renamed from test-runner/src/android/test/ProviderTestCase.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/ProviderTestCase2.java (renamed from test-runner/src/android/test/ProviderTestCase2.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/RenamingDelegatingContext.java (renamed from test-runner/src/android/test/RenamingDelegatingContext.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/ServiceLocator.java (renamed from test-runner/src/android/test/ServiceLocator.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/ServiceTestCase.java (renamed from test-runner/src/android/test/ServiceTestCase.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/SimpleCache.java (renamed from test-runner/src/android/test/SimpleCache.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/SingleLaunchActivityTestCase.java (renamed from test-runner/src/android/test/SingleLaunchActivityTestCase.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/SyncBaseInstrumentation.java (renamed from test-runner/src/android/test/SyncBaseInstrumentation.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/TestBrowserActivity.java (renamed from test-runner/src/android/test/TestBrowserActivity.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/TestBrowserController.java (renamed from test-runner/src/android/test/TestBrowserController.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/TestBrowserControllerImpl.java (renamed from test-runner/src/android/test/TestBrowserControllerImpl.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/TestBrowserView.java (renamed from test-runner/src/android/test/TestBrowserView.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/TestCase.java (renamed from test-runner/src/android/test/TestCase.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/TestCaseUtil.java (renamed from test-runner/src/android/test/TestCaseUtil.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/TestListActivity.java (renamed from test-runner/src/android/test/TestListActivity.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/TestPrinter.java (renamed from test-runner/src/android/test/TestPrinter.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/TestRecorder.java (renamed from test-runner/src/android/test/TestRecorder.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/TestRunner.java (renamed from test-runner/src/android/test/TestRunner.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/TestRunnerView.java (renamed from test-runner/src/android/test/TestRunnerView.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/TestSuiteProvider.java (renamed from test-runner/src/android/test/TestSuiteProvider.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/TimedTest.java (renamed from test-runner/src/android/test/TimedTest.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/TouchUtils.java (renamed from test-runner/src/android/test/TouchUtils.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/ViewAsserts.java (renamed from test-runner/src/android/test/ViewAsserts.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/mock/MockApplication.java (renamed from test-runner/src/android/test/mock/MockApplication.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/mock/MockContentProvider.java (renamed from test-runner/src/android/test/mock/MockContentProvider.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/mock/MockContentResolver.java (renamed from test-runner/src/android/test/mock/MockContentResolver.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/mock/MockContext.java (renamed from test-runner/src/android/test/mock/MockContext.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/mock/MockCursor.java (renamed from test-runner/src/android/test/mock/MockCursor.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/mock/MockDialogInterface.java (renamed from test-runner/src/android/test/mock/MockDialogInterface.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/mock/MockIContentProvider.java (renamed from test-runner/src/android/test/mock/MockIContentProvider.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/mock/MockPackageManager.java (renamed from test-runner/src/android/test/mock/MockPackageManager.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/mock/MockResources.java (renamed from test-runner/src/android/test/mock/MockResources.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/mock/package.html (renamed from test-runner/src/android/test/mock/package.html) | 0 | ||||
-rw-r--r-- | test-runner/android/test/suitebuilder/AssignableFrom.java (renamed from test-runner/src/android/test/suitebuilder/AssignableFrom.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/suitebuilder/InstrumentationTestSuiteBuilder.java (renamed from test-runner/src/android/test/suitebuilder/InstrumentationTestSuiteBuilder.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/suitebuilder/SmokeTestSuiteBuilder.java (renamed from test-runner/src/android/test/suitebuilder/SmokeTestSuiteBuilder.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/suitebuilder/TestGrouping.java (renamed from test-runner/src/android/test/suitebuilder/TestGrouping.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/suitebuilder/TestMethod.java (renamed from test-runner/src/android/test/suitebuilder/TestMethod.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/suitebuilder/TestPredicates.java (renamed from test-runner/src/android/test/suitebuilder/TestPredicates.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/suitebuilder/TestSuiteBuilder.java (renamed from test-runner/src/android/test/suitebuilder/TestSuiteBuilder.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/suitebuilder/UnitTestSuiteBuilder.java (renamed from test-runner/src/android/test/suitebuilder/UnitTestSuiteBuilder.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/suitebuilder/annotation/HasAnnotation.java (renamed from test-runner/src/android/test/suitebuilder/annotation/HasAnnotation.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/suitebuilder/annotation/HasClassAnnotation.java (renamed from test-runner/src/android/test/suitebuilder/annotation/HasClassAnnotation.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/suitebuilder/annotation/HasMethodAnnotation.java (renamed from test-runner/src/android/test/suitebuilder/annotation/HasMethodAnnotation.java) | 0 | ||||
-rw-r--r-- | test-runner/android/test/suitebuilder/annotation/package.html (renamed from test-runner/src/android/test/suitebuilder/annotation/package.html) | 0 | ||||
-rw-r--r-- | test-runner/android/test/suitebuilder/package.html (renamed from test-runner/src/android/test/suitebuilder/package.html) | 0 | ||||
-rw-r--r-- | test-runner/junit/MODULE_LICENSE_CPL (renamed from test-runner/src/junit/MODULE_LICENSE_CPL) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/BaseTestRunner.java (renamed from test-runner/src/junit/runner/BaseTestRunner.java) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/ClassPathTestCollector.java (renamed from test-runner/src/junit/runner/ClassPathTestCollector.java) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/FailureDetailView.java (renamed from test-runner/src/junit/runner/FailureDetailView.java) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/LoadingTestCollector.java (renamed from test-runner/src/junit/runner/LoadingTestCollector.java) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/ReloadingTestSuiteLoader.java (renamed from test-runner/src/junit/runner/ReloadingTestSuiteLoader.java) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/SimpleTestCollector.java (renamed from test-runner/src/junit/runner/SimpleTestCollector.java) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/Sorter.java (renamed from test-runner/src/junit/runner/Sorter.java) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/StandardTestSuiteLoader.java (renamed from test-runner/src/junit/runner/StandardTestSuiteLoader.java) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/TestCaseClassLoader.java (renamed from test-runner/src/junit/runner/TestCaseClassLoader.java) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/TestCollector.java (renamed from test-runner/src/junit/runner/TestCollector.java) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/TestRunListener.java (renamed from test-runner/src/junit/runner/TestRunListener.java) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/TestSuiteLoader.java (renamed from test-runner/src/junit/runner/TestSuiteLoader.java) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/Version.java (renamed from test-runner/src/junit/runner/Version.java) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/excluded.properties (renamed from test-runner/src/junit/runner/excluded.properties) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/logo.gif (renamed from test-runner/src/junit/runner/logo.gif) | bin | 964 -> 964 bytes | |||
-rw-r--r-- | test-runner/junit/runner/package.html (renamed from test-runner/src/junit/runner/package.html) | 0 | ||||
-rw-r--r-- | test-runner/junit/runner/smalllogo.gif (renamed from test-runner/src/junit/runner/smalllogo.gif) | bin | 883 -> 883 bytes | |||
-rw-r--r-- | test-runner/junit/textui/ResultPrinter.java (renamed from test-runner/src/junit/textui/ResultPrinter.java) | 0 | ||||
-rw-r--r-- | test-runner/junit/textui/TestRunner.java (renamed from test-runner/src/junit/textui/TestRunner.java) | 0 | ||||
-rw-r--r-- | test-runner/junit/textui/package.html (renamed from test-runner/src/junit/textui/package.html) | 0 | ||||
-rw-r--r-- | test-runner/tests/Android.mk | 29 | ||||
-rw-r--r-- | test-runner/tests/AndroidManifest.xml | 43 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/AndroidTestRunnerTest.java | 294 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/InstrumentationTestRunnerTest.java | 272 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/StubTestBrowserActivity.java | 33 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/TestBrowserActivityTest.java | 275 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/TestBrowserControllerImplTest.java | 134 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/TestBrowserTests.java | 22 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/TestCaseUtilTest.java | 100 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/AssignableFromTest.java | 85 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/InstrumentationTestSuiteBuilderTest.java | 116 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/ListTestCaseNames.java | 102 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/SmokeTestSuiteBuilderTest.java | 34 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/TestSuiteBuilderTest.java | 218 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/UnitTestSuiteBuilderTest.java | 109 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/annotation/HasAnnotationTest.java | 76 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/annotation/HasClassAnnotationTest.java | 57 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/annotation/HasMethodAnnotationTest.java | 56 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/examples/OuterTest.java | 37 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/examples/error/ErrorTest.java | 30 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/examples/error/FailingTest.java | 30 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/examples/instrumentation/InstrumentationTest.java | 26 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/examples/nested/Level1Test.java | 26 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/examples/nested/nested/Level2Test.java | 26 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/examples/simple/AnotherSimpleTest.java | 26 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/examples/simple/SimpleTest.java | 30 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/examples/smoke/NonSmokeTest.java | 26 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/examples/smoke/SmokeTest.java | 28 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/examples/subclass/SubclassTest.java | 24 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/examples/subclass/SuperclassTest.java | 26 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/examples/suppress/PartiallySuppressedTest.java | 33 | ||||
-rw-r--r-- | test-runner/tests/src/android/test/suitebuilder/examples/suppress/SuppressedTest.java | 29 |
123 files changed, 1 insertions, 2456 deletions
diff --git a/test-runner/Android.mk b/test-runner/Android.mk index 962e96c..42167c7 100644 --- a/test-runner/Android.mk +++ b/test-runner/Android.mk @@ -18,13 +18,10 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_SRC_FILES := $(call all-subdir-java-files) LOCAL_JAVA_LIBRARIES := core framework LOCAL_MODULE:= android.test.runner include $(BUILD_JAVA_LIBRARY) - -# additionally, build unit tests in a separate .apk -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/test-runner/src/android/test/ActivityInstrumentationTestCase.java b/test-runner/android/test/ActivityInstrumentationTestCase.java index d12ff6f..d12ff6f 100644 --- a/test-runner/src/android/test/ActivityInstrumentationTestCase.java +++ b/test-runner/android/test/ActivityInstrumentationTestCase.java diff --git a/test-runner/src/android/test/ActivityInstrumentationTestCase2.java b/test-runner/android/test/ActivityInstrumentationTestCase2.java index e8570bd..e8570bd 100644 --- a/test-runner/src/android/test/ActivityInstrumentationTestCase2.java +++ b/test-runner/android/test/ActivityInstrumentationTestCase2.java diff --git a/test-runner/src/android/test/ActivityTestCase.java b/test-runner/android/test/ActivityTestCase.java index 18bfccc..18bfccc 100644 --- a/test-runner/src/android/test/ActivityTestCase.java +++ b/test-runner/android/test/ActivityTestCase.java diff --git a/test-runner/src/android/test/ActivityUnitTestCase.java b/test-runner/android/test/ActivityUnitTestCase.java index 6bd19a6..6bd19a6 100644 --- a/test-runner/src/android/test/ActivityUnitTestCase.java +++ b/test-runner/android/test/ActivityUnitTestCase.java diff --git a/test-runner/src/android/test/AndroidTestRunner.java b/test-runner/android/test/AndroidTestRunner.java index fc9832c..fc9832c 100644 --- a/test-runner/src/android/test/AndroidTestRunner.java +++ b/test-runner/android/test/AndroidTestRunner.java diff --git a/test-runner/src/android/test/ApplicationTestCase.java b/test-runner/android/test/ApplicationTestCase.java index ae5fa4d..ae5fa4d 100644 --- a/test-runner/src/android/test/ApplicationTestCase.java +++ b/test-runner/android/test/ApplicationTestCase.java diff --git a/test-runner/src/android/test/AssertionFailedError.java b/test-runner/android/test/AssertionFailedError.java index 7af5806..7af5806 100644 --- a/test-runner/src/android/test/AssertionFailedError.java +++ b/test-runner/android/test/AssertionFailedError.java diff --git a/test-runner/src/android/test/BundlePrinter.java b/test-runner/android/test/BundlePrinter.java index 96213e7..96213e7 100644 --- a/test-runner/src/android/test/BundlePrinter.java +++ b/test-runner/android/test/BundlePrinter.java diff --git a/test-runner/src/android/test/BundleTestListener.java b/test-runner/android/test/BundleTestListener.java index 772713f..772713f 100644 --- a/test-runner/src/android/test/BundleTestListener.java +++ b/test-runner/android/test/BundleTestListener.java diff --git a/test-runner/src/android/test/ClassPathPackageInfo.java b/test-runner/android/test/ClassPathPackageInfo.java index 1f6e647..1f6e647 100644 --- a/test-runner/src/android/test/ClassPathPackageInfo.java +++ b/test-runner/android/test/ClassPathPackageInfo.java diff --git a/test-runner/src/android/test/ClassPathPackageInfoSource.java b/test-runner/android/test/ClassPathPackageInfoSource.java index 877075f..877075f 100644 --- a/test-runner/src/android/test/ClassPathPackageInfoSource.java +++ b/test-runner/android/test/ClassPathPackageInfoSource.java diff --git a/test-runner/src/android/test/ComparisonFailure.java b/test-runner/android/test/ComparisonFailure.java index e7e9698..e7e9698 100644 --- a/test-runner/src/android/test/ComparisonFailure.java +++ b/test-runner/android/test/ComparisonFailure.java diff --git a/test-runner/src/android/test/DatabaseTestUtils.java b/test-runner/android/test/DatabaseTestUtils.java index 23e0aba..23e0aba 100644 --- a/test-runner/src/android/test/DatabaseTestUtils.java +++ b/test-runner/android/test/DatabaseTestUtils.java diff --git a/test-runner/src/android/test/InstrumentationCoreTestRunner.java b/test-runner/android/test/InstrumentationCoreTestRunner.java index ff99a74..ff99a74 100644 --- a/test-runner/src/android/test/InstrumentationCoreTestRunner.java +++ b/test-runner/android/test/InstrumentationCoreTestRunner.java diff --git a/test-runner/src/android/test/InstrumentationTestRunner.java b/test-runner/android/test/InstrumentationTestRunner.java index 3e9cd9f..3e9cd9f 100644 --- a/test-runner/src/android/test/InstrumentationTestRunner.java +++ b/test-runner/android/test/InstrumentationTestRunner.java diff --git a/test-runner/src/android/test/InstrumentationUtils.java b/test-runner/android/test/InstrumentationUtils.java index 4c59097..4c59097 100644 --- a/test-runner/src/android/test/InstrumentationUtils.java +++ b/test-runner/android/test/InstrumentationUtils.java diff --git a/test-runner/src/android/test/IsolatedContext.java b/test-runner/android/test/IsolatedContext.java index 485e45c..485e45c 100644 --- a/test-runner/src/android/test/IsolatedContext.java +++ b/test-runner/android/test/IsolatedContext.java diff --git a/test-runner/src/android/test/LaunchPerformanceBase.java b/test-runner/android/test/LaunchPerformanceBase.java index c324446..c324446 100644 --- a/test-runner/src/android/test/LaunchPerformanceBase.java +++ b/test-runner/android/test/LaunchPerformanceBase.java diff --git a/test-runner/src/android/test/MoreAsserts.java b/test-runner/android/test/MoreAsserts.java index 9e0d018..9e0d018 100644 --- a/test-runner/src/android/test/MoreAsserts.java +++ b/test-runner/android/test/MoreAsserts.java diff --git a/test-runner/src/android/test/NoExecTestResult.java b/test-runner/android/test/NoExecTestResult.java index 1ee62c1..1ee62c1 100755 --- a/test-runner/src/android/test/NoExecTestResult.java +++ b/test-runner/android/test/NoExecTestResult.java diff --git a/test-runner/src/android/test/PackageInfoSources.java b/test-runner/android/test/PackageInfoSources.java index ef37449..ef37449 100644 --- a/test-runner/src/android/test/PackageInfoSources.java +++ b/test-runner/android/test/PackageInfoSources.java diff --git a/test-runner/src/android/test/PerformanceCollectorTestCase.java b/test-runner/android/test/PerformanceCollectorTestCase.java index 4309ff7..4309ff7 100644 --- a/test-runner/src/android/test/PerformanceCollectorTestCase.java +++ b/test-runner/android/test/PerformanceCollectorTestCase.java diff --git a/test-runner/src/android/test/PerformanceTestBase.java b/test-runner/android/test/PerformanceTestBase.java index 4a0a589..4a0a589 100644 --- a/test-runner/src/android/test/PerformanceTestBase.java +++ b/test-runner/android/test/PerformanceTestBase.java diff --git a/test-runner/src/android/test/ProviderTestCase.java b/test-runner/android/test/ProviderTestCase.java index 668e9f7..668e9f7 100644 --- a/test-runner/src/android/test/ProviderTestCase.java +++ b/test-runner/android/test/ProviderTestCase.java diff --git a/test-runner/src/android/test/ProviderTestCase2.java b/test-runner/android/test/ProviderTestCase2.java index f3655fc..f3655fc 100644 --- a/test-runner/src/android/test/ProviderTestCase2.java +++ b/test-runner/android/test/ProviderTestCase2.java diff --git a/test-runner/src/android/test/RenamingDelegatingContext.java b/test-runner/android/test/RenamingDelegatingContext.java index 0ea43ab..0ea43ab 100644 --- a/test-runner/src/android/test/RenamingDelegatingContext.java +++ b/test-runner/android/test/RenamingDelegatingContext.java diff --git a/test-runner/src/android/test/ServiceLocator.java b/test-runner/android/test/ServiceLocator.java index 3324008..3324008 100644 --- a/test-runner/src/android/test/ServiceLocator.java +++ b/test-runner/android/test/ServiceLocator.java diff --git a/test-runner/src/android/test/ServiceTestCase.java b/test-runner/android/test/ServiceTestCase.java index fcb9d55..fcb9d55 100644 --- a/test-runner/src/android/test/ServiceTestCase.java +++ b/test-runner/android/test/ServiceTestCase.java diff --git a/test-runner/src/android/test/SimpleCache.java b/test-runner/android/test/SimpleCache.java index 44424ec..44424ec 100644 --- a/test-runner/src/android/test/SimpleCache.java +++ b/test-runner/android/test/SimpleCache.java diff --git a/test-runner/src/android/test/SingleLaunchActivityTestCase.java b/test-runner/android/test/SingleLaunchActivityTestCase.java index b63b3ce..b63b3ce 100644 --- a/test-runner/src/android/test/SingleLaunchActivityTestCase.java +++ b/test-runner/android/test/SingleLaunchActivityTestCase.java diff --git a/test-runner/src/android/test/SyncBaseInstrumentation.java b/test-runner/android/test/SyncBaseInstrumentation.java index 7d418f0..7d418f0 100644 --- a/test-runner/src/android/test/SyncBaseInstrumentation.java +++ b/test-runner/android/test/SyncBaseInstrumentation.java diff --git a/test-runner/src/android/test/TestBrowserActivity.java b/test-runner/android/test/TestBrowserActivity.java index ea5f91e..ea5f91e 100644 --- a/test-runner/src/android/test/TestBrowserActivity.java +++ b/test-runner/android/test/TestBrowserActivity.java diff --git a/test-runner/src/android/test/TestBrowserController.java b/test-runner/android/test/TestBrowserController.java index 044e39f..044e39f 100644 --- a/test-runner/src/android/test/TestBrowserController.java +++ b/test-runner/android/test/TestBrowserController.java diff --git a/test-runner/src/android/test/TestBrowserControllerImpl.java b/test-runner/android/test/TestBrowserControllerImpl.java index b8f8975..b8f8975 100644 --- a/test-runner/src/android/test/TestBrowserControllerImpl.java +++ b/test-runner/android/test/TestBrowserControllerImpl.java diff --git a/test-runner/src/android/test/TestBrowserView.java b/test-runner/android/test/TestBrowserView.java index 4799f19..4799f19 100644 --- a/test-runner/src/android/test/TestBrowserView.java +++ b/test-runner/android/test/TestBrowserView.java diff --git a/test-runner/src/android/test/TestCase.java b/test-runner/android/test/TestCase.java index 5432ce8..5432ce8 100644 --- a/test-runner/src/android/test/TestCase.java +++ b/test-runner/android/test/TestCase.java diff --git a/test-runner/src/android/test/TestCaseUtil.java b/test-runner/android/test/TestCaseUtil.java index 3ba9711..3ba9711 100644 --- a/test-runner/src/android/test/TestCaseUtil.java +++ b/test-runner/android/test/TestCaseUtil.java diff --git a/test-runner/src/android/test/TestListActivity.java b/test-runner/android/test/TestListActivity.java index a076a70..a076a70 100644 --- a/test-runner/src/android/test/TestListActivity.java +++ b/test-runner/android/test/TestListActivity.java diff --git a/test-runner/src/android/test/TestPrinter.java b/test-runner/android/test/TestPrinter.java index 37bd721..37bd721 100644 --- a/test-runner/src/android/test/TestPrinter.java +++ b/test-runner/android/test/TestPrinter.java diff --git a/test-runner/src/android/test/TestRecorder.java b/test-runner/android/test/TestRecorder.java index 7c368a0..7c368a0 100644 --- a/test-runner/src/android/test/TestRecorder.java +++ b/test-runner/android/test/TestRecorder.java diff --git a/test-runner/src/android/test/TestRunner.java b/test-runner/android/test/TestRunner.java index 012df35..012df35 100644 --- a/test-runner/src/android/test/TestRunner.java +++ b/test-runner/android/test/TestRunner.java diff --git a/test-runner/src/android/test/TestRunnerView.java b/test-runner/android/test/TestRunnerView.java index be90951..be90951 100644 --- a/test-runner/src/android/test/TestRunnerView.java +++ b/test-runner/android/test/TestRunnerView.java diff --git a/test-runner/src/android/test/TestSuiteProvider.java b/test-runner/android/test/TestSuiteProvider.java index dc9ce6e..dc9ce6e 100644 --- a/test-runner/src/android/test/TestSuiteProvider.java +++ b/test-runner/android/test/TestSuiteProvider.java diff --git a/test-runner/src/android/test/TimedTest.java b/test-runner/android/test/TimedTest.java index 95cc9bf..95cc9bf 100644 --- a/test-runner/src/android/test/TimedTest.java +++ b/test-runner/android/test/TimedTest.java diff --git a/test-runner/src/android/test/TouchUtils.java b/test-runner/android/test/TouchUtils.java index 69c6d2d..69c6d2d 100644 --- a/test-runner/src/android/test/TouchUtils.java +++ b/test-runner/android/test/TouchUtils.java diff --git a/test-runner/src/android/test/ViewAsserts.java b/test-runner/android/test/ViewAsserts.java index c575fc5..c575fc5 100644 --- a/test-runner/src/android/test/ViewAsserts.java +++ b/test-runner/android/test/ViewAsserts.java diff --git a/test-runner/src/android/test/mock/MockApplication.java b/test-runner/android/test/mock/MockApplication.java index 572dfbf..572dfbf 100644 --- a/test-runner/src/android/test/mock/MockApplication.java +++ b/test-runner/android/test/mock/MockApplication.java diff --git a/test-runner/src/android/test/mock/MockContentProvider.java b/test-runner/android/test/mock/MockContentProvider.java index 4078622..4078622 100644 --- a/test-runner/src/android/test/mock/MockContentProvider.java +++ b/test-runner/android/test/mock/MockContentProvider.java diff --git a/test-runner/src/android/test/mock/MockContentResolver.java b/test-runner/android/test/mock/MockContentResolver.java index 3a1dc36c..3a1dc36c 100644 --- a/test-runner/src/android/test/mock/MockContentResolver.java +++ b/test-runner/android/test/mock/MockContentResolver.java diff --git a/test-runner/src/android/test/mock/MockContext.java b/test-runner/android/test/mock/MockContext.java index ffd757c..ffd757c 100644 --- a/test-runner/src/android/test/mock/MockContext.java +++ b/test-runner/android/test/mock/MockContext.java diff --git a/test-runner/src/android/test/mock/MockCursor.java b/test-runner/android/test/mock/MockCursor.java index 9b1c0ef..9b1c0ef 100644 --- a/test-runner/src/android/test/mock/MockCursor.java +++ b/test-runner/android/test/mock/MockCursor.java diff --git a/test-runner/src/android/test/mock/MockDialogInterface.java b/test-runner/android/test/mock/MockDialogInterface.java index e4dd0ba..e4dd0ba 100644 --- a/test-runner/src/android/test/mock/MockDialogInterface.java +++ b/test-runner/android/test/mock/MockDialogInterface.java diff --git a/test-runner/src/android/test/mock/MockIContentProvider.java b/test-runner/android/test/mock/MockIContentProvider.java index 7c0a1e2..7c0a1e2 100644 --- a/test-runner/src/android/test/mock/MockIContentProvider.java +++ b/test-runner/android/test/mock/MockIContentProvider.java diff --git a/test-runner/src/android/test/mock/MockPackageManager.java b/test-runner/android/test/mock/MockPackageManager.java index f1ba44a..f1ba44a 100644 --- a/test-runner/src/android/test/mock/MockPackageManager.java +++ b/test-runner/android/test/mock/MockPackageManager.java diff --git a/test-runner/src/android/test/mock/MockResources.java b/test-runner/android/test/mock/MockResources.java index 18752ce..18752ce 100644 --- a/test-runner/src/android/test/mock/MockResources.java +++ b/test-runner/android/test/mock/MockResources.java diff --git a/test-runner/src/android/test/mock/package.html b/test-runner/android/test/mock/package.html index 0f1bc6f4..0f1bc6f4 100644 --- a/test-runner/src/android/test/mock/package.html +++ b/test-runner/android/test/mock/package.html diff --git a/test-runner/src/android/test/suitebuilder/AssignableFrom.java b/test-runner/android/test/suitebuilder/AssignableFrom.java index 38b4ee3..38b4ee3 100644 --- a/test-runner/src/android/test/suitebuilder/AssignableFrom.java +++ b/test-runner/android/test/suitebuilder/AssignableFrom.java diff --git a/test-runner/src/android/test/suitebuilder/InstrumentationTestSuiteBuilder.java b/test-runner/android/test/suitebuilder/InstrumentationTestSuiteBuilder.java index 128396e..128396e 100644 --- a/test-runner/src/android/test/suitebuilder/InstrumentationTestSuiteBuilder.java +++ b/test-runner/android/test/suitebuilder/InstrumentationTestSuiteBuilder.java diff --git a/test-runner/src/android/test/suitebuilder/SmokeTestSuiteBuilder.java b/test-runner/android/test/suitebuilder/SmokeTestSuiteBuilder.java index 01e7ec6..01e7ec6 100644 --- a/test-runner/src/android/test/suitebuilder/SmokeTestSuiteBuilder.java +++ b/test-runner/android/test/suitebuilder/SmokeTestSuiteBuilder.java diff --git a/test-runner/src/android/test/suitebuilder/TestGrouping.java b/test-runner/android/test/suitebuilder/TestGrouping.java index df6da70..df6da70 100644 --- a/test-runner/src/android/test/suitebuilder/TestGrouping.java +++ b/test-runner/android/test/suitebuilder/TestGrouping.java diff --git a/test-runner/src/android/test/suitebuilder/TestMethod.java b/test-runner/android/test/suitebuilder/TestMethod.java index 08568d5..08568d5 100644 --- a/test-runner/src/android/test/suitebuilder/TestMethod.java +++ b/test-runner/android/test/suitebuilder/TestMethod.java diff --git a/test-runner/src/android/test/suitebuilder/TestPredicates.java b/test-runner/android/test/suitebuilder/TestPredicates.java index d814e0b..d814e0b 100644 --- a/test-runner/src/android/test/suitebuilder/TestPredicates.java +++ b/test-runner/android/test/suitebuilder/TestPredicates.java diff --git a/test-runner/src/android/test/suitebuilder/TestSuiteBuilder.java b/test-runner/android/test/suitebuilder/TestSuiteBuilder.java index 428905e..428905e 100644 --- a/test-runner/src/android/test/suitebuilder/TestSuiteBuilder.java +++ b/test-runner/android/test/suitebuilder/TestSuiteBuilder.java diff --git a/test-runner/src/android/test/suitebuilder/UnitTestSuiteBuilder.java b/test-runner/android/test/suitebuilder/UnitTestSuiteBuilder.java index 8cf4c86..8cf4c86 100644 --- a/test-runner/src/android/test/suitebuilder/UnitTestSuiteBuilder.java +++ b/test-runner/android/test/suitebuilder/UnitTestSuiteBuilder.java diff --git a/test-runner/src/android/test/suitebuilder/annotation/HasAnnotation.java b/test-runner/android/test/suitebuilder/annotation/HasAnnotation.java index a2868fc..a2868fc 100644 --- a/test-runner/src/android/test/suitebuilder/annotation/HasAnnotation.java +++ b/test-runner/android/test/suitebuilder/annotation/HasAnnotation.java diff --git a/test-runner/src/android/test/suitebuilder/annotation/HasClassAnnotation.java b/test-runner/android/test/suitebuilder/annotation/HasClassAnnotation.java index ac76f4c..ac76f4c 100644 --- a/test-runner/src/android/test/suitebuilder/annotation/HasClassAnnotation.java +++ b/test-runner/android/test/suitebuilder/annotation/HasClassAnnotation.java diff --git a/test-runner/src/android/test/suitebuilder/annotation/HasMethodAnnotation.java b/test-runner/android/test/suitebuilder/annotation/HasMethodAnnotation.java index 96bd922..96bd922 100644 --- a/test-runner/src/android/test/suitebuilder/annotation/HasMethodAnnotation.java +++ b/test-runner/android/test/suitebuilder/annotation/HasMethodAnnotation.java diff --git a/test-runner/src/android/test/suitebuilder/annotation/package.html b/test-runner/android/test/suitebuilder/annotation/package.html index ffba2e9..ffba2e9 100644 --- a/test-runner/src/android/test/suitebuilder/annotation/package.html +++ b/test-runner/android/test/suitebuilder/annotation/package.html diff --git a/test-runner/src/android/test/suitebuilder/package.html b/test-runner/android/test/suitebuilder/package.html index ffba2e9..ffba2e9 100644 --- a/test-runner/src/android/test/suitebuilder/package.html +++ b/test-runner/android/test/suitebuilder/package.html diff --git a/test-runner/src/junit/MODULE_LICENSE_CPL b/test-runner/junit/MODULE_LICENSE_CPL index 541dbb5..541dbb5 100644 --- a/test-runner/src/junit/MODULE_LICENSE_CPL +++ b/test-runner/junit/MODULE_LICENSE_CPL diff --git a/test-runner/src/junit/runner/BaseTestRunner.java b/test-runner/junit/runner/BaseTestRunner.java index e073ef7..e073ef7 100644 --- a/test-runner/src/junit/runner/BaseTestRunner.java +++ b/test-runner/junit/runner/BaseTestRunner.java diff --git a/test-runner/src/junit/runner/ClassPathTestCollector.java b/test-runner/junit/runner/ClassPathTestCollector.java index 8a3c702..8a3c702 100644 --- a/test-runner/src/junit/runner/ClassPathTestCollector.java +++ b/test-runner/junit/runner/ClassPathTestCollector.java diff --git a/test-runner/src/junit/runner/FailureDetailView.java b/test-runner/junit/runner/FailureDetailView.java index 7108cec..7108cec 100644 --- a/test-runner/src/junit/runner/FailureDetailView.java +++ b/test-runner/junit/runner/FailureDetailView.java diff --git a/test-runner/src/junit/runner/LoadingTestCollector.java b/test-runner/junit/runner/LoadingTestCollector.java index b1760b1..b1760b1 100644 --- a/test-runner/src/junit/runner/LoadingTestCollector.java +++ b/test-runner/junit/runner/LoadingTestCollector.java diff --git a/test-runner/src/junit/runner/ReloadingTestSuiteLoader.java b/test-runner/junit/runner/ReloadingTestSuiteLoader.java index a6d84fe..a6d84fe 100644 --- a/test-runner/src/junit/runner/ReloadingTestSuiteLoader.java +++ b/test-runner/junit/runner/ReloadingTestSuiteLoader.java diff --git a/test-runner/src/junit/runner/SimpleTestCollector.java b/test-runner/junit/runner/SimpleTestCollector.java index 543168f..543168f 100644 --- a/test-runner/src/junit/runner/SimpleTestCollector.java +++ b/test-runner/junit/runner/SimpleTestCollector.java diff --git a/test-runner/src/junit/runner/Sorter.java b/test-runner/junit/runner/Sorter.java index 66f551e..66f551e 100644 --- a/test-runner/src/junit/runner/Sorter.java +++ b/test-runner/junit/runner/Sorter.java diff --git a/test-runner/src/junit/runner/StandardTestSuiteLoader.java b/test-runner/junit/runner/StandardTestSuiteLoader.java index bce7dec..bce7dec 100644 --- a/test-runner/src/junit/runner/StandardTestSuiteLoader.java +++ b/test-runner/junit/runner/StandardTestSuiteLoader.java diff --git a/test-runner/src/junit/runner/TestCaseClassLoader.java b/test-runner/junit/runner/TestCaseClassLoader.java index 3a510c6..3a510c6 100644 --- a/test-runner/src/junit/runner/TestCaseClassLoader.java +++ b/test-runner/junit/runner/TestCaseClassLoader.java diff --git a/test-runner/src/junit/runner/TestCollector.java b/test-runner/junit/runner/TestCollector.java index 208dccd..208dccd 100644 --- a/test-runner/src/junit/runner/TestCollector.java +++ b/test-runner/junit/runner/TestCollector.java diff --git a/test-runner/src/junit/runner/TestRunListener.java b/test-runner/junit/runner/TestRunListener.java index 0e95819..0e95819 100644 --- a/test-runner/src/junit/runner/TestRunListener.java +++ b/test-runner/junit/runner/TestRunListener.java diff --git a/test-runner/src/junit/runner/TestSuiteLoader.java b/test-runner/junit/runner/TestSuiteLoader.java index 39a4cf7..39a4cf7 100644 --- a/test-runner/src/junit/runner/TestSuiteLoader.java +++ b/test-runner/junit/runner/TestSuiteLoader.java diff --git a/test-runner/src/junit/runner/Version.java b/test-runner/junit/runner/Version.java index b4541ab..b4541ab 100644 --- a/test-runner/src/junit/runner/Version.java +++ b/test-runner/junit/runner/Version.java diff --git a/test-runner/src/junit/runner/excluded.properties b/test-runner/junit/runner/excluded.properties index 3284628..3284628 100644 --- a/test-runner/src/junit/runner/excluded.properties +++ b/test-runner/junit/runner/excluded.properties diff --git a/test-runner/src/junit/runner/logo.gif b/test-runner/junit/runner/logo.gif Binary files differindex d0e1547..d0e1547 100644 --- a/test-runner/src/junit/runner/logo.gif +++ b/test-runner/junit/runner/logo.gif diff --git a/test-runner/src/junit/runner/package.html b/test-runner/junit/runner/package.html index f08fa70..f08fa70 100644 --- a/test-runner/src/junit/runner/package.html +++ b/test-runner/junit/runner/package.html diff --git a/test-runner/src/junit/runner/smalllogo.gif b/test-runner/junit/runner/smalllogo.gif Binary files differindex 7b25eaf6..7b25eaf6 100644 --- a/test-runner/src/junit/runner/smalllogo.gif +++ b/test-runner/junit/runner/smalllogo.gif diff --git a/test-runner/src/junit/textui/ResultPrinter.java b/test-runner/junit/textui/ResultPrinter.java index 5c97112..5c97112 100644 --- a/test-runner/src/junit/textui/ResultPrinter.java +++ b/test-runner/junit/textui/ResultPrinter.java diff --git a/test-runner/src/junit/textui/TestRunner.java b/test-runner/junit/textui/TestRunner.java index 8bdc325..8bdc325 100644 --- a/test-runner/src/junit/textui/TestRunner.java +++ b/test-runner/junit/textui/TestRunner.java diff --git a/test-runner/src/junit/textui/package.html b/test-runner/junit/textui/package.html index 723f2ae..723f2ae 100644 --- a/test-runner/src/junit/textui/package.html +++ b/test-runner/junit/textui/package.html diff --git a/test-runner/tests/Android.mk b/test-runner/tests/Android.mk deleted file mode 100644 index d1efe7b..0000000 --- a/test-runner/tests/Android.mk +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2010, The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -# We only want this apk build for tests. -LOCAL_MODULE_TAGS := tests - -LOCAL_JAVA_LIBRARIES := android.test.runner - -# Include all test java files. -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_PACKAGE_NAME := FrameworkTestRunnerTests - -include $(BUILD_PACKAGE) - diff --git a/test-runner/tests/AndroidManifest.xml b/test-runner/tests/AndroidManifest.xml deleted file mode 100644 index 4f32392..0000000 --- a/test-runner/tests/AndroidManifest.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2010 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.frameworks.testrunner.tests"> - - <application> - <uses-library android:name="android.test.runner" /> - <activity android:name="android.test.StubTestBrowserActivity" - android:label="Stubbed Test Browser"> - <intent-filter> - <action android:name="android.intent.action.MAIN"/> - <category android:name="android.intent.category.FOR_TESTS_ONLY"/> - </intent-filter> - </activity> - - <activity android:name="android.test.TestBrowserTests" - android:label="Test Browser Tests"> - <intent-filter> - <action android:name="android.intent.action.MAIN"/> - <category android:name="android.intent.category.UNIT_TEST"/> - </intent-filter> - </activity>` - </application> - - <instrumentation - android:name="android.test.InstrumentationTestRunner" - android:targetPackage="com.android.frameworks.testrunner.tests" - android:label="Framework testrunner tests" /> -</manifest> diff --git a/test-runner/tests/src/android/test/AndroidTestRunnerTest.java b/test-runner/tests/src/android/test/AndroidTestRunnerTest.java deleted file mode 100644 index 0574704..0000000 --- a/test-runner/tests/src/android/test/AndroidTestRunnerTest.java +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test; - -import android.test.mock.MockContext; -import android.test.suitebuilder.annotation.SmallTest; - -import com.google.android.collect.Lists; - -import junit.framework.TestCase; -import junit.framework.AssertionFailedError; -import junit.framework.Test; -import junit.framework.TestSuite; -import junit.framework.TestListener; - -import java.util.List; -import java.util.Arrays; - -/** - * Unit tests for {@link AndroidTestRunner} - */ -@SmallTest -public class AndroidTestRunnerTest extends TestCase { - private AndroidTestRunner mAndroidTestRunner; - private StubContext mStubContext; - - @Override - protected void setUp() throws Exception { - super.setUp(); - mStubContext = new StubContext(getClass().getClassLoader()); - - mAndroidTestRunner = new AndroidTestRunner(); - mAndroidTestRunner.setContext(mStubContext); - } - - public void testLoadNoTestCases() throws Exception { - mAndroidTestRunner.setTestClassName(TestSuite.class.getName(), null); - - List<TestCase> testCases = mAndroidTestRunner.getTestCases(); - assertNotNull(testCases); - assertEquals(1, testCases.size()); - assertEquals("warning", testCases.get(0).getName()); - assertEquals(TestSuite.class.getSimpleName(), mAndroidTestRunner.getTestClassName()); - } - - public void testSetTestSuiteWithOneTestCase() throws Exception { - mAndroidTestRunner.setTestClassName(OneTestTestCase.class.getName(), null); - - List<TestCase> testCases = mAndroidTestRunner.getTestCases(); - assertNotNull(testCases); - assertEquals(1, testCases.size()); - assertEquals("testOne", testCases.get(0).getName()); - assertEquals(OneTestTestCase.class.getSimpleName(), mAndroidTestRunner.getTestClassName()); - } - - public void testRunTest() throws Exception { - mAndroidTestRunner.setTestClassName(OneTestTestCase.class.getName(), null); - - TestListenerStub testListenerStub = new TestListenerStub(); - mAndroidTestRunner.addTestListener(testListenerStub); - - mAndroidTestRunner.runTest(); - - assertTrue(testListenerStub.saw("testOne")); - } - - public void testRunTestWithAndroidTestCase() throws Exception { - mAndroidTestRunner.setTestClassName( - OneAndroidTestTestCase.class.getName(), "testOneAndroid"); - - TestListenerStub testListenerStub = new TestListenerStub(); - mAndroidTestRunner.addTestListener(testListenerStub); - - assertNull(((AndroidTestCase) mAndroidTestRunner.getTestCases().get(0)).getContext()); - - mAndroidTestRunner.runTest(); - - assertTrue(testListenerStub.saw("testOneAndroid")); - assertSame(mStubContext, - ((AndroidTestCase) mAndroidTestRunner.getTestCases().get(0)).getContext()); - } - - public void testRunTestWithAndroidTestCaseInSuite() throws Exception { - mAndroidTestRunner.setTestClassName(OneAndroidTestTestCase.class.getName(), null); - - TestListenerStub testListenerStub = new TestListenerStub(); - mAndroidTestRunner.addTestListener(testListenerStub); - - mAndroidTestRunner.runTest(); - - assertTrue(testListenerStub.saw("testOneAndroid")); - - List<TestCase> testCases = mAndroidTestRunner.getTestCases(); - for (TestCase testCase : testCases) { - assertSame(mStubContext, ((AndroidTestCase) testCase).getContext()); - } - } - - public void testRunTestWithAndroidTestCaseInNestedSuite() throws Exception { - mAndroidTestRunner.setTestClassName(AndroidTestCaseTestSuite.class.getName(), null); - - TestListenerStub testListenerStub = new TestListenerStub(); - mAndroidTestRunner.addTestListener(testListenerStub); - - mAndroidTestRunner.runTest(); - - assertTrue(testListenerStub.saw("testOneAndroid")); - - List<TestCase> testCases = mAndroidTestRunner.getTestCases(); - for (TestCase testCase : testCases) { - assertSame(mStubContext, ((AndroidTestCase) testCase).getContext()); - } - } - - public void testRunTestWithNullListener() throws Exception { - mAndroidTestRunner.setTestClassName(OneTestTestCase.class.getName(), null); - - mAndroidTestRunner.addTestListener(null); - try { - mAndroidTestRunner.runTest(); - } catch (NullPointerException e) { - fail("Should not add a null TestListener"); - } - } - - public void testSetTestClassWithTestSuiteProvider() throws Exception { - mAndroidTestRunner.setTestClassName(SampleTestSuiteProvider.class.getName(), null); - List<TestCase> testCases = mAndroidTestRunner.getTestCases(); - List<String> testNames = Lists.newArrayList(); - for (TestCase testCase : testCases) { - testNames.add(testCase.getName()); - } - - // Use the test suite provided by the interface method rather than the static suite method. - assertEquals(Arrays.asList("testOne"), testNames); - } - - public void testSetTestClassWithTestSuite() throws Exception { - mAndroidTestRunner.setTestClassName(SampleTestSuite.class.getName(), null); - List<TestCase> testCases = mAndroidTestRunner.getTestCases(); - List<String> testNames = Lists.newArrayList(); - for (TestCase testCase : testCases) { - testNames.add(testCase.getName()); - } - assertEquals(Arrays.asList("testOne", "testOne", "testTwo"), testNames); - } - - public void testRunSingleTestMethod() throws Exception { - String testMethodName = "testTwo"; - mAndroidTestRunner.setTestClassName(TwoTestTestCase.class.getName(), testMethodName); - List<TestCase> testCases = mAndroidTestRunner.getTestCases(); - List<String> testNames = Lists.newArrayList(); - for (TestCase testCase : testCases) { - testNames.add(testCase.getName()); - } - assertEquals(Arrays.asList(testMethodName), testNames); - } - - public void testSetTestClassInvalidClass() throws Exception { - try { - mAndroidTestRunner.setTestClassName("class.that.does.not.exist", null); - fail("expected exception not thrown"); - } catch (RuntimeException e) { - // expected - } - } - - public void testRunSkipExecution() throws Exception { - String testMethodName = "testFail"; - mAndroidTestRunner.setTestClassName( - OnePassOneErrorOneFailTestCase.class.getName(), testMethodName); - - TestListenerStub testListenerStub = new TestListenerStub(); - mAndroidTestRunner.addTestListener(testListenerStub); - - // running the failing test should pass - ie as if its not run - mAndroidTestRunner.runTest(); - - assertTrue(testListenerStub.saw("testFail")); - } - - public static class SampleTestSuiteProvider implements TestSuiteProvider { - - public TestSuite getTestSuite() { - TestSuite testSuite = new TestSuite(); - testSuite.addTestSuite(OneTestTestCase.class); - return testSuite; - } - - public static Test suite() { - return SampleTestSuite.suite(); - } - } - - public static class SampleTestSuite { - public static TestSuite suite() { - TestSuite testSuite = new TestSuite(); - testSuite.addTestSuite(OneTestTestCase.class); - testSuite.addTestSuite(TwoTestTestCase.class); - return testSuite; - } - } - - public static class AndroidTestCaseTestSuite { - public static TestSuite suite() { - TestSuite testSuite = new TestSuite(); - testSuite.addTestSuite(OneAndroidTestTestCase.class); - return testSuite; - } - } - - public static class OneAndroidTestTestCase extends AndroidTestCase { - public void testOneAndroid() throws Exception { - } - } - - public static class OneTestTestCase extends TestCase { - public void testOne() throws Exception { - } - } - - public static class TwoTestTestCase extends TestCase { - public void testOne() throws Exception { - } - - public void testTwo() throws Exception { - } - } - - public static class OnePassOneErrorOneFailTestCase extends TestCase { - public void testPass() throws Exception { - } - - public void testError() throws Exception { - throw new Exception(); - } - - public void testFail() throws Exception { - fail(); - } - } - - private static class TestListenerStub implements TestListener { - List<String> testNames = Lists.newArrayList(); - - public void addError(Test test, Throwable t) { - } - - public void addFailure(Test test, AssertionFailedError t) { - } - - public void endTest(Test test) { - } - - public void startTest(Test test) { - if (test instanceof TestCase) { - testNames.add(((TestCase) test).getName()); - } else if (test instanceof TestSuite) { - testNames.add(((TestSuite) test).getName()); - } - } - - public boolean saw(String testName) { - return testNames.contains(testName); - } - } - - private static class StubContext extends MockContext { - private ClassLoader mClassLoader; - - public StubContext(ClassLoader classLoader) { - this.mClassLoader = classLoader; - } - - @Override - public ClassLoader getClassLoader() { - return mClassLoader; - } - } -} diff --git a/test-runner/tests/src/android/test/InstrumentationTestRunnerTest.java b/test-runner/tests/src/android/test/InstrumentationTestRunnerTest.java deleted file mode 100644 index d9afd54..0000000 --- a/test-runner/tests/src/android/test/InstrumentationTestRunnerTest.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test; - -import android.content.Context; -import android.os.Bundle; -import android.test.mock.MockContext; -import android.test.suitebuilder.ListTestCaseNames; -import android.test.suitebuilder.ListTestCaseNames.TestDescriptor; -import android.test.suitebuilder.annotation.SmallTest; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import java.util.List; - -/** - * Tests for {@link InstrumentationTestRunner} - */ -@SmallTest -public class InstrumentationTestRunnerTest extends TestCase { - private StubInstrumentationTestRunner mInstrumentationTestRunner; - private StubAndroidTestRunner mStubAndroidTestRunner; - private String mTargetContextPackageName; - - protected void setUp() throws Exception { - super.setUp(); - mStubAndroidTestRunner = new StubAndroidTestRunner(); - mTargetContextPackageName = "android.test.suitebuilder.examples"; - mInstrumentationTestRunner = new StubInstrumentationTestRunner( - new StubContext("com.google.foo.tests"), - new StubContext(mTargetContextPackageName), mStubAndroidTestRunner); - } - - public void testOverrideTestToRunWithClassArgument() throws Exception { - String expectedTestClassName = PlaceHolderTest.class.getName(); - mInstrumentationTestRunner.onCreate(createBundle( - InstrumentationTestRunner.ARGUMENT_TEST_CLASS, expectedTestClassName)); - - assertTestRunnerCalledWithExpectedParameters(expectedTestClassName, "testPlaceHolder"); - } - - public void testOverrideTestToRunWithClassAndMethodArgument() throws Exception { - String expectedTestClassName = PlaceHolderTest.class.getName(); - String expectedTestMethodName = "testPlaceHolder"; - String classAndMethod = expectedTestClassName + "#" + expectedTestMethodName; - mInstrumentationTestRunner.onCreate(createBundle( - InstrumentationTestRunner.ARGUMENT_TEST_CLASS, classAndMethod)); - - assertTestRunnerCalledWithExpectedParameters(expectedTestClassName, - expectedTestMethodName); - } - - public void testUseSelfAsTestSuiteProviderWhenNoMetaDataOrClassArgument() throws Exception { - TestSuite testSuite = new TestSuite(); - testSuite.addTestSuite(PlaceHolderTest.class); - mInstrumentationTestRunner.setAllTestsSuite(testSuite); - mInstrumentationTestRunner.onCreate(null); - assertTestRunnerCalledWithExpectedParameters( - PlaceHolderTest.class.getName(), "testPlaceHolder"); - } - - public void testMultipleTestClass() throws Exception { - String classArg = PlaceHolderTest.class.getName() + "," + - PlaceHolderTest2.class.getName(); - mInstrumentationTestRunner.onCreate(createBundle( - InstrumentationTestRunner.ARGUMENT_TEST_CLASS, classArg)); - - Test test = mStubAndroidTestRunner.getTest(); - - assertContentsInOrder(ListTestCaseNames.getTestNames((TestSuite) test), - new TestDescriptor(PlaceHolderTest.class.getName(), "testPlaceHolder"), - new TestDescriptor(PlaceHolderTest2.class.getName(), "testPlaceHolder2")); - - } - - public void testDelayParameter() throws Exception { - int delayMsec = 1000; - Bundle args = new Bundle(); - args.putInt(InstrumentationTestRunner.ARGUMENT_DELAY_MSEC, delayMsec); - args.putString(InstrumentationTestRunner.ARGUMENT_TEST_CLASS, - PlaceHolderTest.class.getName() + "," + - PlaceHolderTest2.class.getName()); - mInstrumentationTestRunner.onCreate(args); - Thread t = new Thread() { public void run() { mInstrumentationTestRunner.onStart(); } }; - - // Should delay three times: before, between, and after the two tests. - long beforeTest = System.currentTimeMillis(); - t.start(); - t.join(); - assertTrue(System.currentTimeMillis() > beforeTest + delayMsec * 3); - assertTrue(mInstrumentationTestRunner.isStarted()); - assertTrue(mInstrumentationTestRunner.isFinished()); - assertTrue(mStubAndroidTestRunner.isRun()); - } - - private void assertContentsInOrder(List<TestDescriptor> actual, TestDescriptor... source) { - TestDescriptor[] clonedSource = source.clone(); - assertEquals("Unexpected number of items.", clonedSource.length, actual.size()); - for (int i = 0; i < actual.size(); i++) { - TestDescriptor actualItem = actual.get(i); - TestDescriptor sourceItem = clonedSource[i]; - assertEquals("Unexpected item. Index: " + i, sourceItem, actualItem); - } - } - - private void assertTestRunnerCalledWithExpectedParameters( - String expectedTestClassName, String expectedTestMethodName) { - Test test = mStubAndroidTestRunner.getTest(); - assertContentsInOrder(ListTestCaseNames.getTestNames((TestSuite) test), - new TestDescriptor(expectedTestClassName, expectedTestMethodName)); - assertTrue(mInstrumentationTestRunner.isStarted()); - assertFalse(mInstrumentationTestRunner.isFinished()); - } - - private Bundle createBundle(String key, String value) { - Bundle bundle = new Bundle(); - bundle.putString(key, value); - return bundle; - } - - private static class StubInstrumentationTestRunner extends InstrumentationTestRunner { - private Context mContext; - private Context mTargetContext; - private boolean mStarted; - private boolean mFinished; - private AndroidTestRunner mAndroidTestRunner; - private TestSuite mTestSuite; - private TestSuite mDefaultTestSuite; - private String mPackageNameForDefaultTests; - - public StubInstrumentationTestRunner(Context context, Context targetContext, - AndroidTestRunner androidTestRunner) { - this.mContext = context; - this.mTargetContext = targetContext; - this.mAndroidTestRunner = androidTestRunner; - } - - public Context getContext() { - return mContext; - } - - public TestSuite getAllTests() { - return mTestSuite; - } - - public Context getTargetContext() { - return mTargetContext; - } - - protected AndroidTestRunner getAndroidTestRunner() { - return mAndroidTestRunner; - } - - public void start() { - mStarted = true; - } - - public void finish(int resultCode, Bundle results) { - mFinished = true; - } - - public boolean isStarted() { - return mStarted; - } - - public boolean isFinished() { - return mFinished; - } - - public void setAllTestsSuite(TestSuite testSuite) { - mTestSuite = testSuite; - } - - public void setDefaultTestsSuite(TestSuite testSuite) { - mDefaultTestSuite = testSuite; - } - - public String getPackageNameForDefaultTests() { - return mPackageNameForDefaultTests; - } - } - - private static class StubContext extends MockContext { - private String mPackageName; - - public StubContext(String packageName) { - this.mPackageName = packageName; - } - - @Override - public String getPackageCodePath() { - return mPackageName; - } - - @Override - public String getPackageName() { - return mPackageName; - } - - @Override - public ClassLoader getClassLoader() { - return getClass().getClassLoader(); - } - } - - private static class StubAndroidTestRunner extends AndroidTestRunner { - private Test mTest; - private boolean mRun; - - public boolean isRun() { - return mRun; - } - - public void setTest(Test test) { - super.setTest(test); - mTest = test; - } - - public Test getTest() { - return mTest; - } - - public void runTest() { - super.runTest(); - mRun = true; - } - } - - /** - * Empty test used for validation - */ - public static class PlaceHolderTest extends TestCase { - - public PlaceHolderTest() { - super("testPlaceHolder"); - } - - public void testPlaceHolder() throws Exception { - - } - } - - /** - * Empty test used for validation - */ - public static class PlaceHolderTest2 extends TestCase { - - public PlaceHolderTest2() { - super("testPlaceHolder2"); - } - - public void testPlaceHolder2() throws Exception { - - } - } -} diff --git a/test-runner/tests/src/android/test/StubTestBrowserActivity.java b/test-runner/tests/src/android/test/StubTestBrowserActivity.java deleted file mode 100644 index 97ed3ce..0000000 --- a/test-runner/tests/src/android/test/StubTestBrowserActivity.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test; - -import junit.framework.TestSuite; - -public class StubTestBrowserActivity extends TestBrowserActivity { - - private static TestSuite mTestSuite; - - static void setTopTestSuite(TestSuite testSuite) { - mTestSuite = testSuite; - } - - @Override - public TestSuite getTopTestSuite() { - return mTestSuite; - } -} diff --git a/test-runner/tests/src/android/test/TestBrowserActivityTest.java b/test-runner/tests/src/android/test/TestBrowserActivityTest.java deleted file mode 100644 index 355409e..0000000 --- a/test-runner/tests/src/android/test/TestBrowserActivityTest.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test; - -import android.app.Activity; -import android.app.Instrumentation; -import android.content.Intent; -import android.net.Uri; -import android.os.RemoteException; -import android.os.ServiceManager; -import android.view.IWindowManager; -import android.widget.ListView; - -import com.google.android.collect.Lists; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import java.util.List; - -public class TestBrowserActivityTest extends InstrumentationTestCase { - - private TestBrowserActivity mTestBrowserActivity; - private StubTestBrowserController mTestBrowserController; - - @Override - protected void setUp() throws Exception { - super.setUp(); - StubTestBrowserActivity.setTopTestSuite(null); - mTestBrowserController = new StubTestBrowserController(); - ServiceLocator.setTestBrowserController(mTestBrowserController); - } - - @Override - protected void tearDown() throws Exception { - if (mTestBrowserActivity != null) { - mTestBrowserActivity.finish(); - } - mTestBrowserActivity = null; - super.tearDown(); - } - - public void testEmptyListContent() throws Exception { - StubTestBrowserActivity.setTopTestSuite(new TestSuite()); - - mTestBrowserActivity = createActivity(); - - ListView listView = getListView(); - // There is always an item on the list for running all tests. - assertEquals("Unexpected number of items on list view.", 1, listView.getCount()); - - assertEquals("Stubbed Test Browser", mTestBrowserActivity.getTitle().toString()); - } - - public void testOneListContent() throws Exception { - List<String> testCaseNames = Lists.newArrayList("AllTests"); - StubTestBrowserActivity.setTopTestSuite(createTestSuite(testCaseNames)); - - mTestBrowserActivity = createActivity(); - - ListView listView = getListView(); - assertListViewContents(testCaseNames, listView); - } - - public void testListWithTestCases() throws Exception { - List<String> testCaseNames = Lists.newArrayList("AllTests", "Apples", "Bananas", "Oranges"); - StubTestBrowserActivity.setTopTestSuite(createTestSuite(testCaseNames)); - - mTestBrowserActivity = createActivity(); - - ListView listView = getListView(); - assertListViewContents(testCaseNames, listView); - } - - public void testListWithTestSuite() throws Exception { - List<String> testCaseNames = Lists.newArrayList(OneTestTestCase.class.getSimpleName()); - StubTestBrowserActivity.setTopTestSuite(new OneTestInTestSuite()); - - mTestBrowserActivity = createActivity(); - - ListView listView = getListView(); - assertListViewContents(testCaseNames, listView); - } - - public void testSelectATestCase() throws Exception { - List<String> testCaseNames = Lists.newArrayList("AllTests"); - TestSuite testSuite = createTestSuite(testCaseNames); - StubTestBrowserActivity.setTopTestSuite(testSuite); - - mTestBrowserController.setTestCase(OneTestTestCase.class); - mTestBrowserActivity = createActivity(); - - Instrumentation.ActivityMonitor activityMonitor = getInstrumentation().addMonitor( - TestBrowserControllerImpl.TEST_RUNNER_ACTIVITY_CLASS_NAME, null, false); - try { - assertEquals(0, activityMonitor.getHits()); - - ListView listView = getListView(); - int invokedTestCaseIndex = 0; - listView.performItemClick(listView, invokedTestCaseIndex, 0); - - Activity activity = activityMonitor.waitForActivityWithTimeout(2000); - assertNotNull(activity); - try { - assertEquals(1, activityMonitor.getHits()); - assertEquals(invokedTestCaseIndex, mTestBrowserController.getLastPosition()); - } finally { - activity.finish(); - } - } finally { - getInstrumentation().removeMonitor(activityMonitor); - } - } - - public void testCreateFromIntentWithOneTest() throws Exception { - List<String> testCaseNames = Lists.newArrayList("testOne"); - - mTestBrowserActivity = launchTestBrowserActivity(new TestSuite(OneTestTestCase.class)); - - ListView listView = getListView(); - assertListViewContents(testCaseNames, listView); - } - - public void testUpdateListOnStart() throws Exception { - StubTestBrowserActivity.setTopTestSuite(new TestSuite()); - - mTestBrowserActivity = createActivity(); - - ListView listView = getListView(); - assertEquals("Unexpected number of items on list view.", 1, listView.getCount()); - - List<String> testCaseNames = Lists.newArrayList("AllTests"); - StubTestBrowserActivity.setTopTestSuite(createTestSuite(testCaseNames)); - - getInstrumentation().runOnMainSync(new Runnable() { - public void run() { - ((StubTestBrowserActivity) mTestBrowserActivity).onStart(); - } - }); - - listView = getListView(); - assertListViewContents(testCaseNames, listView); - } - - public void testTitleHasTestSuiteName() throws Exception { - final String testSuiteName = "com.android.TestSuite"; - StubTestBrowserActivity.setTopTestSuite(new TestSuite(testSuiteName)); - - mTestBrowserActivity = createActivity(); - - assertEquals("TestSuite", mTestBrowserActivity.getTitle().toString()); - } - - private TestSuite createTestSuite(List<String> testCaseNames) { - return createTestSuite(testCaseNames.toArray(new String[testCaseNames.size()])); - } - - private TestSuite createTestSuite(String... testCaseNames) { - TestSuite testSuite = new TestSuite(); - for (String testCaseName : testCaseNames) { - testSuite.addTest(new FakeTestCase(testCaseName)); - } - - return testSuite; - } - - public static class FakeTestCase extends TestCase { - public FakeTestCase(String name) { - super(name); - } - } - - public static class OneTestTestCase extends TestCase { - public void testOne() throws Exception { - } - } - - public static class OneTestInTestSuite extends TestSuite { - public static Test suite() { - TestSuite suite = new TestSuite(OneTestInTestSuite.class.getName()); - suite.addTestSuite(OneTestTestCase.class); - return suite; - } - } - - private void assertListViewContents(List<String> expectedTestCaseNames, ListView listView) { - assertEquals("Run All", listView.getItemAtPosition(0).toString()); - assertEquals("Unexpected number of items on list view.", - expectedTestCaseNames.size() + 1, listView.getCount()); - for (int i = 0; i < expectedTestCaseNames.size(); i++) { - String expectedTestCaseName = expectedTestCaseNames.get(i); - String actualTestCaseName = listView.getItemAtPosition(i + 1).toString(); - assertEquals("Unexpected test case name. Index: " + i, - expectedTestCaseName, actualTestCaseName); - } - } - - private ListView getListView() { - return mTestBrowserActivity.getListView(); - } - - private TestBrowserActivity createActivity() throws RemoteException { - return launchActivity(getAndroidPackageName(), StubTestBrowserActivity.class, null); - } - - private Intent createIntent(TestSuite testSuite) { - Intent intent = new Intent(Intent.ACTION_RUN); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - String className = StubTestBrowserActivity.class.getName(); - String packageName = getAndroidPackageName(); - intent.setClassName(packageName, className); - intent.setData(Uri.parse(testSuite.getName())); - return intent; - } - - private String getAndroidPackageName() { - String packageName = getInstrumentation().getTargetContext().getPackageName(); - return packageName; - } - - private TestBrowserActivity launchTestBrowserActivity(TestSuite testSuite) - throws RemoteException { - getInstrumentation().setInTouchMode(false); - - TestBrowserActivity activity = - (TestBrowserActivity) getInstrumentation().startActivitySync( - createIntent(testSuite)); - getInstrumentation().waitForIdleSync(); - return activity; - } - - private static class StubTestBrowserController extends TestBrowserControllerImpl { - private int mPosition; - private Class<? extends TestCase> mTestCaseClass; - - public Intent getIntentForTestAt(int position) { - mPosition = position; - - Intent intent = new Intent(); - intent.setAction(Intent.ACTION_RUN); - - String className = TestBrowserControllerImpl.TEST_RUNNER_ACTIVITY_CLASS_NAME; - String testName = mTestCaseClass.getClass().getName(); - - String packageName = className.substring(0, className.lastIndexOf(".")); - intent.setClassName(packageName, className); - intent.setData(Uri.parse(testName)); - - return intent; - } - - public void setTestCase(Class<? extends TestCase> testCaseClass) { - mTestCaseClass = testCaseClass; - } - - public int getLastPosition() { - return mPosition; - } - } -} diff --git a/test-runner/tests/src/android/test/TestBrowserControllerImplTest.java b/test-runner/tests/src/android/test/TestBrowserControllerImplTest.java deleted file mode 100644 index 1315606..0000000 --- a/test-runner/tests/src/android/test/TestBrowserControllerImplTest.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test; - -import android.content.Intent; - -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import java.util.Arrays; -import java.util.List; - -public class TestBrowserControllerImplTest extends TestCase { - private TestBrowserControllerImpl mTestBrowserController; - private TestBrowserViewStub mTestBrowserView; - - @Override - protected void setUp() throws Exception { - super.setUp(); - mTestBrowserController = new TestBrowserControllerImpl(); - mTestBrowserView = new TestBrowserViewStub(); - mTestBrowserController.registerView(mTestBrowserView); - } - - public void testSetTestSuite() throws Exception { - TestSuite testSuite = new TestSuite(); - testSuite.addTestSuite(DummyTestCase.class); - - mTestBrowserController.setTestSuite(testSuite); - - verifyTestNames(Arrays.asList("Run All", DummyTestCase.class.getSimpleName()), - mTestBrowserView.getTestNames()); - } - - private static void verifyTestNames(List<String> expectedTestNames, - List<String> actualTestNames) { - assertEquals(expectedTestNames.size(), actualTestNames.size()); - - // We use endsWith instead of equals because the return value of - // class.getSimpleName(), when called on an inner class, varies - // from one vm to another. - // This allows the test to pass in multiple environments. - for (int i = 0; i < expectedTestNames.size(); i++) { - assertTrue(actualTestNames.get(i).endsWith(expectedTestNames.get(i))); - } - } - - public void testGetIntentForTestSuite() throws Exception { - TestSuite testSuite = new TestSuite(); - testSuite.addTestSuite(DummyTestCase.class); - - String targetBrowserActvityClassName = "com.android.bogus.DummyActivity"; - String expectedTargetPackageName = "com.android.bogus"; - mTestBrowserController.setTargetBrowserActivityClassName(targetBrowserActvityClassName); - mTestBrowserController.setTestSuite(testSuite); - mTestBrowserController.setTargetPackageName(expectedTargetPackageName); - Intent intent = mTestBrowserController.getIntentForTestAt(1); - verifyIntent(intent, DummyTestCase.class, expectedTargetPackageName); - assertEquals(targetBrowserActvityClassName, intent.getComponent().getClassName()); - } - - public void testGetIntentForTestCase() throws Exception { - TestSuite testSuite = new TestSuite(); - testSuite.addTest(new DummyTestCase()); - - mTestBrowserController.setTestSuite(testSuite); - Intent intent = mTestBrowserController.getIntentForTestAt(1); - verifyIntent(intent, DummyTestCase.class, "com.android.testharness"); - assertEquals(TestBrowserControllerImpl.TEST_RUNNER_ACTIVITY_CLASS_NAME, - intent.getComponent().getClassName()); - assertEquals("testDummyTest", - intent.getStringExtra(TestBrowserController.BUNDLE_EXTRA_TEST_METHOD_NAME)); - } - - public void testGetIntentForRunAll() throws Exception { - TestSuite testSuite = new DummyTestSuite(); - testSuite.addTestSuite(DummyTestCase.class); - - mTestBrowserController.setTestSuite(testSuite); - Intent intent = mTestBrowserController.getIntentForTestAt(0); - verifyIntent(intent, DummyTestSuite.class, "com.android.testharness"); - } - - private static void verifyIntent(Intent intent, Class testClass, String expectedPackageName) { - assertEquals(Intent.ACTION_RUN, intent.getAction()); - assertEquals(Intent.FLAG_ACTIVITY_NEW_TASK, - intent.getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK); - assertEquals(Intent.FLAG_ACTIVITY_MULTIPLE_TASK, - intent.getFlags() & Intent.FLAG_ACTIVITY_MULTIPLE_TASK); - assertEquals(testClass.getName(), intent.getData().toString()); - assertEquals(expectedPackageName, intent.getComponent().getPackageName()); - } - - private static class DummyTestSuite extends TestSuite { - private DummyTestSuite() { - super(DummyTestSuite.class.getName()); - } - } - - private static class DummyTestCase extends TestCase { - private DummyTestCase() { - super("testDummyTest"); - } - - public void testDummyTest() throws Exception { - } - } - - private class TestBrowserViewStub implements TestBrowserView { - private List<String> mTestNames; - - public void setTestNames(List<String> testNames) { - mTestNames = testNames; - } - - public List<String> getTestNames() { - return mTestNames; - } - } -} diff --git a/test-runner/tests/src/android/test/TestBrowserTests.java b/test-runner/tests/src/android/test/TestBrowserTests.java deleted file mode 100644 index 535e2f8..0000000 --- a/test-runner/tests/src/android/test/TestBrowserTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2007 The Android Open Source Project - - -package android.test; - -import junit.framework.TestSuite; - -public class TestBrowserTests extends TestBrowserActivity { - - @Override - public TestSuite getTopTestSuite() { - return suite(); - } - - public static TestSuite suite() { - TestSuite testSuite = new TestSuite(TestBrowserTests.class.getName()); - testSuite.addTestSuite(TestBrowserControllerImplTest.class); - testSuite.addTestSuite(TestCaseUtilTest.class); - - return testSuite; - } -} diff --git a/test-runner/tests/src/android/test/TestCaseUtilTest.java b/test-runner/tests/src/android/test/TestCaseUtilTest.java deleted file mode 100644 index bc6fa92..0000000 --- a/test-runner/tests/src/android/test/TestCaseUtilTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import java.util.List; - -public class TestCaseUtilTest extends TestCase { - - public void testGetTestCaseNamesForTestSuiteWithSuiteMethod() throws Exception { - TestSuite testSuite = new TwoTestsInTestSuite(); - - List<String> testCaseNames = TestCaseUtil.getTestCaseNames(testSuite, false); - - assertEquals(2, testCaseNames.size()); - assertTrue(testCaseNames.get(0).endsWith("OneTestTestCase")); - assertTrue(testCaseNames.get(1).endsWith("OneTestTestSuite")); - } - - public void testGetTestCaseNamesForTestCaseWithSuiteMethod() throws Exception { - TestCase testCase = new OneTestTestCaseWithSuite(); - - List<String> testCaseNames = TestCaseUtil.getTestCaseNames(testCase, false); - - assertEquals(1, testCaseNames.size()); - assertTrue(testCaseNames.get(0).endsWith("testOne")); - } - - public void testCreateTestForTestCase() throws Exception { - Test test = TestCaseUtil.createTestSuite(OneTestTestCase.class); - assertEquals(1, test.countTestCases()); - } - - public void testCreateTestForTestSuiteWithSuiteMethod() throws Exception { - Test test = TestCaseUtil.createTestSuite(TwoTestsInTestSuite.class); - assertEquals(2, test.countTestCases()); - } - - public void testCreateTestForTestCaseWithSuiteMethod() throws Exception { - Test test = TestCaseUtil.createTestSuite(OneTestTestCaseWithSuite.class); - assertEquals(1, test.countTestCases()); - } - - public void testReturnEmptyStringForTestSuiteWithNoName() throws Exception { - assertEquals("", TestCaseUtil.getTestName(new TestSuite())); - } - - public static class OneTestTestCase extends TestCase { - public void testOne() throws Exception { - } - } - - public static class OneTestTestCaseWithSuite extends TestCase { - public static Test suite() { - TestCase testCase = new OneTestTestCase(); - testCase.setName("testOne"); - return testCase; - } - - public void testOne() throws Exception { - } - - public void testTwo() throws Exception { - } - } - - public static class OneTestTestSuite { - public static Test suite() { - TestSuite suite = new TestSuite(OneTestTestSuite.class.getName()); - suite.addTestSuite(OneTestTestCase.class); - return suite; - } - } - - public static class TwoTestsInTestSuite extends TestSuite { - public static Test suite() { - TestSuite suite = new TestSuite(TwoTestsInTestSuite.class.getName()); - suite.addTestSuite(OneTestTestCase.class); - suite.addTest(OneTestTestSuite.suite()); - return suite; - } - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/AssignableFromTest.java b/test-runner/tests/src/android/test/suitebuilder/AssignableFromTest.java deleted file mode 100644 index 0f73e89..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/AssignableFromTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder; - -import junit.framework.TestCase; - -import java.lang.reflect.Method; - -public class AssignableFromTest extends TestCase { - private AssignableFrom assignableFrom; - - - protected void setUp() throws Exception { - super.setUp(); - assignableFrom = new AssignableFrom(Animal.class); - } - - public void testSelfIsAssignable() throws Exception { - assertTrue(assignableFrom.apply(testMethodFor(Animal.class))); - } - - public void testSubclassesAreAssignable() throws Exception { - assertTrue(assignableFrom.apply(testMethodFor(Mammal.class))); - assertTrue(assignableFrom.apply(testMethodFor(Human.class))); - } - - public void testNotAssignable() throws Exception { - assertFalse(assignableFrom.apply(testMethodFor(Pencil.class))); - } - - public void testImplementorsAreAssignable() throws Exception { - assignableFrom = new AssignableFrom(WritingInstrument.class); - - assertTrue(assignableFrom.apply(testMethodFor(Pencil.class))); - assertTrue(assignableFrom.apply(testMethodFor(Pen.class))); - } - - private TestMethod testMethodFor(Class<? extends TestCase> aClass) - throws NoSuchMethodException { - Method method = aClass.getMethod("testX"); - return new TestMethod(method, aClass); - } - - private class Animal extends TestCase { - public void testX() { - } - } - - private class Mammal extends Animal { - public void testX() { - } - } - - private class Human extends Mammal { - public void testX() { - } - } - - private interface WritingInstrument { - } - - private class Pencil extends TestCase implements WritingInstrument { - public void testX() { - } - } - - private class Pen extends TestCase implements WritingInstrument { - public void testX() { - } - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/InstrumentationTestSuiteBuilderTest.java b/test-runner/tests/src/android/test/suitebuilder/InstrumentationTestSuiteBuilderTest.java deleted file mode 100644 index 1872803..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/InstrumentationTestSuiteBuilderTest.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder; - -import static android.test.suitebuilder.ListTestCaseNames.getTestCaseNames; -import android.test.suitebuilder.examples.OuterTest; -import android.test.suitebuilder.examples.instrumentation.InstrumentationTest; - -import junit.framework.AssertionFailedError; -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestListener; -import junit.framework.TestResult; -import junit.framework.TestSuite; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -public class InstrumentationTestSuiteBuilderTest extends TestCase { - - private InstrumentationTestSuiteBuilder instrumentationTestSuiteBuilder; - - protected void setUp() throws Exception { - super.setUp(); - instrumentationTestSuiteBuilder = new InstrumentationTestSuiteBuilder(getClass()); - } - - public void testShouldIncludeIntrumentationTests() throws Exception { - instrumentationTestSuiteBuilder.includePackages(packageFor(InstrumentationTest.class)); - - SuiteExecutionRecorder recorder = runSuite(instrumentationTestSuiteBuilder); - - assertEquals(1, recorder.testsSeen.size()); - assertTrue(recorder.saw("InstrumentationTest.testInstrumentation")); - } - - public void testShouldOnlyIncludeIntrumentationTests() throws Exception { - TestSuite testSuite = new OuterTest() - .buildTestsUnderHereWith(instrumentationTestSuiteBuilder); - List<String> testCaseNames = getTestCaseNames(testSuite); - assertEquals(1, testCaseNames.size()); - assertEquals("testInstrumentation", testCaseNames.get(0)); - } - - private static String packageFor(Class clazz) { - String className = clazz.getName(); - return className.substring(0, className.lastIndexOf('.')); - } - - private SuiteExecutionRecorder runSuite(TestSuiteBuilder builder) { - TestSuite suite = builder.build(); - SuiteExecutionRecorder recorder = new SuiteExecutionRecorder(); - TestResult result = new TestResult(); - result.addListener(recorder); - suite.run(result); - return recorder; - } - - private class SuiteExecutionRecorder implements TestListener { - - private Set<String> failures = new HashSet<String>(); - private Set<String> errors = new HashSet<String>(); - private Set<String> testsSeen = new HashSet<String>(); - - public void addError(Test test, Throwable t) { - errors.add(testName(test)); - } - - public void addFailure(Test test, AssertionFailedError t) { - failures.add(testName(test)); - } - - public void endTest(Test test) { - } - - public void startTest(Test test) { - testsSeen.add(testName(test)); - } - - public boolean saw(String testName) { - return testsSeen.contains(testName); - } - - public boolean failed(String testName) { - return failures.contains(testName); - } - - public boolean errored(String testName) { - return errors.contains(testName); - } - - public boolean passed(String testName) { - return saw(testName) && !failed(testName) && !errored(testName); - } - - private String testName(Test test) { - TestCase testCase = (TestCase) test; - return testCase.getClass().getSimpleName() + "." + testCase.getName(); - } - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/ListTestCaseNames.java b/test-runner/tests/src/android/test/suitebuilder/ListTestCaseNames.java deleted file mode 100644 index 37ec328..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/ListTestCaseNames.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class ListTestCaseNames { - public static List<String> getTestCaseNames(TestSuite suite) { - // TODO: deprecate this method and move all callers to use getTestNames - List<Test> tests = Collections.<Test>list(suite.tests()); - ArrayList<String> testCaseNames = new ArrayList<String>(); - for (Test test : tests) { - if (test instanceof TestCase) { - testCaseNames.add(((TestCase) test).getName()); - } else if (test instanceof TestSuite) { - testCaseNames.addAll(getTestCaseNames((TestSuite) test)); - } - } - return testCaseNames; - } - - /** - * Returns a list of test class and method names for each TestCase in suite. - */ - public static List<TestDescriptor> getTestNames(TestSuite suite) { - List<Test> tests = Collections.<Test>list(suite.tests()); - ArrayList<TestDescriptor> testNames = new ArrayList<TestDescriptor>(); - for (Test test : tests) { - if (test instanceof TestCase) { - String className = test.getClass().getName(); - String testName = ((TestCase) test).getName(); - testNames.add(new TestDescriptor(className, testName)); - } else if (test instanceof TestSuite) { - testNames.addAll(getTestNames((TestSuite) test)); - } - } - return testNames; - } - - /** - * Data holder for test case info - */ - public static class TestDescriptor { - private String mClassName; - private String mTestName; - - public TestDescriptor(String className, String testName) { - mClassName = className; - mTestName = testName; - } - - public String getClassName() { - return mClassName; - } - - public String getTestName() { - return mTestName; - } - - /** - * Override parent to do string-based class and test name comparison - */ - @Override - public boolean equals(Object otherObj) { - if (otherObj instanceof TestDescriptor) { - TestDescriptor otherDesc = (TestDescriptor)otherObj; - return otherDesc.getClassName().equals(this.getClassName()) && - otherDesc.getTestName().equals(this.getTestName()); - - } - return false; - } - - /** - * Override parent to return a more user-friendly display string - */ - @Override - public String toString() { - return getClassName() + "#" + getTestName(); - } - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/SmokeTestSuiteBuilderTest.java b/test-runner/tests/src/android/test/suitebuilder/SmokeTestSuiteBuilderTest.java deleted file mode 100644 index f817297..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/SmokeTestSuiteBuilderTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder; - -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import java.util.List; - -public class SmokeTestSuiteBuilderTest extends TestCase { - - public void testShouldOnlyIncludeSmokeTests() throws Exception { - TestSuite testSuite = new SmokeTestSuiteBuilder(getClass()) - .includeAllPackagesUnderHere().build(); - - List<String> testCaseNames = ListTestCaseNames.getTestCaseNames(testSuite); - assertEquals("Unexpected number of smoke tests.", 1, testCaseNames.size()); - assertEquals("Unexpected test name", "testSmoke", testCaseNames.get(0)); - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/TestSuiteBuilderTest.java b/test-runner/tests/src/android/test/suitebuilder/TestSuiteBuilderTest.java deleted file mode 100644 index 293c813..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/TestSuiteBuilderTest.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder; - -import com.android.internal.util.Predicate; -import static android.test.suitebuilder.ListTestCaseNames.getTestCaseNames; -import android.test.suitebuilder.examples.OuterTest; -import android.test.suitebuilder.examples.suppress.SuppressedTest; -import android.test.suitebuilder.examples.error.ErrorTest; -import android.test.suitebuilder.examples.error.FailingTest; -import android.test.suitebuilder.examples.nested.Level1Test; -import android.test.suitebuilder.examples.nested.nested.Level2Test; -import android.test.suitebuilder.examples.simple.SimpleTest; -import android.test.suitebuilder.examples.subclass.SubclassTest; -import junit.framework.AssertionFailedError; -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestListener; -import junit.framework.TestResult; -import junit.framework.TestSuite; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; - - -public class TestSuiteBuilderTest extends TestCase { - - private TestSuiteBuilder testSuiteBuilder; - - protected void setUp() throws Exception { - super.setUp(); - testSuiteBuilder = new TestSuiteBuilder(getClass()); - } - - public void testShouldRunSimpleTests() throws Exception { - testSuiteBuilder.includePackages(packageFor(SimpleTest.class)); - - SuiteExecutionRecorder recorder = runSuite(testSuiteBuilder); - - assertTrue(recorder.passed("SimpleTest.testSimpleOne")); - assertTrue(recorder.passed("SimpleTest.testSimpleTwo")); - assertTrue(recorder.passed("AnotherSimpleTest.testAnotherOne")); - } - - public void testShouldOnlyIncludeTestsThatSatisfyAllPredicates() throws Exception { - testSuiteBuilder.includePackages(packageFor(SimpleTest.class)) - .addRequirements(testsWhoseNameContains("test")) - .addRequirements(testsWhoseNameContains("Simple")) - .addRequirements(testsWhoseNameContains("Two")); - - SuiteExecutionRecorder recorder = runSuite(testSuiteBuilder); - - assertTrue(recorder.passed("SimpleTest.testSimpleTwo")); - } - - public void testShouldAddFailingTestsToSuite() throws Exception { - testSuiteBuilder.includePackages(packageFor(FailingTest.class)); - - SuiteExecutionRecorder recorder = runSuite(testSuiteBuilder); - - assertTrue(recorder.failed("FailingTest.testFailOne")); - assertTrue(recorder.failed("FailingTest.testFailTwo")); - } - - public void testShouldAddTestsWithErrorsToSuite() throws Exception { - testSuiteBuilder.includePackages(packageFor(ErrorTest.class)); - - SuiteExecutionRecorder recorder = runSuite(testSuiteBuilder); - - assertTrue(recorder.errored("ErrorTest.testErrorOne")); - assertTrue(recorder.errored("ErrorTest.testErrorTwo")); - } - - public void testShouldRunTestsInheritedFromSuperclass() throws Exception { - testSuiteBuilder.includePackages(packageFor(SubclassTest.class)); - - SuiteExecutionRecorder recorder = runSuite(testSuiteBuilder); - - assertEquals(2, getTestCaseNames(testSuiteBuilder.build()).size()); - - assertTrue(recorder.passed("SubclassTest.testSubclass")); - assertTrue(recorder.passed("SubclassTest.testSuperclass")); - assertFalse(recorder.saw("SuperclassTest.testSuperclass")); - } - - public void testShouldIncludeTestsInSubPackagesRecursively() throws Exception { - testSuiteBuilder.includePackages(packageFor(Level1Test.class)); - - SuiteExecutionRecorder recorder = runSuite(testSuiteBuilder); - - assertTrue(recorder.passed("Level1Test.testLevel1")); - assertTrue(recorder.passed("Level2Test.testLevel2")); - } - - public void testExcludePackage() throws Exception { - testSuiteBuilder.includePackages(packageFor(SimpleTest.class), - packageFor(Level1Test.class)).excludePackages(packageFor(Level2Test.class)); - - TestSuite testSuite = testSuiteBuilder.build(); - assertContentsInOrder(getTestCaseNames(testSuite), - "testLevel1", "testAnotherOne", "testSimpleOne", "testSimpleTwo"); - } - - public void testShouldExcludeSuppressedTests() throws Exception { - testSuiteBuilder.includePackages(packageFor(SuppressedTest.class)); - testSuiteBuilder.build(); - - SuiteExecutionRecorder recorder = runSuite(testSuiteBuilder); - - assertEquals(1, recorder.testsSeen.size()); - assertTrue(recorder.passed("PartiallySuppressedTest.testUnSuppressedMethod")); - } - - /** - * This test calls {@link OuterTest#buildTestsUnderHereRecursively()} to control - * the packages under test. The call to {@link TestSuiteBuilder#includeAllPackagesUnderHere()} - * is made from there so that only return the example tests. - */ - public void testIncludeAllPackagesUnderHere() throws Exception { - - TestSuite testSuite = new OuterTest().buildTestsUnderHereRecursively(); - assertContentsInOrder(getTestCaseNames(testSuite), - "testOuter", "testErrorOne", "testErrorTwo", "testFailOne", "testFailTwo", - "testInstrumentation", "testLevel1", "testLevel2", "testAnotherOne", - "testSimpleOne", "testSimpleTwo", "testNonSmoke", "testSmoke", "testSubclass", - "testSuperclass", "testUnSuppressedMethod"); - } - - private void assertContentsInOrder(List<String> actual, String... source) { - String[] clonedSource = source.clone(); - assertEquals("Unexpected number of items.", clonedSource.length, actual.size()); - for (int i = 0; i < actual.size(); i++) { - String actualItem = actual.get(i); - String sourceItem = clonedSource[i]; - assertEquals("Unexpected item. Index: " + i, sourceItem, actualItem); - } - } - - private static String packageFor(Class clazz) { - String className = clazz.getName(); - return className.substring(0, className.lastIndexOf('.')); - } - - private Predicate<TestMethod> testsWhoseNameContains(final String string) { - return new Predicate<TestMethod>() { - public boolean apply(TestMethod testMethod) { - return testMethod.getName().contains(string); - } - }; - } - - private SuiteExecutionRecorder runSuite(TestSuiteBuilder builder) { - TestSuite suite = builder.build(); - SuiteExecutionRecorder recorder = new SuiteExecutionRecorder(); - TestResult result = new TestResult(); - result.addListener(recorder); - suite.run(result); - return recorder; - } - - private class SuiteExecutionRecorder implements TestListener { - - private Set<String> failures = new HashSet<String>(); - private Set<String> errors = new HashSet<String>(); - private Set<String> testsSeen = new HashSet<String>(); - - public void addError(Test test, Throwable t) { - errors.add(testName(test)); - } - - public void addFailure(Test test, AssertionFailedError t) { - failures.add(testName(test)); - } - - public void endTest(Test test) { - } - - public void startTest(Test test) { - testsSeen.add(testName(test)); - } - - public boolean saw(String testName) { - return testsSeen.contains(testName); - } - - public boolean failed(String testName) { - return failures.contains(testName); - } - - public boolean errored(String testName) { - return errors.contains(testName); - } - - public boolean passed(String testName) { - return saw(testName) && !failed(testName) && !errored(testName); - } - - private String testName(Test test) { - TestCase testCase = (TestCase) test; - return testCase.getClass().getSimpleName() + "." + testCase.getName(); - } - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/UnitTestSuiteBuilderTest.java b/test-runner/tests/src/android/test/suitebuilder/UnitTestSuiteBuilderTest.java deleted file mode 100644 index 469938e..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/UnitTestSuiteBuilderTest.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder; - -import android.test.suitebuilder.examples.instrumentation.InstrumentationTest; - -import junit.framework.Assert; -import junit.framework.AssertionFailedError; -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestListener; -import junit.framework.TestResult; -import junit.framework.TestSuite; - -import java.util.HashSet; -import java.util.Set; - -public class UnitTestSuiteBuilderTest extends TestCase { - - private UnitTestSuiteBuilder unitTestSuiteBuilder; - - protected void setUp() throws Exception { - super.setUp(); - unitTestSuiteBuilder = new UnitTestSuiteBuilder(getClass()); - } - - public void testShouldExcludeIntrumentationTests() throws Exception { - unitTestSuiteBuilder.includePackages(packageFor(InstrumentationTest.class)); - - TestSuite testSuite = unitTestSuiteBuilder.build(); - Assert.assertEquals(0, ListTestCaseNames.getTestCaseNames(testSuite).size()); - - SuiteExecutionRecorder recorder = runSuite(unitTestSuiteBuilder); - - assertFalse(recorder.saw("InstrumentationTest.testInstrumentation")); - assertTrue(recorder.testsSeen.isEmpty()); - } - - private static String packageFor(Class clazz) { - String className = clazz.getName(); - return className.substring(0, className.lastIndexOf('.')); - } - - private SuiteExecutionRecorder runSuite(TestSuiteBuilder builder) { - TestSuite suite = builder.build(); - SuiteExecutionRecorder recorder = new SuiteExecutionRecorder(); - TestResult result = new TestResult(); - result.addListener(recorder); - suite.run(result); - return recorder; - } - - private class SuiteExecutionRecorder implements TestListener { - - private Set<String> failures = new HashSet<String>(); - private Set<String> errors = new HashSet<String>(); - private Set<String> testsSeen = new HashSet<String>(); - - public void addError(Test test, Throwable t) { - errors.add(testName(test)); - } - - public void addFailure(Test test, AssertionFailedError t) { - failures.add(testName(test)); - } - - public void endTest(Test test) { - } - - public void startTest(Test test) { - testsSeen.add(testName(test)); - } - - public boolean saw(String testName) { - return testsSeen.contains(testName); - } - - public boolean failed(String testName) { - return failures.contains(testName); - } - - public boolean errored(String testName) { - return errors.contains(testName); - } - - public boolean passed(String testName) { - return saw(testName) && !failed(testName) && !errored(testName); - } - - private String testName(Test test) { - TestCase testCase = (TestCase) test; - return testCase.getClass().getSimpleName() + "." + testCase.getName(); - } - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/annotation/HasAnnotationTest.java b/test-runner/tests/src/android/test/suitebuilder/annotation/HasAnnotationTest.java deleted file mode 100644 index edf067d..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/annotation/HasAnnotationTest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.annotation; - -import android.test.suitebuilder.TestMethod; -import junit.framework.TestCase; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import java.lang.reflect.Method; - -public class HasAnnotationTest extends TestCase { - - public void testThatMethodWithAnnotationIsReportedAsBeingAnnotated() throws Exception { - assertTrue(hasExampleAnnotation(ClassWithAnnotation.class, "testWithAnnotation")); - assertTrue(hasExampleAnnotation(ClassWithoutAnnotation.class, "testWithAnnotation")); - } - - public void testThatMethodWithOutAnnotationIsNotReportedAsBeingAnnotated() throws Exception { - assertFalse(hasExampleAnnotation(ClassWithoutAnnotation.class, "testWithoutAnnotation")); - } - - public void testThatClassAnnotatioCausesAllMethodsToBeReportedAsBeingAnnotated() - throws Exception { - assertTrue(hasExampleAnnotation(ClassWithAnnotation.class, "testWithoutAnnotation")); - } - - private boolean hasExampleAnnotation(Class<? extends TestCase> aClass, String methodName) - throws NoSuchMethodException { - Method method = aClass.getMethod(methodName); - TestMethod testMethod = new TestMethod(method, aClass); - return new HasAnnotation(Example.class).apply(testMethod); - } - - @Retention(RetentionPolicy.RUNTIME) - @Target({ElementType.TYPE, ElementType.METHOD}) - public @interface Example { - } - - @Example - static class ClassWithAnnotation extends TestCase { - - @Example - public void testWithAnnotation() { - } - - public void testWithoutAnnotation() { - } - } - - static class ClassWithoutAnnotation extends TestCase { - - @Example - public void testWithAnnotation() { - } - - public void testWithoutAnnotation() { - } - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/annotation/HasClassAnnotationTest.java b/test-runner/tests/src/android/test/suitebuilder/annotation/HasClassAnnotationTest.java deleted file mode 100644 index 051ea54..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/annotation/HasClassAnnotationTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.annotation; - -import android.test.suitebuilder.TestMethod; -import junit.framework.TestCase; - -import java.lang.reflect.Method; - -public class HasClassAnnotationTest extends TestCase { - - public void testShouldTellIfParentClassHasSpecifiedClassification() - throws NoSuchMethodException { - assertTrue(classHasAnnotation(SmokeTestExample.class, Smoke.class)); - } - - public void testShouldTellIfParentClassDoesNotHaveSpecifiedClassification() - throws NoSuchMethodException { - assertFalse(classHasAnnotation(NonSmokeTestExample.class, Smoke.class)); - } - - private boolean classHasAnnotation( - Class<? extends TestCase> aClass, - Class<Smoke> expectedClassification) throws NoSuchMethodException { - Method method = aClass.getMethod("testSomeTest"); - - TestMethod testMethod = new TestMethod(method, aClass); - return new HasClassAnnotation(expectedClassification).apply(testMethod); - } - - @Smoke - static class SmokeTestExample extends TestCase { - - public void testSomeTest() { - } - } - - static class NonSmokeTestExample extends TestCase { - - public void testSomeTest() { - } - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/annotation/HasMethodAnnotationTest.java b/test-runner/tests/src/android/test/suitebuilder/annotation/HasMethodAnnotationTest.java deleted file mode 100644 index c864e28..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/annotation/HasMethodAnnotationTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.annotation; - -import android.test.suitebuilder.TestMethod; -import junit.framework.TestCase; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Method; - - -public class HasMethodAnnotationTest extends TestCase { - - public void testMethodWithSpecifiedAttribute() throws Exception { - assertTrue(methodHasAnnotation(AnnotatedMethodExample.class, - "testThatIsAnnotated", Smoke.class)); - } - - public void testMethodWithoutSpecifiedAttribute() throws Exception { - assertFalse(methodHasAnnotation(AnnotatedMethodExample.class, - "testThatIsNotAnnotated", Smoke.class)); - } - - private boolean methodHasAnnotation(Class<? extends TestCase> aClass, - String methodName, - Class<? extends Annotation> expectedClassification - ) throws NoSuchMethodException { - Method method = aClass.getMethod(methodName); - TestMethod testMethod = new TestMethod(method, aClass); - return new HasMethodAnnotation(expectedClassification).apply(testMethod); - } - - static class AnnotatedMethodExample extends TestCase { - - @Smoke - public void testThatIsAnnotated() { - } - - public void testThatIsNotAnnotated() { - } - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/examples/OuterTest.java b/test-runner/tests/src/android/test/suitebuilder/examples/OuterTest.java deleted file mode 100644 index 4659bf9..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/examples/OuterTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.examples; - -import android.test.suitebuilder.TestSuiteBuilder; - -import junit.framework.TestCase; -import junit.framework.TestSuite; - -public class OuterTest extends TestCase { - - public void testOuter() { - assertTrue(true); - } - - public TestSuite buildTestsUnderHereRecursively() { - return buildTestsUnderHereWith(new TestSuiteBuilder(getClass())); - } - - public TestSuite buildTestsUnderHereWith(TestSuiteBuilder testSuiteBuilder) { - return testSuiteBuilder.includeAllPackagesUnderHere().build(); - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/examples/error/ErrorTest.java b/test-runner/tests/src/android/test/suitebuilder/examples/error/ErrorTest.java deleted file mode 100644 index f1f6113..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/examples/error/ErrorTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.examples.error; - -import junit.framework.TestCase; - -public class ErrorTest extends TestCase { - - public void testErrorOne() throws Exception { - throw new RuntimeException("Expected"); - } - - public void testErrorTwo() throws Exception { - throw new RuntimeException("Expected"); - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/examples/error/FailingTest.java b/test-runner/tests/src/android/test/suitebuilder/examples/error/FailingTest.java deleted file mode 100644 index 428fd23..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/examples/error/FailingTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.examples.error; - -import junit.framework.TestCase; - -public class FailingTest extends TestCase { - - public void testFailOne() throws Exception { - fail("Expected"); - } - - public void testFailTwo() throws Exception { - fail("Expected"); - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/examples/instrumentation/InstrumentationTest.java b/test-runner/tests/src/android/test/suitebuilder/examples/instrumentation/InstrumentationTest.java deleted file mode 100644 index 5158a90..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/examples/instrumentation/InstrumentationTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.examples.instrumentation; - -import android.test.InstrumentationTestCase; - -public class InstrumentationTest extends InstrumentationTestCase { - - public void testInstrumentation() throws Exception { - assertTrue(true); - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/examples/nested/Level1Test.java b/test-runner/tests/src/android/test/suitebuilder/examples/nested/Level1Test.java deleted file mode 100644 index 17d39d6..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/examples/nested/Level1Test.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.examples.nested; - -import junit.framework.TestCase; - -public class Level1Test extends TestCase { - - public void testLevel1() throws Exception { - assertTrue(true); - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/examples/nested/nested/Level2Test.java b/test-runner/tests/src/android/test/suitebuilder/examples/nested/nested/Level2Test.java deleted file mode 100644 index 6f0daca..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/examples/nested/nested/Level2Test.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.examples.nested.nested; - -import junit.framework.TestCase; - -public class Level2Test extends TestCase { - - public void testLevel2() throws Exception { - assertTrue(true); - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/examples/simple/AnotherSimpleTest.java b/test-runner/tests/src/android/test/suitebuilder/examples/simple/AnotherSimpleTest.java deleted file mode 100644 index 0dfeda8..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/examples/simple/AnotherSimpleTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.examples.simple; - -import junit.framework.TestCase; - -public class AnotherSimpleTest extends TestCase { - - public void testAnotherOne() throws Exception { - assertTrue(true); - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/examples/simple/SimpleTest.java b/test-runner/tests/src/android/test/suitebuilder/examples/simple/SimpleTest.java deleted file mode 100644 index 4dcac44..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/examples/simple/SimpleTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.examples.simple; - -import junit.framework.TestCase; - -public class SimpleTest extends TestCase { - - public void testSimpleOne() throws Exception { - assertTrue(true); - } - - public void testSimpleTwo() throws Exception { - assertTrue(true); - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/examples/smoke/NonSmokeTest.java b/test-runner/tests/src/android/test/suitebuilder/examples/smoke/NonSmokeTest.java deleted file mode 100644 index 1512ba7..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/examples/smoke/NonSmokeTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.examples.smoke; - -import junit.framework.TestCase; - -public class NonSmokeTest extends TestCase { - - public void testNonSmoke() throws Exception { - assertTrue(true); - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/examples/smoke/SmokeTest.java b/test-runner/tests/src/android/test/suitebuilder/examples/smoke/SmokeTest.java deleted file mode 100644 index c3515df..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/examples/smoke/SmokeTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.examples.smoke; - -import android.test.suitebuilder.annotation.Smoke; -import junit.framework.TestCase; - -@Smoke -public class SmokeTest extends TestCase { - - public void testSmoke() throws Exception { - assertTrue(true); - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/examples/subclass/SubclassTest.java b/test-runner/tests/src/android/test/suitebuilder/examples/subclass/SubclassTest.java deleted file mode 100644 index 0ab8c72..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/examples/subclass/SubclassTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.examples.subclass; - -public class SubclassTest extends SuperclassTest { - - public void testSubclass() throws Exception { - assertTrue(true); - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/examples/subclass/SuperclassTest.java b/test-runner/tests/src/android/test/suitebuilder/examples/subclass/SuperclassTest.java deleted file mode 100644 index 05513c5..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/examples/subclass/SuperclassTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.examples.subclass; - -import junit.framework.TestCase; - -public abstract class SuperclassTest extends TestCase { - - public void testSuperclass() throws Exception { - assertTrue(true); - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/examples/suppress/PartiallySuppressedTest.java b/test-runner/tests/src/android/test/suitebuilder/examples/suppress/PartiallySuppressedTest.java deleted file mode 100644 index 3ca0f70..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/examples/suppress/PartiallySuppressedTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.examples.suppress; - -import android.test.suitebuilder.annotation.Suppress; - -import junit.framework.TestCase; - -public class PartiallySuppressedTest extends TestCase { - - @Suppress - public void testSuppressedMethod() throws Exception { - assertTrue(true); - } - - public void testUnSuppressedMethod() throws Exception { - assertTrue(true); - } -} diff --git a/test-runner/tests/src/android/test/suitebuilder/examples/suppress/SuppressedTest.java b/test-runner/tests/src/android/test/suitebuilder/examples/suppress/SuppressedTest.java deleted file mode 100644 index c4e0e07..0000000 --- a/test-runner/tests/src/android/test/suitebuilder/examples/suppress/SuppressedTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 android.test.suitebuilder.examples.suppress; - -import android.test.suitebuilder.annotation.Suppress; - -import junit.framework.TestCase; - -@Suppress -public class SuppressedTest extends TestCase { - - public void testSuppressedClass() throws Exception { - assertTrue(true); - } -} |