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