Skip to content

Commit

Permalink
Issue checkstyle#7875: resolve pitest issue for ImportOrderCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
strkkk committed Dec 17, 2020
1 parent ac1bfa1 commit a1c1945
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
1 change: 0 additions & 1 deletion .ci/pitest.sh
Expand Up @@ -64,7 +64,6 @@ pitest-imports)
mvn -e -P$1 clean test org.pitest:pitest-maven:mutationCoverage;
declare -a ignoredItems=(
"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>"
"ImportOrderCheck.java.html:<td class='covered'><pre><span class='survived'> if (!CommonUtil.endsWithChar(pkg, &#39;.&#39;)) {</span></pre></td></tr>"
"ImportOrderCheck.java.html:<td class='covered'><pre><span class='survived'> return !beforeFirstImport &#38;&#38; line - lastImportLine &#62; 1;</span></pre></td></tr>"
"ImportOrderCheck.java.html:<td class='covered'><pre><span class='survived'> staticImportSeparator = isStatic &#38;&#38; separated;</span></pre></td></tr>"
"PkgImportControl.java.html:<td class='covered'><pre><span class='survived'> if (alreadyRegex) {</span></pre></td></tr>"
Expand Down
Expand Up @@ -657,10 +657,12 @@ public void testGroupWithSlashes() throws Exception {
@Test
public void testGroupWithDot() throws Exception {
final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class);
checkConfig.addAttribute("groups", "java.awt.");
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;

verify(checkConfig, getPath("InputImportOrder_NoFailureForRedundantImports.java"),
checkConfig.addAttribute("groups", "javax.swing.,java.awt.");
final String[] expected = {
"5:1: " + getCheckMessage(MSG_ORDERING, "java.awt.Dialog"),
"7:1: " + getCheckMessage(MSG_ORDERING, "javax.swing.JComponent"),
};
verify(checkConfig, getPath("InputImportOrder_DotPackageName.java"),
expected);
}

Expand Down
@@ -0,0 +1,12 @@
package com.puppycrawl.tools.checkstyle.checks.imports.importorder;

import java.awt.Button;
import java.awt.Frame;
import java.awt.Dialog;
import java.awt.event.ActionEvent;
import javax.swing.JComponent;
import javax.swing.JTable;

public class InputImportOrder_DotPackageName {
}

0 comments on commit a1c1945

Please sign in to comment.