Search in sources :

Example 41 with TestSuite

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

the class SmokeTestSuiteBuilderTest method testShouldOnlyIncludeSmokeTests.

public void testShouldOnlyIncludeSmokeTests() throws Exception {
    TestSuite testSuite = new SmokeTestSuiteBuilder(getClass()).includeAllPackagesUnderHere().build();
    List<String> testCaseNames = ListTestCaseNames.getTestCaseNames(testSuite);
    assertEquals("Unexpected number of smoke tests.", 1, testCaseNames.size());
    assertEquals("Unexpected test name", "testSmoke", testCaseNames.get(0));
}
Also used : TestSuite(junit.framework.TestSuite)

Example 42 with TestSuite

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

the class TestSuiteBuilderTest 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 43 with TestSuite

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

the class TestSuiteBuilderTest method testExcludePackage.

public void testExcludePackage() throws Exception {
    testSuiteBuilder.includePackages(packageFor(SimpleTest.class), packageFor(Level1Test.class)).excludePackages(packageFor(Level2Test.class));
    TestSuite testSuite = testSuiteBuilder.build();
    assertContentsInOrder(getTestCaseNames(testSuite), "testLevel1", "testAnotherOne", "testSimpleOne", "testSimpleTwo");
}
Also used : Level2Test(android.test.suitebuilder.examples.nested.nested.Level2Test) TestSuite(junit.framework.TestSuite)

Example 44 with TestSuite

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

the class TestSuiteBuilderTest method testIncludeAllPackagesUnderHere.

/**
     * This test calls {@link OuterTest#buildTestsUnderHereRecursively()} to control
     * the packages under test. The call to {@link TestSuiteBuilder#includeAllPackagesUnderHere()}
     * is made from there so that only return the example tests.
     */
public void testIncludeAllPackagesUnderHere() throws Exception {
    TestSuite testSuite = new OuterTest().buildTestsUnderHereRecursively();
    assertContentsInOrder(getTestCaseNames(testSuite), "testOuter", "testErrorOne", "testErrorTwo", "testFailOne", "testFailTwo", "testInstrumentation", "testLevel1", "testLevel2", "testAnotherOne", "testSimpleOne", "testSimpleTwo", "testNonSmoke", "testSmoke", "testSubclass", "testSuperclass", "testUnSuppressedMethod");
}
Also used : TestSuite(junit.framework.TestSuite) OuterTest(android.test.suitebuilder.examples.OuterTest)

Example 45 with TestSuite

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

the class InstrumentationTestRunnerTest method testMultipleTestClass.

public void testMultipleTestClass() throws Exception {
    String classArg = PlaceHolderTest.class.getName() + "," + PlaceHolderTest2.class.getName();
    mInstrumentationTestRunner.onCreate(createBundle(InstrumentationTestRunner.ARGUMENT_TEST_CLASS, classArg));
    Test test = mStubAndroidTestRunner.getTest();
    assertContentsInOrder(ListTestCaseNames.getTestNames((TestSuite) test), new TestDescriptor(PlaceHolderTest.class.getName(), "testPlaceHolder"), new TestDescriptor(PlaceHolderTest2.class.getName(), "testPlaceHolder2"));
}
Also used : TestSuite(junit.framework.TestSuite) Test(junit.framework.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest) TestDescriptor(android.test.suitebuilder.ListTestCaseNames.TestDescriptor)

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