Skip to content

Commit

Permalink
Issue checkstyle#7874: resolve pitest issue in ImportOrderCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
nrmancuso committed Mar 28, 2020
1 parent fab949a commit 63bd1e4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Expand Up @@ -794,6 +794,19 @@ public void testUseContainerOrderingForStaticTrueCaseSensitive() throws Exceptio
verify(checkConfig, getNonCompilablePath("InputImportOrderEclipseStatic.java"), expected);
}

@Test
public void testLexicographicContainerOrdering() throws Exception {
final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class);
checkConfig.addAttribute("ordered", "true");
checkConfig.addAttribute("sortStaticImportsAlphabetically", "true");
checkConfig.addAttribute("useContainerOrderingForStatic", "true");
final String[] expected = {
"4:1: " + getCheckMessage(MSG_ORDERING,
"io.netty.handler.Codec.HTTP.HttpHeaders.TPARK.same"),
};
verify(checkConfig, getNonCompilablePath("InputLexicographicContainerOrdering.java"), expected);
}

@Test
public void testImportGroupsRedundantSeparatedInternally() throws Exception {
final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class);
Expand Down
@@ -0,0 +1,8 @@
//non-compiled with javac: contains specially crafted set of imports for testing
package com.puppycrawl.tools.checkstyle.checks.imports.importorder;
import static io.netty.handler.Codec.HTTP.HttpHeaders.elvis.same;
import static io.netty.handler.Codec.HTTP.HttpHeaders.TPARK.same;

public class InputLexicographicContainerOrdering {

}

0 comments on commit 63bd1e4

Please sign in to comment.