Search in sources :

Example 11 with TestSuite

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

the class UnitTestSuiteBuilderTest method testShouldExcludeIntrumentationTests.

public void testShouldExcludeIntrumentationTests() throws Exception {
    unitTestSuiteBuilder.includePackages(packageFor(InstrumentationTest.class));
    TestSuite testSuite = unitTestSuiteBuilder.build();
    Assert.assertEquals(0, ListTestCaseNames.getTestCaseNames(testSuite).size());
    SuiteExecutionRecorder recorder = runSuite(unitTestSuiteBuilder);
    assertFalse(recorder.saw("InstrumentationTest.testInstrumentation"));
    assertTrue(recorder.testsSeen.isEmpty());
}
Also used : TestSuite(junit.framework.TestSuite) InstrumentationTest(android.test.suitebuilder.examples.instrumentation.InstrumentationTest)

Example 12 with TestSuite

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

the class LayoutTestsAutoRunner method getAllTests.

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

Example 13 with TestSuite

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

the class RsPerfTestRunner method getAllTests.

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

Example 14 with TestSuite

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

the class SmokeTestRunner method getAllTests.

/**
     * Returns a single testcase for each app to launch
     */
@Override
public TestSuite getAllTests() {
    final TestSuite suite = new TestSuite(SUITE_NAME);
    final PackageManager pm = getTargetContext().getPackageManager();
    final List<ResolveInfo> apps = ProcessErrorsTest.getLauncherActivities(pm);
    final TestCase setupTest = new ProcessErrorsTest() {

        @Override
        public void runTest() throws Exception {
            testSetUpConditions();
        }
    };
    setupTest.setName("testSetUpConditions");
    suite.addTest(setupTest);
    final TestCase postBootTest = new ProcessErrorsTest() {

        @Override
        public void runTest() throws Exception {
            testNoProcessErrorsAfterBoot();
        }
    };
    postBootTest.setName("testNoProcessErrorsAfterBoot");
    suite.addTest(postBootTest);
    for (final ResolveInfo app : apps) {
        final TestCase appTest = new ProcessErrorsTest() {

            @Override
            public void runTest() throws Exception {
                final Set<ProcessError> errSet = new HashSet<ProcessError>();
                final Collection<ProcessError> errProcs = runOneActivity(app);
                if (errProcs != null) {
                    errSet.addAll(errProcs);
                }
                if (!errSet.isEmpty()) {
                    fail(String.format("Got %d errors:\n%s", errSet.size(), reportWrappedListContents(errSet)));
                }
            }
        };
        appTest.setName(app.activityInfo.name);
        suite.addTest(appTest);
    }
    final TestCase asyncErrorTest = new ProcessErrorsTest() {

        @Override
        public void runTest() throws Exception {
            testZZReportAsyncErrors();
        }
    };
    asyncErrorTest.setName("testAsynchronousErrors");
    suite.addTest(asyncErrorTest);
    return suite;
}
Also used : ResolveInfo(android.content.pm.ResolveInfo) TestSuite(junit.framework.TestSuite) PackageManager(android.content.pm.PackageManager) TestCase(junit.framework.TestCase) HashSet(java.util.HashSet)

Example 15 with TestSuite

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

the class BluetoothTestRunner method getAllTests.

@Override
public TestSuite getAllTests() {
    TestSuite suite = new InstrumentationTestSuite(this);
    suite.addTestSuite(BluetoothStressTest.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