Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pitest excludedMethods maven

I am trying to exclude PIT from mutating something I/O methods, such "close" and "flush". Here is my Maven configuration:

<plugin>
    <groupId>org.pitest</groupId>
    <artifactId>pitest-maven</artifactId>
    <version>1.1.3</version>
    <configuration>
        <targetClasses>
            <param>my.package.*.*</param>
        </targetClasses>
        <targetTests>                   
            <param>my.package.*.*</param>
        </targetTests>
        <excludedClasses>
            <param>my.generated.*</param>
            <param>**.*IT</param>                                
        </excludedClasses>
        <excludedMethods>
            <param>close</param>
            <param>flush</param>
        </excludedMethods>
        <reportSets>
            <reportSet>
                <reports>
                    <report>report</report>
                </reports>
            </reportSet>
        </reportSets>
    </configuration>
</plugin>

The excludedClasses seems to be working, but not the excludedMethods. i.e. the PIT result still says that remove the "close" and "flush" calls has no impact on the test result.

Question: What am I missing?

like image 999
ric Avatar asked Jun 10 '16 07:06

ric


1 Answers

Excluded methods is used to avoid creating mutants within methods that match the supplied list of names.

What I think you wish to do is stop creating mutants that remove calls to close and flush methods. This can be done using the avoidCallsTo parameter.

like image 86
henry Avatar answered Oct 12 '22 01:10

henry