Skip to content

Commit

Permalink
Issue checkstyle#7872: fixes Resolve Pitest Issues - ImportOrderCheck…
Browse files Browse the repository at this point in the history
… (1)
  • Loading branch information
shashwatj07 committed Sep 3, 2020
1 parent fafaa40 commit 3cf085c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
1 change: 0 additions & 1 deletion .ci/pitest.sh
Expand Up @@ -72,7 +72,6 @@ pitest-imports)
declare -a ignoredItems=(
"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>"
"ImportOrderCheck.java.html:<td class='covered'><pre><span class='survived'> else if (matcher.start() == bestPos &#38;&#38; matcher.end() &#62; bestEnd) {</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>"
Expand Down
1 change: 1 addition & 0 deletions config/checkstyle_input_suppressions.xml
Expand Up @@ -432,6 +432,7 @@
<suppress checks="Regexp" files="imports[\\/]importorder[\\/]InputImportOrderNonStaticWrongSequence.java"/>
<suppress checks="Regexp" files="imports[\\/]importorder[\\/]InputImportOrderRepetition.java"/>
<suppress checks="Regexp" files="imports[\\/]importorder[\\/]InputImportOrderSortStaticImportsAlphabetically.java"/>
<suppress checks="Regexp" files="imports[\\/]importorder[\\/]InputImportOrderSimilarGroupPattern.java"/>
<suppress checks="Regexp" files="imports[\\/]importorder[\\/]InputImportOrderStaticGroupOrderBottom.java"/>
<suppress checks="Regexp" files="imports[\\/]importorder[\\/]InputImportOrderStaticGroupOrderBottom_Negative2.java"/>
<suppress checks="Regexp" files="imports[\\/]importorder[\\/]InputImportOrderStaticGroupOrderBottom_Negative.java"/>
Expand Down
Expand Up @@ -223,6 +223,16 @@ public void testContainerCaseInsensitive() throws Exception {
expected);
}

@Test
public void testSimilarGroupPattern() throws Exception {
final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class);
checkConfig.addAttribute("groups", "/java.util/,/java.io/");
final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;

verify(checkConfig, getNonCompilablePath("InputImportOrderSimilarGroupPattern.java"),
expected);
}

@Test
public void testInvalidOption() throws Exception {
final DefaultConfiguration checkConfig =
Expand Down
@@ -0,0 +1,8 @@
package com.puppycrawl.tools.checkstyle.checks.imports.importorder;

import java.util.java.io.File;
import java.io.File;

public class InputImportOrderSimilarGroupPattern {

}

0 comments on commit 3cf085c

Please sign in to comment.