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

Issue #6207: Add xpath regression test for UnusedImports #6975

Conversation

mincong-h
Copy link
Contributor

@mincong-h mincong-h commented Aug 12, 2019

This PR adds XPath regression test for suppression filter on UnusedImports check, see #6207.

@mincong-h mincong-h force-pushed the issue-6207-expand-xpath-it-regression-testing branch from 8b57a21 to fc00575 Compare August 13, 2019 11:33
Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok to merge.
We appreciate your help.

@pbludov , please finalize review

Copy link
Member

@pbludov pbludov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK to merge.

};

final List<String> expectedXpathQueries = Collections.singletonList(
"/IMPORT/DOT[./IDENT[@text='List']]/DOT/IDENT[@text='java']");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will suppress any import that matches import java.*.List, i.e.

import java.otherpackage.List;

I'm not sure they ever exist, so it's OK. However, the bad thing is that users can use this xpath as an example.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pbludov I believe this regression should be checking the output from the CLI when verifying the xpath. If you feel it is being too loose, then please make an issue on it.

private static List<String> generateXpathQueries(File fileToProcess,

@pbludov pbludov assigned rnveach and unassigned pbludov Aug 16, 2019
@rnveach rnveach merged commit bfd13dc into checkstyle:master Aug 16, 2019
@mincong-h mincong-h deleted the issue-6207-expand-xpath-it-regression-testing branch August 16, 2019 12:13
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

Successfully merging this pull request may close these issues.

None yet

4 participants