Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #7872: fixes Resolve Pitest Issues - ImportOrderCheck (1) #8782

Merged
merged 1 commit into from
Sep 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .ci/pitest.sh
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//non-compiled with javac: contains specially crafted set of imports for testing
package com.puppycrawl.tools.checkstyle.checks.imports.importorder;

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

public class InputImportOrderSimilarGroupPattern {

}