Skip to content

Commit

Permalink
Issue checkstyle#7799: Resolve Pitest Issues - AvoidStarImportCheck (1)
Browse files Browse the repository at this point in the history
  • Loading branch information
wilcoln committed Mar 13, 2020
1 parent ce28f73 commit d173c53
Showing 1 changed file with 16 additions and 0 deletions.
Expand Up @@ -95,6 +95,22 @@ public void testAllowStaticMemberImports() throws Exception {
verify(checkConfig, getPath("InputAvoidStarImportDefault.java"), expected2);
}

@Test
public void testDenyStaticMemberImports() throws Exception {
final DefaultConfiguration checkConfig = createModuleConfig(AvoidStarImportCheck.class);
checkConfig.addAttribute("allowStaticMemberImports", "false");
// deny all static star imports
final String[] expected2 = {
"7: " + getCheckMessage(MSG_KEY, "com.puppycrawl.tools.checkstyle.checks.imports.*"),
"9: " + getCheckMessage(MSG_KEY, "java.io.*"),
"10: " + getCheckMessage(MSG_KEY, "java.lang.*"),
"25: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"),
"26: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"),
"28: " + getCheckMessage(MSG_KEY, "java.io.File.*"),
};
verify(checkConfig, getPath("InputAvoidStarImportDefault.java"), expected2);
}

@Test
public void testGetAcceptableTokens() {
final AvoidStarImportCheck testCheckObject =
Expand Down

0 comments on commit d173c53

Please sign in to comment.