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));
}
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");
}
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());
}
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);
}
}
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");
}
Aggregations