Search in sources :

Example 71 with TestSuite

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

the class InstrumentationTestSuiteBuilderTest method testShouldOnlyIncludeIntrumentationTests.

public void testShouldOnlyIncludeIntrumentationTests() throws Exception {
    TestSuite testSuite = new OuterTest().buildTestsUnderHereWith(instrumentationTestSuiteBuilder);
    List<String> testCaseNames = getTestCaseNames(testSuite);
    assertEquals(1, testCaseNames.size());
    assertEquals("testInstrumentation", testCaseNames.get(0));
}
Also used : TestSuite(junit.framework.TestSuite) OuterTest(android.test.suitebuilder.examples.OuterTest)

Example 72 with TestSuite

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

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 73 with TestSuite

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

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 74 with TestSuite

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

the class TestSuiteBuilder method addSuiteIfNecessary.

private void addSuiteIfNecessary(String parentClassname) {
    if (!parentClassname.equals(currentClassname)) {
        currentClassname = parentClassname;
        suiteForCurrentClass = new TestSuite(parentClassname);
        rootSuite.addTest(suiteForCurrentClass);
    }
}
Also used : TestSuite(junit.framework.TestSuite)

Example 75 with TestSuite

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

the class InstrumentationTestRunnerTest method testUseSelfAsTestSuiteProviderWhenNoMetaDataOrClassArgument.

public void testUseSelfAsTestSuiteProviderWhenNoMetaDataOrClassArgument() throws Exception {
    TestSuite testSuite = new TestSuite();
    testSuite.addTestSuite(PlaceHolderTest.class);
    mInstrumentationTestRunner.setAllTestsSuite(testSuite);
    mInstrumentationTestRunner.onCreate(null);
    assertTestRunnerCalledWithExpectedParameters(PlaceHolderTest.class.getName(), "testPlaceHolder");
}
Also used : TestSuite(junit.framework.TestSuite)

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