Add test with default configuration for CustomImportOrderCheck, issue #1129.

This commit is contained in:
Andrei Selkin 2015-07-22 02:24:16 +03:00 committed by Roman Ivanov
parent 13c0b844db
commit aa90bcf588
1 changed files with 18 additions and 0 deletions

View File

@ -36,6 +36,7 @@ import static com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCh
import static com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck.MSG_ORDER;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
public class CustomImportOrderCheckTest extends BaseCheckTestSupport {
/**
@ -421,4 +422,21 @@ public class CustomImportOrderCheckTest extends BaseCheckTestSupport {
+ "InputCustomImportOrder_NoImports.java").getCanonicalPath(), expected);
}
@Test
public void testDefaultConfiguration() throws Exception {
final DefaultConfiguration checkConfig =
createCheckConfig(CustomImportOrderCheck.class);
String[] expected = {
};
try {
createChecker(checkConfig);
verify(checkConfig, getPath("imports" + File.separator
+ "InputCustomImportOrder.java"), expected);
}
catch (Exception ex) {
// Exception is not expected
fail();
}
}
}