Skip to content

Commit

Permalink
Issue checkstyle#7854: Resolve Pitest Issues - IllegalImportCheck (1)
Browse files Browse the repository at this point in the history
  • Loading branch information
akki111singh authored and RayRCaringal committed Apr 7, 2020
1 parent 2f142c0 commit 2cf7f28
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion .ci/pitest.sh
Expand Up @@ -72,7 +72,6 @@ pitest-imports)
mvn -e -P$1 clean test org.pitest:pitest-maven:mutationCoverage;
declare -a ignoredItems=(
"CustomImportOrderCheck.java.html:<td class='covered'><pre><span class='survived'> if (bestMatch.group.equals(NON_GROUP_RULE_GROUP)) {</span></pre></td></tr>"
"IllegalImportCheck.java.html:<td class='covered'><pre><span class='survived'> if (regexp) {</span></pre></td></tr>"
"IllegalImportCheck.java.html:<td class='covered'><pre><span class='survived'> if (!result &#38;&#38; illegalClasses != null) {</span></pre></td></tr>"
"IllegalImportCheck.java.html:<td class='covered'><pre><span class='survived'> if (!result) {</span></pre></td></tr>"
"ImportControlLoader.java.html:<td class='covered'><pre><span class='survived'> else if (ALLOW_ELEMENT_NAME.equals(qName) || &#34;disallow&#34;.equals(qName)) {</span></pre></td></tr>"
Expand Down
Expand Up @@ -93,6 +93,20 @@ public void testIllegalClasses()
verify(checkConfig, getNonCompilablePath("InputIllegalImportDefault.java"), expected);
}

@Test
public void testIllegalClassesStarImport()
throws Exception {
final DefaultConfiguration checkConfig =
createModuleConfig(IllegalImportCheck.class);
checkConfig.addAttribute("illegalClasses", "java.io.*");
final String[] expected = {
"9:1: " + getCheckMessage(MSG_KEY, "java.io.*"),
"15:1: " + getCheckMessage(MSG_KEY, "sun.applet.*"),
"28:1: " + getCheckMessage(MSG_KEY, "sun.*"),
};
verify(checkConfig, getNonCompilablePath("InputIllegalImportDefault.java"), expected);
}

@Test
public void testIllegalPackagesRegularExpression()
throws Exception {
Expand Down

0 comments on commit 2cf7f28

Please sign in to comment.