Loading test-runner/tests/Android.mk +7 −0 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,13 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) include $(CLEAR_VARS) # We only want this apk build for tests. # We only want this apk build for tests. # # Run the tests using the following commands: # adb -r install ${ANDROID_PRODUCT_OUT}/data/app/FrameworkTestRunnerTests/FrameworkTestRunnerTests.apk # adb shell am instrument \ -e notAnnotation android.test.suitebuilder.examples.error.RunAsPartOfSeparateTest \ -w com.android.frameworks.testrunner.tests/android.test.InstrumentationTestRunner # LOCAL_MODULE_TAGS := tests LOCAL_MODULE_TAGS := tests LOCAL_JAVA_LIBRARIES := android.test.runner LOCAL_JAVA_LIBRARIES := android.test.runner Loading test-runner/tests/src/android/test/TestCaseUtilTest.java +1 −3 Original line number Original line Diff line number Diff line Loading @@ -29,9 +29,7 @@ public class TestCaseUtilTest extends TestCase { List<String> testCaseNames = TestCaseUtil.getTestCaseNames(testSuite, false); List<String> testCaseNames = TestCaseUtil.getTestCaseNames(testSuite, false); assertEquals(2, testCaseNames.size()); assertEquals(0, testCaseNames.size()); assertTrue(testCaseNames.get(0).endsWith("OneTestTestCase")); assertTrue(testCaseNames.get(1).endsWith("OneTestTestSuite")); } } public void testGetTestCaseNamesForTestCaseWithSuiteMethod() throws Exception { public void testGetTestCaseNamesForTestCaseWithSuiteMethod() throws Exception { Loading test-runner/tests/src/android/test/suitebuilder/TestSuiteBuilderTest.java +17 −4 Original line number Original line Diff line number Diff line Loading @@ -135,10 +135,23 @@ public class TestSuiteBuilderTest extends TestCase { TestSuite testSuite = new OuterTest().buildTestsUnderHereRecursively(); TestSuite testSuite = new OuterTest().buildTestsUnderHereRecursively(); assertContentsInOrder(getTestCaseNames(testSuite), assertContentsInOrder(getTestCaseNames(testSuite), "testOuter", "testErrorOne", "testErrorTwo", "testFailOne", "testFailTwo", "testOuter", "testInstrumentation", "testLevel1", "testLevel2", "testAnotherOne", "testPublicConstructor", "testSimpleOne", "testSimpleTwo", "testNonSmoke", "testSmoke", "testSubclass", "testErrorOne", "testSuperclass", "testUnSuppressedMethod"); "testErrorTwo", "testFailOne", "testFailTwo", "testInstrumentation", "testLevel1", "testLevel2", "testAnotherOne", "testSimpleOne", "testSimpleTwo", "testNonSmoke", "testSmoke", "testSubclass", "testSuperclass", "testUnSuppressedMethod"); } } private void assertContentsInOrder(List<String> actual, String... source) { private void assertContentsInOrder(List<String> actual, String... source) { Loading test-runner/tests/src/android/test/suitebuilder/examples/error/ErrorTest.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.test.suitebuilder.examples.error; import junit.framework.TestCase; import junit.framework.TestCase; @RunAsPartOfSeparateTest public class ErrorTest extends TestCase { public class ErrorTest extends TestCase { public void testErrorOne() throws Exception { public void testErrorOne() throws Exception { Loading test-runner/tests/src/android/test/suitebuilder/examples/error/FailingTest.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.test.suitebuilder.examples.error; import junit.framework.TestCase; import junit.framework.TestCase; @RunAsPartOfSeparateTest public class FailingTest extends TestCase { public class FailingTest extends TestCase { public void testFailOne() throws Exception { public void testFailOne() throws Exception { Loading Loading
test-runner/tests/Android.mk +7 −0 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,13 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) include $(CLEAR_VARS) # We only want this apk build for tests. # We only want this apk build for tests. # # Run the tests using the following commands: # adb -r install ${ANDROID_PRODUCT_OUT}/data/app/FrameworkTestRunnerTests/FrameworkTestRunnerTests.apk # adb shell am instrument \ -e notAnnotation android.test.suitebuilder.examples.error.RunAsPartOfSeparateTest \ -w com.android.frameworks.testrunner.tests/android.test.InstrumentationTestRunner # LOCAL_MODULE_TAGS := tests LOCAL_MODULE_TAGS := tests LOCAL_JAVA_LIBRARIES := android.test.runner LOCAL_JAVA_LIBRARIES := android.test.runner Loading
test-runner/tests/src/android/test/TestCaseUtilTest.java +1 −3 Original line number Original line Diff line number Diff line Loading @@ -29,9 +29,7 @@ public class TestCaseUtilTest extends TestCase { List<String> testCaseNames = TestCaseUtil.getTestCaseNames(testSuite, false); List<String> testCaseNames = TestCaseUtil.getTestCaseNames(testSuite, false); assertEquals(2, testCaseNames.size()); assertEquals(0, testCaseNames.size()); assertTrue(testCaseNames.get(0).endsWith("OneTestTestCase")); assertTrue(testCaseNames.get(1).endsWith("OneTestTestSuite")); } } public void testGetTestCaseNamesForTestCaseWithSuiteMethod() throws Exception { public void testGetTestCaseNamesForTestCaseWithSuiteMethod() throws Exception { Loading
test-runner/tests/src/android/test/suitebuilder/TestSuiteBuilderTest.java +17 −4 Original line number Original line Diff line number Diff line Loading @@ -135,10 +135,23 @@ public class TestSuiteBuilderTest extends TestCase { TestSuite testSuite = new OuterTest().buildTestsUnderHereRecursively(); TestSuite testSuite = new OuterTest().buildTestsUnderHereRecursively(); assertContentsInOrder(getTestCaseNames(testSuite), assertContentsInOrder(getTestCaseNames(testSuite), "testOuter", "testErrorOne", "testErrorTwo", "testFailOne", "testFailTwo", "testOuter", "testInstrumentation", "testLevel1", "testLevel2", "testAnotherOne", "testPublicConstructor", "testSimpleOne", "testSimpleTwo", "testNonSmoke", "testSmoke", "testSubclass", "testErrorOne", "testSuperclass", "testUnSuppressedMethod"); "testErrorTwo", "testFailOne", "testFailTwo", "testInstrumentation", "testLevel1", "testLevel2", "testAnotherOne", "testSimpleOne", "testSimpleTwo", "testNonSmoke", "testSmoke", "testSubclass", "testSuperclass", "testUnSuppressedMethod"); } } private void assertContentsInOrder(List<String> actual, String... source) { private void assertContentsInOrder(List<String> actual, String... source) { Loading
test-runner/tests/src/android/test/suitebuilder/examples/error/ErrorTest.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.test.suitebuilder.examples.error; import junit.framework.TestCase; import junit.framework.TestCase; @RunAsPartOfSeparateTest public class ErrorTest extends TestCase { public class ErrorTest extends TestCase { public void testErrorOne() throws Exception { public void testErrorOne() throws Exception { Loading
test-runner/tests/src/android/test/suitebuilder/examples/error/FailingTest.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.test.suitebuilder.examples.error; import junit.framework.TestCase; import junit.framework.TestCase; @RunAsPartOfSeparateTest public class FailingTest extends TestCase { public class FailingTest extends TestCase { public void testFailOne() throws Exception { public void testFailOne() throws Exception { Loading