use of fr.inria.diversify.dspot.amplifier.TestMethodCallAdder in project dspot by STAMP-project.
the class DSpotTest method testExcludedClassesInPropertyFile.
@Test
public void testExcludedClassesInPropertyFile() throws Exception {
/*
Usage of properties:
- excludedClasses: list of full qualified name of test classes to be excluded (separated by comma ',')
- excludedTestCases: list of name of test cases (methods) to be excluded (separated by comma ',')
*/
final MockDSpot dSpot = new MockDSpot(Utils.getInputConfiguration(), 1, Collections.singletonList(new TestMethodCallAdder()), new JacocoCoverageSelector());
// the test class fr.inria.filter.passing.PassingTest has 2 method, but only one is amplified
assertEquals(2, Utils.findClass("fr.inria.filter.passing.PassingTest").getMethods().size());
// the test class fr.inria.filter.failing.FailingTest match the regex, but it is excluded in the properties
final List<CtType> ctTypes = dSpot.amplifyTest("fr.inria.filter.*");
assertEquals(1, ctTypes.size());
// uses the mock to retrieve the number of method to be amplified
assertEquals(1, dSpot.numberOfMethod);
}
Aggregations