Search in sources :

Example 46 with TestSuite

use of junit.framework.TestSuite in project android_frameworks_base by ResurrectionRemix.

the class UnitTestSuiteBuilderTest method runSuite.

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;
}
Also used : TestSuite(junit.framework.TestSuite) TestResult(junit.framework.TestResult)

Example 47 with TestSuite

use of junit.framework.TestSuite in project android_frameworks_base by ResurrectionRemix.

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;
}
Also used : Enumeration(java.util.Enumeration) TestSuite(junit.framework.TestSuite) Test(junit.framework.Test) TestCase(junit.framework.TestCase)

Example 48 with TestSuite

use of junit.framework.TestSuite in project android_frameworks_base by ResurrectionRemix.

the class ConnectivityManagerStressTestRunner method getAllTests.

@Override
public TestSuite getAllTests() {
    TestSuite suite = new InstrumentationTestSuite(this);
    suite.addTestSuite(WifiApStress.class);
    suite.addTestSuite(WifiStressTest.class);
    return suite;
}
Also used : TestSuite(junit.framework.TestSuite) InstrumentationTestSuite(android.test.InstrumentationTestSuite) InstrumentationTestSuite(android.test.InstrumentationTestSuite)

Example 49 with TestSuite

use of junit.framework.TestSuite in project android_frameworks_base by ResurrectionRemix.

the class OsTests method suite.

public static TestSuite suite() {
    TestSuite suite = new TestSuite(OsTests.class.getName());
    suite.addTestSuite(AidlTest.class);
    suite.addTestSuite(BroadcasterTest.class);
    suite.addTestSuite(FileObserverTest.class);
    suite.addTestSuite(IdleHandlerTest.class);
    suite.addTestSuite(MessageQueueTest.class);
    suite.addTestSuite(MessengerTest.class);
    suite.addTestSuite(PatternMatcherTest.class);
    suite.addTestSuite(SystemPropertiesTest.class);
    return suite;
}
Also used : TestSuite(junit.framework.TestSuite)

Example 50 with TestSuite

use of junit.framework.TestSuite in project android_frameworks_base by ResurrectionRemix.

the class DownloadManagerTestRunner method getAllTests.

@Override
public TestSuite getAllTests() {
    TestSuite suite = new InstrumentationTestSuite(this);
    suite.addTestSuite(DownloadManagerTestApp.class);
    return suite;
}
Also used : TestSuite(junit.framework.TestSuite) InstrumentationTestSuite(android.test.InstrumentationTestSuite) InstrumentationTestSuite(android.test.InstrumentationTestSuite)

Aggregations

TestSuite (junit.framework.TestSuite)1380 InstrumentationTestSuite (android.test.InstrumentationTestSuite)100 Test (junit.framework.Test)63 GwtIncompatible (com.google.common.annotations.GwtIncompatible)54 JUnit4TestAdapter (junit.framework.JUnit4TestAdapter)50 TestCase (junit.framework.TestCase)48 Entry (java.util.Map.Entry)36 TestResult (junit.framework.TestResult)33 List (java.util.List)28 Set (java.util.Set)27 TestProjectSetup (org.eclipse.wst.jsdt.web.ui.tests.internal.TestProjectSetup)27 ArrayList (java.util.ArrayList)25 ListTestSuiteBuilder (com.google.common.collect.testing.ListTestSuiteBuilder)24 TestStringSetGenerator (com.google.common.collect.testing.TestStringSetGenerator)24 Map (java.util.Map)19 File (java.io.File)16 Method (java.lang.reflect.Method)16 HashSet (java.util.HashSet)13 Helpers.mapEntry (com.google.common.collect.testing.Helpers.mapEntry)12 TestStringMultisetGenerator (com.google.common.collect.testing.google.TestStringMultisetGenerator)12