Skip to content

Commit

Permalink
Issue #7801: Resolve Pitest Issues - AvoidStaticImportCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurabdg committed Mar 11, 2020
1 parent e73ec41 commit 70cfe65
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ public void testDefaultOperation()
"26: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"),
"27: " + getCheckMessage(MSG_KEY, "java.io.File.createTempFile"),
"28: " + getCheckMessage(MSG_KEY, "java.io.File.pathSeparator"),
"29: " + getCheckMessage(MSG_KEY,
"29: " + getCheckMessage(MSG_KEY, "java.lang.Math.sqrt"),
"30: " + getCheckMessage(MSG_KEY,
"com.puppycrawl.tools.checkstyle.checks.imports."
+ "avoidstaticimport.InputAvoidStaticImportNestedClass.InnerClass"),
"30: " + getCheckMessage(MSG_KEY,
"31: " + getCheckMessage(MSG_KEY,
"com.puppycrawl.tools.checkstyle.checks.imports."
+ "avoidstaticimport.InputAvoidStaticImportNestedClass.InnerClass.one"),
};
Expand All @@ -76,10 +77,11 @@ public void testStarExcludes()
final String[] expected = {
"25: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"),
"26: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"),
"29: " + getCheckMessage(MSG_KEY,
"29: " + getCheckMessage(MSG_KEY, "java.lang.Math.sqrt"),
"30: " + getCheckMessage(MSG_KEY,
"com.puppycrawl.tools.checkstyle.checks.imports."
+ "avoidstaticimport.InputAvoidStaticImportNestedClass.InnerClass"),
"30: " + getCheckMessage(MSG_KEY,
"31: " + getCheckMessage(MSG_KEY,
"com.puppycrawl.tools.checkstyle.checks.imports."
+ "avoidstaticimport.InputAvoidStaticImportNestedClass.InnerClass.one"),
};
Expand All @@ -91,17 +93,18 @@ public void testMemberExcludes()
throws Exception {
final DefaultConfiguration checkConfig =
createModuleConfig(AvoidStaticImportCheck.class);
checkConfig.addAttribute("excludes", "java.io.File.listRoots");
checkConfig.addAttribute("excludes", "java.io.File.listRoots,java.lang.Math.E");
// allow the java.io.File.listRoots member imports
final String[] expected = {
"25: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"),
"26: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"),
"27: " + getCheckMessage(MSG_KEY, "java.io.File.createTempFile"),
"28: " + getCheckMessage(MSG_KEY, "java.io.File.pathSeparator"),
"29: " + getCheckMessage(MSG_KEY,
"29: " + getCheckMessage(MSG_KEY, "java.lang.Math.sqrt"),
"30: " + getCheckMessage(MSG_KEY,
"com.puppycrawl.tools.checkstyle.checks.imports."
+ "avoidstaticimport.InputAvoidStaticImportNestedClass.InnerClass"),
"30: " + getCheckMessage(MSG_KEY,
"31: " + getCheckMessage(MSG_KEY,
"com.puppycrawl.tools.checkstyle.checks.imports."
+ "avoidstaticimport.InputAvoidStaticImportNestedClass.InnerClass.one"),
};
Expand All @@ -126,10 +129,11 @@ public void testBogusMemberExcludes()
"26: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"),
"27: " + getCheckMessage(MSG_KEY, "java.io.File.createTempFile"),
"28: " + getCheckMessage(MSG_KEY, "java.io.File.pathSeparator"),
"29: " + getCheckMessage(MSG_KEY,
"29: " + getCheckMessage(MSG_KEY, "java.lang.Math.sqrt"),
"30: " + getCheckMessage(MSG_KEY,
"com.puppycrawl.tools.checkstyle.checks.imports."
+ "avoidstaticimport.InputAvoidStaticImportNestedClass.InnerClass"),
"30: " + getCheckMessage(MSG_KEY,
"31: " + getCheckMessage(MSG_KEY,
"com.puppycrawl.tools.checkstyle.checks.imports."
+ "avoidstaticimport.InputAvoidStaticImportNestedClass.InnerClass.one"),
};
Expand All @@ -154,7 +158,8 @@ public void testInnerClassMemberExcludesStar()
"26: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"),
"27: " + getCheckMessage(MSG_KEY, "java.io.File.createTempFile"),
"28: " + getCheckMessage(MSG_KEY, "java.io.File.pathSeparator"),
"29: " + getCheckMessage(MSG_KEY,
"29: " + getCheckMessage(MSG_KEY, "java.lang.Math.sqrt"),
"30: " + getCheckMessage(MSG_KEY,
"com.puppycrawl.tools.checkstyle.checks.imports."
+ "avoidstaticimport.InputAvoidStaticImportNestedClass.InnerClass"),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import static javax.swing.WindowConstants.*;
import static java.io.File.createTempFile;
import static java.io.File.pathSeparator;
import static java.lang.Math.sqrt;
import static com.puppycrawl.tools.checkstyle.checks.imports.avoidstaticimport.InputAvoidStaticImportNestedClass.InnerClass;
import static com.puppycrawl.tools.checkstyle.checks.imports.avoidstaticimport.InputAvoidStaticImportNestedClass.InnerClass.one;

Expand Down

0 comments on commit 70cfe65

Please sign in to comment.