Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.33: when two classes have the same name but in different packages, mutation testing output is correct but the source is wrong! #117

Closed
fge opened this issue May 9, 2014 · 3 comments

Comments

@fge
Copy link

fge commented May 9, 2014

The package is this one. I have two classes named DefaultValueStack, one in com.github.parboiled1.grappa.stack and another in org.parboiled.support.

I use the gradle plugin configured as such since the default package is not the group name:

pitest {
    // Since for now it is org.parboiled, we cannot leave the default.
    // By default it is ${project.group}.
    targetClasses = [ "org.parboiled.*", "com.github.parboiled1.*" ];
}

When generating the report, I have the surprise to see that the source of DefaultValueStack displayed for com.github.parboiled1.grappa.stack.DefaultValueStack.java is in fact the one of org.parboiled.support.DefaultValuStack.java...

Surmising at first that this had to do with the order in which the packages were declared in targetClasses, I inverted the order in the above; but it is still org.parboiled.support.DefaultValueStack.java which is displayed.

It therefore appears that the "winner" is always the one which is the greatest wrt canonical string ordering...

@fge
Copy link
Author

fge commented May 9, 2014

If that matters, more about my environment:

  • gradle 1.12,
  • plugin used is (group: "info.solidsoft.gradle.pitest", name: "gradle-pitest-plugin", version: "0.33.0") which uses pitest 0.33,
  • TestNG 6.8.7 (although I believe pitest uses its own version, 6.1.1 IIRC),
  • tried with Oracle's JDK 6u45, not yet with 7u55 or 8u5 although I would be surprised that it'd change anything.

@nespera
Copy link
Contributor

nespera commented May 10, 2014

I've submitted a pull request and confirmed that the report looks correct with this change.

@hcoles
Copy link
Owner

hcoles commented May 11, 2014

@fge thanks for the report - surprised that this has been there so long without being spotted. @nespera thanks for the fix, now merged in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants