diff options
| author | 2017-06-26 09:33:23 +0000 | |
|---|---|---|
| committer | 2017-06-26 09:33:23 +0000 | |
| commit | b5b6e7cf450c84be596ef895bda17ee09e6fa602 (patch) | |
| tree | ea7db2722cb0b201607b43fd553c642494bbf356 /test-runner/src | |
| parent | a29861b0c970055927675731e00e93c51f1c5668 (diff) | |
| parent | e38d5033944216f221a0a8e72bd12167373aae20 (diff) | |
Merge "Clean up TestCaseUtil" am: 43851d01d8
am: e38d503394
Change-Id: I62a80b405d05ec7b4da050bd6b01df4c965d6187
Diffstat (limited to 'test-runner/src')
| -rw-r--r-- | test-runner/src/android/test/TestCaseUtil.java | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/test-runner/src/android/test/TestCaseUtil.java b/test-runner/src/android/test/TestCaseUtil.java index dc053a2359a0..156290997a1b 100644 --- a/test-runner/src/android/test/TestCaseUtil.java +++ b/test-runner/src/android/test/TestCaseUtil.java @@ -40,16 +40,6 @@ public class TestCaseUtil { private TestCaseUtil() { } - @SuppressWarnings("unchecked") - public static List<String> getTestCaseNames(Test test, boolean flatten) { - List<Test> tests = (List<Test>) getTests(test, flatten); - List<String> testCaseNames = new ArrayList<>(); - for (Test aTest : tests) { - testCaseNames.add(getTestName(aTest)); - } - return testCaseNames; - } - public static List<? extends Test> getTests(Test test, boolean flatten) { return getTests(test, flatten, new HashSet<Class<?>>()); } @@ -92,7 +82,7 @@ public class TestCaseUtil { return testCases; } - private static Test invokeSuiteMethodIfPossible(Class testClass, + static Test invokeSuiteMethodIfPossible(Class testClass, Set<Class<?>> seen) { try { Method suiteMethod = testClass.getMethod( @@ -120,7 +110,7 @@ public class TestCaseUtil { return null; } - public static String getTestName(Test test) { + static String getTestName(Test test) { if (test instanceof TestCase) { TestCase testCase = (TestCase) test; return testCase.getName(); @@ -138,34 +128,4 @@ public class TestCaseUtil { } return ""; } - - public static Test getTestAtIndex(TestSuite testSuite, int position) { - int index = 0; - Enumeration enumeration = testSuite.tests(); - while (enumeration.hasMoreElements()) { - Test test = (Test) enumeration.nextElement(); - if (index == position) { - return test; - } - index++; - } - return null; - } - - public static TestSuite createTestSuite(Class<? extends Test> testClass) - throws InstantiationException, IllegalAccessException { - - Test test = invokeSuiteMethodIfPossible(testClass, - new HashSet<Class<?>>()); - if (test == null) { - return new TestSuite(testClass); - - } else if (TestCase.class.isAssignableFrom(test.getClass())) { - TestSuite testSuite = new TestSuite(test.getClass().getName()); - testSuite.addTest(test); - return testSuite; - } - - return (TestSuite) test; - } } |