Skip to content

Commit

Permalink
Issue checkstyle#7802: Resolve Pitest Issues - CustomImportOrderCheck…
Browse files Browse the repository at this point in the history
… (1)
  • Loading branch information
wltan committed Mar 11, 2020
1 parent 37b2a14 commit 88bb89b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .ci/pitest.sh
Expand Up @@ -74,11 +74,9 @@ pitest-imports)
"AvoidStarImportCheck.java.html:<td class='covered'><pre><span class='survived'> &#38;&#38; ast.getType() == TokenTypes.STATIC_IMPORT) {</span></pre></td></tr>"
"AvoidStarImportCheck.java.html:<td class='covered'><pre><span class='survived'> if (exclude.endsWith(STAR_IMPORT_SUFFIX)) {</span></pre></td></tr>"
"AvoidStaticImportCheck.java.html:<td class='covered'><pre><span class='survived'> if (exclude.endsWith(&#34;.*&#34;)) {</span></pre></td></tr>"
"CustomImportOrderCheck.java.html:<td class='covered'><pre><span class='survived'> &#38;&#38; matcher.start() &#60; betterMatchCandidate.matchPosition) {</span></pre></td></tr>"
"CustomImportOrderCheck.java.html:<td class='covered'><pre><span class='survived'> else if (customImportOrderRules.contains(SAME_PACKAGE_RULE_GROUP)) {</span></pre></td></tr>"
"CustomImportOrderCheck.java.html:<td class='covered'><pre><span class='survived'> if (bestMatch.group.equals(NON_GROUP_RULE_GROUP)) {</span></pre></td></tr>"
"CustomImportOrderCheck.java.html:<td class='covered'><pre><span class='survived'> if (customImportOrderRules.contains(SAME_PACKAGE_RULE_GROUP)) {</span></pre></td></tr>"
"CustomImportOrderCheck.java.html:<td class='covered'><pre><span class='survived'> || length == betterMatchCandidate.matchLength</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>"
Expand Down
Expand Up @@ -686,7 +686,9 @@ public void testMultiplePatternMatchesSecondPatternIsLonger() throws Exception {
checkConfig.addAttribute("standardPackageRegExp", "junit");

createChecker(checkConfig);
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
final String[] expected = {
"4: " + getCheckMessage(MSG_NONGROUP_EXPECTED, STD, "org.junit.Test"),
};
verify(checkConfig, getPath("InputCustomImportOrder_MultiplePatternMatches.java"),
expected);
}
Expand All @@ -701,7 +703,9 @@ public void testMultiplePatternMatchesFirstPatternHasLaterPosition() throws Exce
checkConfig.addAttribute("standardPackageRegExp", "unit");

createChecker(checkConfig);
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
final String[] expected = {
"4: " + getCheckMessage(MSG_NONGROUP_EXPECTED, STD, "org.junit.Test"),
};
verify(checkConfig, getPath("InputCustomImportOrder_MultiplePatternMatches.java"),
expected);
}
Expand All @@ -716,7 +720,9 @@ public void testMultiplePatternMatchesFirstPatternHasEarlierPosition() throws Ex
checkConfig.addAttribute("standardPackageRegExp", "Test");

createChecker(checkConfig);
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
final String[] expected = {
"4: " + getCheckMessage(MSG_NONGROUP_EXPECTED, SPECIAL, "org.junit.Test"),
};
verify(checkConfig, getPath("InputCustomImportOrder_MultiplePatternMatches.java"),
expected);
}
Expand Down
@@ -1,5 +1,6 @@
package com.puppycrawl.tools.checkstyle.checks.imports.customimportorder;

import java.util.Scanner;
import org.junit.Test;

public class InputCustomImportOrder_MultiplePatternMatches {
Expand Down

0 comments on commit 88bb89b

Please sign in to comment.