Search in sources :

Example 1 with TestMethodCallAdder

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);
}
Also used : CtType(spoon.reflect.declaration.CtType) TestMethodCallAdder(fr.inria.diversify.dspot.amplifier.TestMethodCallAdder) JacocoCoverageSelector(fr.inria.diversify.dspot.selector.JacocoCoverageSelector) Test(org.junit.Test) AbstractTest(fr.inria.AbstractTest)

Aggregations

AbstractTest (fr.inria.AbstractTest)1 TestMethodCallAdder (fr.inria.diversify.dspot.amplifier.TestMethodCallAdder)1 JacocoCoverageSelector (fr.inria.diversify.dspot.selector.JacocoCoverageSelector)1 Test (org.junit.Test)1 CtType (spoon.reflect.declaration.CtType)1