Methods Summary |
---|
private static java.lang.String | packageFor(java.lang.Class clazz)
String className = clazz.getName();
return className.substring(0, className.lastIndexOf('."));
|
private android.test.suitebuilder.UnitTestSuiteBuilderTest$SuiteExecutionRecorder | runSuite(TestSuiteBuilder builder)
TestSuite suite = builder.build();
SuiteExecutionRecorder recorder = new SuiteExecutionRecorder();
TestResult result = new TestResult();
result.addListener(recorder);
suite.run(result);
return recorder;
|
protected void | setUp()
super.setUp();
unitTestSuiteBuilder = new UnitTestSuiteBuilder(getClass());
|
public void | testShouldExcludeIntrumentationTests()
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());
|