use of junit.framework.Test in project android_frameworks_base by ParanoidAndroid.
the class ListTestCaseNames method getTestNames.
/**
* 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;
}
use of junit.framework.Test in project android_frameworks_base by ParanoidAndroid.
the class InstrumentationTestRunnerTest method assertTestRunnerCalledWithExpectedParameters.
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());
}
use of junit.framework.Test in project android_frameworks_base by ParanoidAndroid.
the class TestCaseUtilTest method testCreateTestForTestCaseWithSuiteMethod.
public void testCreateTestForTestCaseWithSuiteMethod() throws Exception {
Test test = TestCaseUtil.createTestSuite(OneTestTestCaseWithSuite.class);
assertEquals(1, test.countTestCases());
}
use of junit.framework.Test in project android_frameworks_base by ParanoidAndroid.
the class TestCaseUtilTest method testCreateTestForTestCase.
public void testCreateTestForTestCase() throws Exception {
Test test = TestCaseUtil.createTestSuite(OneTestTestCase.class);
assertEquals(1, test.countTestCases());
}
use of junit.framework.Test in project robovm by robovm.
the class RoboVMAllTests method wrapTests.
private static TestSuite wrapTests(TestSuite tests) {
TestSuite result = new TestSuite();
Enumeration<Test> en = tests.tests();
while (en.hasMoreElements()) {
Test test = en.nextElement();
result.addTest(new ForgettingTestWrapper(test));
}
return result;
}
Aggregations