use of junit.framework.Test in project android_frameworks_base by DirtyUnicorns.
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 android_frameworks_base by DirtyUnicorns.
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 DirtyUnicorns.
the class TestCaseUtilTest method testCreateTestForTestSuiteWithSuiteMethod.
public void testCreateTestForTestSuiteWithSuiteMethod() throws Exception {
Test test = TestCaseUtil.createTestSuite(TwoTestsInTestSuite.class);
assertEquals(2, test.countTestCases());
}
use of junit.framework.Test in project android_frameworks_base by DirtyUnicorns.
the class TestCaseUtil method getTests.
private static List<? extends Test> getTests(Test test, boolean flatten, Set<Class<?>> seen) {
List<Test> testCases = Lists.newArrayList();
if (test != null) {
Test workingTest = null;
/*
* If we want to run a single TestCase method only, we must not
* invoke the suite() method, because we will run all test methods
* of the class then.
*/
if (test instanceof TestCase && ((TestCase) test).getName() == null) {
workingTest = invokeSuiteMethodIfPossible(test.getClass(), seen);
}
if (workingTest == null) {
workingTest = test;
}
if (workingTest instanceof TestSuite) {
TestSuite testSuite = (TestSuite) workingTest;
Enumeration enumeration = testSuite.tests();
while (enumeration.hasMoreElements()) {
Test childTest = (Test) enumeration.nextElement();
if (flatten) {
testCases.addAll(getTests(childTest, flatten, seen));
} else {
testCases.add(childTest);
}
}
} else {
testCases.add(workingTest);
}
}
return testCases;
}
use of junit.framework.Test in project intellij-community by JetBrains.
the class TestAllInPackage2 method skipSuiteComponents.
private static void skipSuiteComponents(Set allNames, Test suite) {
if (suite instanceof TestRunnerUtil.SuiteMethodWrapper) {
final Test test = ((TestRunnerUtil.SuiteMethodWrapper) suite).getSuite();
final String currentSuiteName = ((TestRunnerUtil.SuiteMethodWrapper) suite).getClassName();
skipSubtests(allNames, test, currentSuiteName);
}
}
Aggregations