Issue #2421: enabling checking on it folder
This commit is contained in:
parent
ff45368856
commit
111cbbaf2a
|
|
@ -40,7 +40,7 @@
|
|||
<suppress checks="EmptyBlock" files=".*[\\/]src[\\/]test[\\/]"/>
|
||||
<suppress checks="ImportControl" files=".*[\\/]src[\\/](test|it)[\\/]"/>
|
||||
<suppress checks="Javadoc" files=".*[\\/]src[\\/](test|it)[\\/]"/>
|
||||
<suppress checks="MagicNumber" files=".*[\\/]src[\\/]test[\\/]"/>
|
||||
<suppress checks="MagicNumber" files=".*[\\/]src[\\/](test|it)[\\/]"/>
|
||||
<suppress checks="AvoidStaticImport" files=".*[\\/]src[\\/](test|it)[\\/]"/>
|
||||
<suppress checks="MethodCount" files="[\\/]ImportOrderCheckTest.java$"/>
|
||||
<suppress checks="MethodCount" files="[\\/]IndentationCheckTest.java$"/>
|
||||
|
|
@ -48,10 +48,10 @@
|
|||
<suppress checks="MethodCount" files="[\\/]MainTest.java$"/>
|
||||
<suppress checks="EqualsAvoidNull" files="[\\/]Int.*FilterTest.java$"/>
|
||||
<suppress checks="VisibilityModifier" files="[\\/]BaseCheckTestSupport.java$"/>
|
||||
<suppress checks="WriteTag" files=".*[\\/]src[\\/]test[\\/]"/>
|
||||
<suppress checks="WriteTag" files=".*[\\/]src[\\/](test|it)[\\/]"/>
|
||||
|
||||
<!-- Suppressions to remove over time -->
|
||||
<suppress checks="." files=".*[\\/]src[\\/]it[\\/]" lines="28-999"/>
|
||||
<suppress checks="." files=".*[\\/]src[\\/]it[\\/]" lines="40-999"/>
|
||||
|
||||
<!--
|
||||
Turn off all checks for Generated and Test code. Fixes issues with using
|
||||
|
|
|
|||
|
|
@ -25,12 +25,11 @@ import com.puppycrawl.tools.checkstyle.DefaultLogger;
|
|||
import com.puppycrawl.tools.checkstyle.api.AuditEvent;
|
||||
|
||||
/** A brief logger that only display info about errors. */
|
||||
class BriefLogger extends DefaultLogger
|
||||
{
|
||||
BriefLogger(OutputStream out)
|
||||
{
|
||||
class BriefLogger extends DefaultLogger {
|
||||
BriefLogger(OutputStream out) {
|
||||
super(out, true, out, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void auditStarted(AuditEvent event) {}
|
||||
public void auditStarted(AuditEvent event) { }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration;
|
|||
public class ConfigValidationTest extends BaseCheckTestSupport {
|
||||
@Test
|
||||
public void testGoogleChecks() throws Exception {
|
||||
ConfigurationBuilder builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
final ConfigurationBuilder builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
final Configuration checkerConfig = builder.getConfiguration();
|
||||
final Checker checker = new Checker();
|
||||
final Locale locale = Locale.ROOT;
|
||||
|
|
@ -45,7 +45,7 @@ public class ConfigValidationTest extends BaseCheckTestSupport {
|
|||
checker.addListener(new BriefLogger(stream));
|
||||
|
||||
final List<File> files = builder.getFiles();
|
||||
|
||||
|
||||
//runs over all input files;
|
||||
//as severity level is "warning", no errors expected
|
||||
verify(checker, files.toArray(new File[files.size()]), "",
|
||||
|
|
|
|||
|
|
@ -34,8 +34,7 @@ import java.util.regex.Pattern;
|
|||
|
||||
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
|
||||
|
||||
public class IndentationConfigurationBuilder extends ConfigurationBuilder
|
||||
{
|
||||
public class IndentationConfigurationBuilder extends ConfigurationBuilder {
|
||||
private static final int TAB_WIDTH = 4;
|
||||
|
||||
public IndentationConfigurationBuilder(File aROOT) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck;
|
||||
|
||||
public class OuterTypeFilenameTest extends BaseCheckTestSupport{
|
||||
public class OuterTypeFilenameTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,15 +30,15 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck;
|
||||
|
||||
public class FileTabCharacterTest extends BaseCheckTestSupport{
|
||||
|
||||
public class FileTabCharacterTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected DefaultConfiguration createCheckerConfig(
|
||||
Configuration aConfig)
|
||||
|
|
@ -63,12 +63,12 @@ public class FileTabCharacterTest extends BaseCheckTestSupport{
|
|||
"133:3: " + getCheckMessage(FileTabCharacterCheck.class, "containsTab"),
|
||||
"134:3: " + getCheckMessage(FileTabCharacterCheck.class, "containsTab"),
|
||||
};
|
||||
|
||||
|
||||
String filePath = builder.getFilePath("FileTabCharacterInput");
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(createChecker(checkConfig),filePath,
|
||||
expected, warnList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a configuration that is functionally close to that in the docs.
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
|||
import com.google.checkstyle.test.base.ConfigurationBuilder;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
|
||||
public class IllegalTokenTextTest extends BaseCheckTestSupport{
|
||||
|
||||
public class IllegalTokenTextTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -39,7 +39,7 @@ public class IllegalTokenTextTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void illegalTokensTest() throws Exception {
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"17:27: Avoid using corresponding octal or Unicode escape.",
|
||||
"18:27: Avoid using corresponding octal or Unicode escape.",
|
||||
|
|
@ -111,7 +111,7 @@ public class IllegalTokenTextTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("IllegalTokenText");
|
||||
String filePath = builder.getFilePath("IllegalTokenTextInput");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.AvoidEscapedUnicodeCharactersCheck;
|
||||
|
||||
public class AvoidEscapedUnicodeCharactersCheckTest extends BaseCheckTestSupport{
|
||||
|
||||
public class AvoidEscapedUnicodeCharactersCheckTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -54,7 +54,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends BaseCheckTestSupport
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("AvoidEscapedUnicodeCharacters");
|
||||
String filePath = builder.getFilePath("AvoidEscapedUnicodeCharactersInput");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck;
|
||||
|
||||
public class LineLengthTest extends BaseCheckTestSupport{
|
||||
|
||||
public class LineLengthTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -54,7 +54,7 @@ public class LineLengthTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("LineLength");
|
||||
String filePath = builder.getFilePath("LineLengthInput2");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
|||
import com.google.checkstyle.test.base.ConfigurationBuilder;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
|
||||
public class AvoidStarImportTest extends BaseCheckTestSupport{
|
||||
|
||||
public class AvoidStarImportTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -46,7 +46,7 @@ public class AvoidStarImportTest extends BaseCheckTestSupport{
|
|||
"18: Using the '.*' form of import should be avoided - javax.swing.WindowConstants.*.",
|
||||
"19: Using the '.*' form of import should be avoided - javax.swing.WindowConstants.*.",
|
||||
};
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("AvoidStarImport");
|
||||
String filePath = builder.getFilePath("AvoidStarImportInput");
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration;
|
|||
import com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck;
|
||||
import com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck;
|
||||
|
||||
public class NoLineWrapTest extends BaseCheckTestSupport{
|
||||
public class NoLineWrapTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck;
|
||||
|
||||
public class CustomImportOrderTest extends BaseCheckTestSupport{
|
||||
public class CustomImportOrderTest extends BaseCheckTestSupport {
|
||||
|
||||
private static final String MSG_SEPARATOR = "custom.import.order.line.separator";
|
||||
private static final String MSG_LEX = "custom.import.order.lex";
|
||||
|
|
@ -50,7 +50,7 @@ public class CustomImportOrderTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void customImportTest1() throws Exception {
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"4: " + getCheckMessage(clazz, MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"),
|
||||
"7: " + getCheckMessage(clazz, MSG_ORDER, STD, SPECIAL, "java.awt.Button"),
|
||||
|
|
@ -64,17 +64,17 @@ public class CustomImportOrderTest extends BaseCheckTestSupport{
|
|||
"15: " + getCheckMessage(clazz, MSG_ORDER, STD, SPECIAL, "java.io.InputStream"),
|
||||
"16: " + getCheckMessage(clazz, MSG_ORDER, STD, SPECIAL, "java.io.Reader"),
|
||||
};
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("CustomImportOrder");
|
||||
String filePath = builder.getFilePath("CustomImportOrderInput_1");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void customImportTest2() throws Exception {
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"4: " + getCheckMessage(clazz, MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"),
|
||||
"7: " + getCheckMessage(clazz, MSG_ORDER, STD, SPECIAL, "java.util.List"),
|
||||
|
|
@ -88,14 +88,14 @@ public class CustomImportOrderTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("CustomImportOrder");
|
||||
String filePath = builder.getFilePath("CustomImportOrderInput_2");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void customImportTest3() throws Exception {
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"4: " + getCheckMessage(clazz, MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"),
|
||||
"8: " + getCheckMessage(clazz, MSG_ORDER, STD, SPECIAL, "java.util.StringTokenizer"),
|
||||
|
|
@ -108,18 +108,18 @@ public class CustomImportOrderTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("CustomImportOrder");
|
||||
String filePath = builder.getFilePath("CustomImportOrderInput_3");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
@Test
|
||||
public void validTest() throws Exception {
|
||||
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("CustomImportOrder");
|
||||
String filePath = builder.getFilePath("CustomImportOrderValidInput");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.design.OneTopLevelClassCheck;
|
||||
|
||||
public class OneTopLevelClassTest extends BaseCheckTestSupport{
|
||||
|
||||
public class OneTopLevelClassTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -41,7 +41,7 @@ public class OneTopLevelClassTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void badTest() throws Exception {
|
||||
|
||||
|
||||
Class<OneTopLevelClassCheck> clazz = OneTopLevelClassCheck.class;
|
||||
String messageKey = "one.top.level.class";
|
||||
|
||||
|
|
@ -53,57 +53,57 @@ public class OneTopLevelClassTest extends BaseCheckTestSupport{
|
|||
"60: " + getCheckMessage(clazz, messageKey, "MyClassWithGenericSuperMethod"),
|
||||
"77: " + getCheckMessage(clazz, messageKey, "AnotherClass"),
|
||||
};
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("OneTopLevelClass");
|
||||
String filePath = builder.getFilePath("OneTopLevelClassInput_Basic");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void goodTest() throws Exception {
|
||||
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("OneTopLevelClass");
|
||||
String filePath = builder.getFilePath("OneTopLevelClassInputGood");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void bad2Test() throws Exception {
|
||||
|
||||
Class<OneTopLevelClassCheck> clazz = OneTopLevelClassCheck.class;
|
||||
String messageKey = "one.top.level.class";
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"4: " + getCheckMessage(clazz, messageKey, "FooEnum"),
|
||||
};
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("OneTopLevelClass");
|
||||
String filePath = builder.getFilePath("OneTopLevelClassBad2");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void bad3Test() throws Exception {
|
||||
|
||||
|
||||
Class<OneTopLevelClassCheck> clazz = OneTopLevelClassCheck.class;
|
||||
String messageKey = "one.top.level.class";
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"5: " + getCheckMessage(clazz, messageKey, "FooIn"),
|
||||
"7: " + getCheckMessage(clazz, messageKey, "FooClass"),
|
||||
};
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("OneTopLevelClass");
|
||||
String filePath = builder.getFilePath("OneTopLevelClassBad3");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDeclarationOrderCheck;
|
||||
|
||||
public class OverloadMethodsDeclarationOrderTest extends BaseCheckTestSupport{
|
||||
|
||||
public class OverloadMethodsDeclarationOrderTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -40,7 +40,7 @@ public class OverloadMethodsDeclarationOrderTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void overloadMethodsTest() throws Exception {
|
||||
|
||||
|
||||
Class<OverloadMethodsDeclarationOrderCheck> clazz = OverloadMethodsDeclarationOrderCheck.class;
|
||||
String messageKey = "overload.methods.declaration";
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ public class OverloadMethodsDeclarationOrderTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("OverloadMethodsDeclarationOrder");
|
||||
String filePath = builder.getFilePath("InputOverloadMethodsDeclarationOrder");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck;
|
||||
|
||||
public class EmptyLineSeparatorTest extends BaseCheckTestSupport{
|
||||
public class EmptyLineSeparatorTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck;
|
||||
|
||||
public class NeedBracesTest extends BaseCheckTestSupport{
|
||||
|
||||
public class NeedBracesTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -40,7 +40,7 @@ public class NeedBracesTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void needBracesTest() throws Exception {
|
||||
|
||||
|
||||
Class<NeedBracesCheck> clazz = NeedBracesCheck.class;
|
||||
String messageKey = "needBraces";
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ public class NeedBracesTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("NeedBraces");
|
||||
String filePath = builder.getFilePath("NeedBracesInput");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ import com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck;
|
|||
import com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyOption;
|
||||
|
||||
public class LeftCurlyRightCurlyTest extends BaseCheckTestSupport {
|
||||
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -61,11 +61,11 @@ public class LeftCurlyRightCurlyTest extends BaseCheckTestSupport {
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("LeftCurly");
|
||||
String filePath = builder.getFilePath("LeftCurlyInput_Braces");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void leftCurlyAnnotationsTest() throws Exception {
|
||||
|
||||
|
|
@ -76,14 +76,14 @@ public class LeftCurlyRightCurlyTest extends BaseCheckTestSupport {
|
|||
"27:5: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 5),
|
||||
"50:5: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 5),
|
||||
};
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("LeftCurly");
|
||||
String filePath = builder.getFilePath("LeftCurlyInput_Annotations");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void leftCurlyMethodsTest() throws Exception {
|
||||
|
||||
|
|
@ -107,7 +107,7 @@ public class LeftCurlyRightCurlyTest extends BaseCheckTestSupport {
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("LeftCurly");
|
||||
String filePath = builder.getFilePath("LeftCurlyInput_Method");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck;
|
||||
|
||||
public class EmptyBlockTest extends BaseCheckTestSupport{
|
||||
|
||||
public class EmptyBlockTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -40,7 +40,7 @@ public class EmptyBlockTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void emptyBlockTest() throws Exception {
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"19:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"),
|
||||
"22:34: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"),
|
||||
|
|
@ -79,14 +79,14 @@ public class EmptyBlockTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("EmptyBlock");
|
||||
String filePath = builder.getFilePath("EmptyBlockInput_Basic");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void emptyBlockTestCatch() throws Exception {
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"29:17: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally"),
|
||||
"50:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally"),
|
||||
|
|
@ -95,7 +95,7 @@ public class EmptyBlockTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("EmptyBlock");
|
||||
String filePath = builder.getFilePath("EmptyBlockInputCatch");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyCatchBlockCheck;
|
||||
|
||||
public class EmptyCatchBlockTest extends BaseCheckTestSupport
|
||||
{
|
||||
public class EmptyCatchBlockTest extends BaseCheckTestSupport {
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
@BeforeClass
|
||||
|
|
@ -42,7 +41,7 @@ public class EmptyCatchBlockTest extends BaseCheckTestSupport
|
|||
@Test
|
||||
public void emptyBlockTestCatch() throws Exception
|
||||
{
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"28: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"),
|
||||
"49: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"),
|
||||
|
|
@ -51,7 +50,7 @@ public class EmptyCatchBlockTest extends BaseCheckTestSupport
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("EmptyCatchBlock");
|
||||
String filePath = builder.getFilePath("EmptyBlockInputCatch");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
@ -59,12 +58,12 @@ public class EmptyCatchBlockTest extends BaseCheckTestSupport
|
|||
@Test
|
||||
public void testNoViolations() throws Exception
|
||||
{
|
||||
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("EmptyCatchBlock");
|
||||
String filePath = builder.getFilePath("EmptyCatchBlockNoViolationsInput");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
@ -72,7 +71,7 @@ public class EmptyCatchBlockTest extends BaseCheckTestSupport
|
|||
@Test
|
||||
public void testViolationsByComment() throws Exception
|
||||
{
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"19: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"),
|
||||
"27: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"),
|
||||
|
|
@ -80,7 +79,7 @@ public class EmptyCatchBlockTest extends BaseCheckTestSupport
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("EmptyCatchBlock");
|
||||
String filePath = builder.getFilePath("EmptyCatchBlockViolationsByCommentInput");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
@ -97,7 +96,7 @@ public class EmptyCatchBlockTest extends BaseCheckTestSupport
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("EmptyCatchBlock");
|
||||
String filePath = builder.getFilePath("EmptyCatchBlockViolationsByVariableNameInput");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck;
|
||||
|
||||
public class OneStatementPerLineTest extends BaseCheckTestSupport{
|
||||
public class OneStatementPerLineTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck;
|
||||
|
||||
public class LineLengthTest extends BaseCheckTestSupport{
|
||||
|
||||
public class LineLengthTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -40,7 +40,7 @@ public class LineLengthTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void lineLengthTest() throws Exception {
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"5: " + getCheckMessage(LineLengthCheck.class, "maxLineLen", 100, 112),
|
||||
"29: " + getCheckMessage(LineLengthCheck.class, "maxLineLen", 100, 183),
|
||||
|
|
@ -54,7 +54,7 @@ public class LineLengthTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("LineLength");
|
||||
String filePath = builder.getFilePath("LineLengthInput2");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck;
|
||||
|
||||
public class MethodParamPadTest extends BaseCheckTestSupport{
|
||||
|
||||
public class MethodParamPadTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -40,7 +40,7 @@ public class MethodParamPadTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void operatorWrapTest() throws Exception {
|
||||
|
||||
|
||||
Class<MethodParamPadCheck> clazz = MethodParamPadCheck.class;
|
||||
String messageKey = "line.previous";
|
||||
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@ import com.puppycrawl.tools.checkstyle.api.Configuration;
|
|||
import com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck;
|
||||
import com.puppycrawl.tools.checkstyle.checks.whitespace.WrapOption;
|
||||
|
||||
public class OperatorWrapTest extends BaseCheckTestSupport{
|
||||
|
||||
public class OperatorWrapTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -42,7 +42,7 @@ public class OperatorWrapTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void operatorWrapTest() throws Exception {
|
||||
|
||||
|
||||
Class<OperatorWrapCheck> clazz = OperatorWrapCheck.class;
|
||||
String messageKey = "line.new";
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ public class OperatorWrapTest extends BaseCheckTestSupport{
|
|||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void operatorWrapTestAssign() throws Exception {
|
||||
DefaultConfiguration newCheckConfig = createCheckConfig(OperatorWrapCheck.class);
|
||||
|
|
@ -84,7 +84,7 @@ public class OperatorWrapTest extends BaseCheckTestSupport{
|
|||
+ "BOR_ASSIGN, BAND_ASSIGN");
|
||||
String messageKey = "line.previous";
|
||||
Class<OperatorWrapCheck> clazz = OperatorWrapCheck.class;
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"28:13: " + getCheckMessage(clazz, messageKey, "="),
|
||||
"177:9: " + getCheckMessage(clazz, messageKey, "="),
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck;
|
||||
|
||||
public class SeparatorWrapTest extends BaseCheckTestSupport{
|
||||
|
||||
public class SeparatorWrapTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck;
|
||||
|
||||
public class EmptyLineSeparatorTest extends BaseCheckTestSupport{
|
||||
public class EmptyLineSeparatorTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ public class EmptyLineSeparatorTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void emptyLineSeparatorTest() throws Exception {
|
||||
|
||||
|
||||
Class<EmptyLineSeparatorCheck> clazz = EmptyLineSeparatorCheck.class;
|
||||
String messageKey = "empty.line.separator";
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
|||
import com.google.checkstyle.test.base.ConfigurationBuilder;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
|
||||
public class WhitespaceAroundTest extends BaseCheckTestSupport{
|
||||
public class WhitespaceAroundTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ public class WhitespaceAroundTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void whitespaceAroundBasicTest() throws Exception {
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("WhitespaceAround");
|
||||
String msgPreceded = "ws.notPreceded";
|
||||
String msgFollowed = "ws.notFollowed";
|
||||
|
|
@ -73,14 +73,14 @@ public class WhitespaceAroundTest extends BaseCheckTestSupport{
|
|||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void whitespaceAroundGenericsTest() throws Exception {
|
||||
|
||||
|
||||
String msgPreceded = "ws.preceded";
|
||||
String msgFollowed = "ws.followed";
|
||||
Configuration checkConfig = builder.getCheckConfig("GenericWhitespace");
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"12:16: " + getCheckMessage(checkConfig.getMessages(), msgPreceded, "<"),
|
||||
"12:18: " + getCheckMessage(checkConfig.getMessages(), msgFollowed, "<"),
|
||||
|
|
@ -107,7 +107,7 @@ public class WhitespaceAroundTest extends BaseCheckTestSupport{
|
|||
}
|
||||
@Test
|
||||
public void whitespaceAroundEmptyTypesCyclesTest() throws Exception {
|
||||
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("WhitespaceAround");
|
||||
|
|
@ -116,7 +116,7 @@ public class WhitespaceAroundTest extends BaseCheckTestSupport{
|
|||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void genericWhitespaceTest() throws Exception {
|
||||
String msgPreceded = "ws.preceded";
|
||||
|
|
@ -124,8 +124,8 @@ public class WhitespaceAroundTest extends BaseCheckTestSupport{
|
|||
String msgNotPreceded = "ws.notPreceded";
|
||||
String msgIllegalFollow = "ws.illegalFollow";
|
||||
Configuration checkConfig = builder.getCheckConfig("GenericWhitespace");
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"16:13: " + getCheckMessage(checkConfig.getMessages(), msgPreceded, "<"),
|
||||
"16:15: " + getCheckMessage(checkConfig.getMessages(), msgFollowed, "<"),
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclarationsCheck;
|
||||
|
||||
public class MultipleVariableDeclarationsTest extends BaseCheckTestSupport{
|
||||
|
||||
public class MultipleVariableDeclarationsTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -40,7 +40,7 @@ public class MultipleVariableDeclarationsTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void multipleVariableDeclarationsTest() throws Exception {
|
||||
|
||||
|
||||
String msgComma = getCheckMessage(MultipleVariableDeclarationsCheck.class, "multiple.variable.declarations.comma");
|
||||
String msg = getCheckMessage(MultipleVariableDeclarationsCheck.class, "multiple.variable.declarations");
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ public class MultipleVariableDeclarationsTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("MultipleVariableDeclarations");
|
||||
String filePath = builder.getFilePath("MultipleVariableDeclarationsInput");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck;
|
||||
|
||||
public class VariableDeclarationUsageDistanceTest extends BaseCheckTestSupport{
|
||||
public class VariableDeclarationUsageDistanceTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck;
|
||||
|
||||
public class ArrayTypeStyleTest extends BaseCheckTestSupport{
|
||||
|
||||
public class ArrayTypeStyleTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -40,7 +40,7 @@ public class ArrayTypeStyleTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void arrayTypeStyleTest() throws Exception {
|
||||
|
||||
|
||||
String msg = getCheckMessage(ArrayTypeStyleCheck.class, "array.type.style");
|
||||
|
||||
final String[] expected = {
|
||||
|
|
@ -51,10 +51,10 @@ public class ArrayTypeStyleTest extends BaseCheckTestSupport{
|
|||
"41:16: " + msg,
|
||||
"42:19: " + msg,
|
||||
};
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("ArrayTypeStyle");
|
||||
String filePath = builder.getFilePath("ArrayTypeStyleInput");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.google.checkstyle.test.base.IndentationConfigurationBuilder;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
|
||||
public class IndentationTest extends BaseCheckTestSupport{
|
||||
public class IndentationTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.coding.FallThroughCheck;
|
||||
|
||||
public class FallThroughTest extends BaseCheckTestSupport{
|
||||
|
||||
public class FallThroughTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -42,10 +42,10 @@ public class FallThroughTest extends BaseCheckTestSupport{
|
|||
public void fallThroughTest() throws Exception {
|
||||
|
||||
String msg = getCheckMessage(FallThroughCheck.class, "fall.through");
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"14:13: " + msg,
|
||||
"38:13: " + msg,
|
||||
"38:13: " + msg,
|
||||
"47:13: " + msg,
|
||||
"53:13: " + msg,
|
||||
"70:13: " + msg,
|
||||
|
|
@ -57,7 +57,7 @@ public class FallThroughTest extends BaseCheckTestSupport{
|
|||
"372:11: " + msg,
|
||||
"374:41: " + msg,
|
||||
};
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("FallThrough");
|
||||
String filePath = builder.getFilePath("FallThroughInput");
|
||||
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.coding.MissingSwitchDefaultCheck;
|
||||
|
||||
public class MissingSwitchDefaultTest extends BaseCheckTestSupport{
|
||||
|
||||
public class MissingSwitchDefaultTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -40,7 +40,7 @@ public class MissingSwitchDefaultTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void missingSwitchDefaultTest() throws Exception {
|
||||
|
||||
|
||||
String msg = getCheckMessage(MissingSwitchDefaultCheck.class, "missing.switch.default");
|
||||
|
||||
final String[] expected = {
|
||||
|
|
@ -51,10 +51,10 @@ public class MissingSwitchDefaultTest extends BaseCheckTestSupport{
|
|||
"38:21: " + msg,
|
||||
"42:21: " + msg,
|
||||
};
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("MissingSwitchDefault");
|
||||
String filePath = builder.getFilePath("MissingSwitchDefaultInput");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocationCheck;
|
||||
|
||||
public class AnnotationLocationTest extends BaseCheckTestSupport{
|
||||
|
||||
public class AnnotationLocationTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -40,7 +40,7 @@ public class AnnotationLocationTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void annotationTest() throws Exception {
|
||||
|
||||
|
||||
Class<AnnotationLocationCheck> clazz = AnnotationLocationCheck.class;
|
||||
getCheckMessage(clazz, "annotation.location.alone");
|
||||
Configuration checkConfig = builder.getCheckConfig("AnnotationLocation");
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck;
|
||||
|
||||
public class ModifierOrderTest extends BaseCheckTestSupport{
|
||||
|
||||
public class ModifierOrderTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -40,7 +40,7 @@ public class ModifierOrderTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void modifierOrderTest() throws Exception {
|
||||
|
||||
|
||||
Class<ModifierOrderCheck> clazz = ModifierOrderCheck.class;
|
||||
String msgMod = "mod.order";
|
||||
String msgAnnotation = "annotation.order";
|
||||
|
|
@ -100,10 +100,10 @@ public class ModifierOrderTest extends BaseCheckTestSupport{
|
|||
"217:37: " + getCheckMessage(clazz, msgMod, "protected"),
|
||||
"219:22: " + getCheckMessage(clazz, msgAnnotation, "@MyAnnotation2"),
|
||||
};
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("ModifierOrder");
|
||||
String filePath = builder.getFilePath("ModifierOrderInput");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
|||
import com.google.checkstyle.test.base.ConfigurationBuilder;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
|
||||
public class UpperEllTest extends BaseCheckTestSupport{
|
||||
|
||||
public class UpperEllTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -39,7 +39,7 @@ public class UpperEllTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void upperEllTest() throws Exception {
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"6:36: Should use uppercase 'L'.",
|
||||
"12:27: Should use uppercase 'L'.",
|
||||
|
|
@ -66,10 +66,10 @@ public class UpperEllTest extends BaseCheckTestSupport{
|
|||
"99:29: Should use uppercase 'L'.",
|
||||
"100:22: Should use uppercase 'L'.",
|
||||
};
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("UpperEll");
|
||||
String filePath = builder.getFilePath("InputUpperEll");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,14 +30,13 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
|
||||
public class PackageNameTest extends BaseCheckTestSupport{
|
||||
public class PackageNameTest extends BaseCheckTestSupport {
|
||||
|
||||
private static final String MSG_KEY = "name.invalidPattern";
|
||||
private static ConfigurationBuilder builder;
|
||||
private static Configuration checkConfig;
|
||||
private static String format;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() throws CheckstyleException {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
|||
import com.google.checkstyle.test.base.ConfigurationBuilder;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
|
||||
public class TypeNameTest extends BaseCheckTestSupport{
|
||||
public class TypeNameTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
|
|||
|
|
@ -28,10 +28,10 @@ import com.google.checkstyle.test.base.BaseCheckTestSupport;
|
|||
import com.google.checkstyle.test.base.ConfigurationBuilder;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
|
||||
public class MethodNameTest extends BaseCheckTestSupport{
|
||||
|
||||
public class MethodNameTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -39,7 +39,7 @@ public class MethodNameTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void methodNameTest() throws Exception {
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("MethodName");
|
||||
String msgKey = "name.invalidPattern";
|
||||
String format = "^[a-z][a-z0-9][a-zA-Z0-9_]*$";
|
||||
|
|
@ -70,9 +70,9 @@ public class MethodNameTest extends BaseCheckTestSupport{
|
|||
"49:14: " + getCheckMessage(checkConfig.getMessages(), msgKey, "f", format),
|
||||
"50:14: " + getCheckMessage(checkConfig.getMessages(), msgKey, "fO", format),
|
||||
};
|
||||
|
||||
|
||||
String filePath = builder.getFilePath("InputMethodName");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
|
||||
public class MemberNameTest extends BaseCheckTestSupport{
|
||||
public class MemberNameTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
private static final String MSG_KEY = "name.invalidPattern";
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
|
||||
public class ParameterNameTest extends BaseCheckTestSupport{
|
||||
public class ParameterNameTest extends BaseCheckTestSupport {
|
||||
|
||||
private static final String MSG_KEY = "name.invalidPattern";
|
||||
private static String format;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
|
||||
public class LocalVariableNameTest extends BaseCheckTestSupport{
|
||||
public class LocalVariableNameTest extends BaseCheckTestSupport {
|
||||
|
||||
private static final String MSG_KEY = "name.invalidPattern";
|
||||
private static ConfigurationBuilder builder;
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
|
||||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
|
||||
public class ClassMethodTypeParameterNameTest extends BaseCheckTestSupport{
|
||||
public class ClassMethodTypeParameterNameTest extends BaseCheckTestSupport {
|
||||
|
||||
private static final String MSG_KEY = "name.invalidPattern";
|
||||
private static ConfigurationBuilder builder;
|
||||
|
|
|
|||
|
|
@ -29,13 +29,13 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.naming.AbbreviationAsWordInNameCheck;
|
||||
|
||||
public class AbbreviationAsWordInNameTest extends BaseCheckTestSupport{
|
||||
public class AbbreviationAsWordInNameTest extends BaseCheckTestSupport {
|
||||
|
||||
private static final String MSG_KEY = "abbreviation.as.word";
|
||||
private static ConfigurationBuilder builder;
|
||||
private final Class<AbbreviationAsWordInNameCheck> clazz = AbbreviationAsWordInNameCheck.class;
|
||||
private static Configuration checkConfig;
|
||||
|
||||
private final Class<AbbreviationAsWordInNameCheck> clazz = AbbreviationAsWordInNameCheck.class;
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -61,7 +61,7 @@ public class AbbreviationAsWordInNameTest extends BaseCheckTestSupport{
|
|||
};
|
||||
|
||||
String filePath = builder.getFilePath("InputAbbreviationAsWordInTypeNameCheck");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck;
|
||||
|
||||
public class EmptyBlockTest extends BaseCheckTestSupport{
|
||||
|
||||
public class EmptyBlockTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
||||
@BeforeClass
|
||||
public static void setConfigurationBuilder() {
|
||||
builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
|
|
@ -40,7 +40,7 @@ public class EmptyBlockTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void emptyBlockTestCatch() throws Exception {
|
||||
|
||||
|
||||
final String[] expected = {
|
||||
"29:17: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally"),
|
||||
"50:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally"),
|
||||
|
|
@ -49,7 +49,7 @@ public class EmptyBlockTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("EmptyBlock");
|
||||
String filePath = builder.getFilePath("EmptyBlockInputCatch");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.coding.NoFinalizerCheck;
|
||||
|
||||
public class NoFinalizerTest extends BaseCheckTestSupport{
|
||||
public class NoFinalizerTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ public class NoFinalizerTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void noFinalizerBasicTest() throws Exception {
|
||||
|
||||
|
||||
String msg = getCheckMessage(NoFinalizerCheck.class, "avoid.finalizer.method");
|
||||
|
||||
final String[] expected = {
|
||||
|
|
@ -49,14 +49,14 @@ public class NoFinalizerTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("NoFinalizer");
|
||||
String filePath = builder.getFilePath("NoFinalizerInput");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void noFinalizerExtendedTest() throws Exception {
|
||||
|
||||
|
||||
String msg = getCheckMessage(NoFinalizerCheck.class, "avoid.finalizer.method");
|
||||
|
||||
final String[] expected = {
|
||||
|
|
@ -73,7 +73,7 @@ public class NoFinalizerTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("NoFinalizer");
|
||||
String filePath = builder.getFilePath("NoFinalizeExtendInput");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.javadoc.SingleLineJavadocCheck;
|
||||
|
||||
public class SingleLineJavadocTest extends BaseCheckTestSupport{
|
||||
public class SingleLineJavadocTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ public class SingleLineJavadocTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void singleLineJavadocTest() throws Exception {
|
||||
|
||||
|
||||
String msg = getCheckMessage(SingleLineJavadocCheck.class, "singleline.javadoc");
|
||||
|
||||
final String[] expected = {
|
||||
|
|
@ -57,7 +57,7 @@ public class SingleLineJavadocTest extends BaseCheckTestSupport{
|
|||
final DefaultConfiguration checkConfig = createCheckConfig(SingleLineJavadocCheck.class);
|
||||
checkConfig.addAttribute("ignoreInlineTags", "false");
|
||||
String filePath = builder.getFilePath("InputSingleLineJavadocCheck");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@ public class SingleLineJavadocTest extends BaseCheckTestSupport{
|
|||
@Test(expected = Exception.class)
|
||||
public void customInlineTagTest() throws Exception{
|
||||
String msg = getCheckMessage(SingleLineJavadocCheck.class, "singleline.javadoc");
|
||||
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("SingleLineJavadocCheck");
|
||||
String filePath = builder.getFilePath("InputSingleLineJavadocCheckError");
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck;
|
||||
|
||||
public class JavadocParagraphTest extends BaseCheckTestSupport{
|
||||
public class JavadocParagraphTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
@ -46,11 +46,11 @@ public class JavadocParagraphTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("JavadocParagraph");
|
||||
String filePath = builder.getFilePath("InputCorrectJavadocParagraphCheck");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void javadocParagraphIncorrectTest() throws Exception {
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ public class JavadocParagraphTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("JavadocParagraph");
|
||||
String filePath = builder.getFilePath("InputIncorrectJavadocParagraphCheck");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.javadoc.AtclauseOrderCheck;
|
||||
|
||||
public class AtclauseOrderTest extends BaseCheckTestSupport{
|
||||
public class AtclauseOrderTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
@ -46,11 +46,11 @@ public class AtclauseOrderTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("AtclauseOrder");
|
||||
String filePath = builder.getFilePath("InputCorrectAtClauseOrderCheck");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testIncorrect() throws Exception {
|
||||
final String tagOrder = "[@param, @return, @throws, @deprecated]";
|
||||
|
|
@ -88,7 +88,7 @@ public class AtclauseOrderTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("AtclauseOrder");
|
||||
String filePath = builder.getFilePath("InputIncorrectAtClauseOrderCheck");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTagContinuationIndentationCheck;
|
||||
|
||||
public class JavadocTagContinuationIndentationTest extends BaseCheckTestSupport{
|
||||
public class JavadocTagContinuationIndentationTest extends BaseCheckTestSupport {
|
||||
|
||||
@Test
|
||||
public void testWithDefaultConfiguration() throws Exception {
|
||||
ConfigurationBuilder builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
String msg = getCheckMessage(JavadocTagContinuationIndentationCheck.class,
|
||||
final ConfigurationBuilder builder = new ConfigurationBuilder(new File("src/it/"));
|
||||
final String msg = getCheckMessage(JavadocTagContinuationIndentationCheck.class,
|
||||
"tag.continuation.indent", 4);
|
||||
|
||||
final String[] expected = {
|
||||
|
|
@ -53,7 +53,7 @@ public class JavadocTagContinuationIndentationTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("JavadocTagContinuationIndentation");
|
||||
String filePath = builder.getFilePath("InputJavaDocTagContinuationIndentation");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck;
|
||||
|
||||
public class NonEmptyAtclauseDescriptionTest extends BaseCheckTestSupport{
|
||||
public class NonEmptyAtclauseDescriptionTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ public class NonEmptyAtclauseDescriptionTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("NonEmptyAtclauseDescription");
|
||||
String filePath = builder.getFilePath("InputNonEmptyAtclauseDescriptionCheck");
|
||||
|
||||
|
||||
Integer[] warnList = getLineNumbersFromExpected(expected);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
@ -78,7 +78,7 @@ public class NonEmptyAtclauseDescriptionTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("NonEmptyAtclauseDescription");
|
||||
String filePath = builder.getFilePath("InputNonEmptyAtclauseDescriptionCheckSpaceSeq");
|
||||
|
||||
|
||||
Integer[] warnList = getLineNumbersFromExpected(expected);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck;
|
||||
|
||||
public class SummaryJavadocTest extends BaseCheckTestSupport{
|
||||
public class SummaryJavadocTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
@ -41,19 +41,19 @@ public class SummaryJavadocTest extends BaseCheckTestSupport{
|
|||
|
||||
@Test
|
||||
public void testCorrect() throws Exception {
|
||||
|
||||
|
||||
final String[] expected = ArrayUtils.EMPTY_STRING_ARRAY;
|
||||
|
||||
Configuration checkConfig = builder.getCheckConfig("SummaryJavadocCheck");
|
||||
String filePath = builder.getFilePath("InputCorrectSummaryJavaDocCheck");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIncorrect() throws Exception {
|
||||
|
||||
|
||||
String msgFirstSentence = getCheckMessage(SummaryJavadocCheck.class, "summary.first.sentence");
|
||||
String msgForbiddenFragment = getCheckMessage(SummaryJavadocCheck.class, "summary.javaDoc");
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ public class SummaryJavadocTest extends BaseCheckTestSupport{
|
|||
|
||||
Configuration checkConfig = builder.getCheckConfig("SummaryJavadocCheck");
|
||||
String filePath = builder.getFilePath("InputIncorrectSummaryJavaDocCheck");
|
||||
|
||||
|
||||
Integer[] warnList = builder.getLinesWithWarn(filePath);
|
||||
verify(checkConfig, filePath, expected, warnList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import com.google.checkstyle.test.base.ConfigurationBuilder;
|
|||
import com.puppycrawl.tools.checkstyle.api.Configuration;
|
||||
import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck;
|
||||
|
||||
public class JavadocMethodTest extends BaseCheckTestSupport{
|
||||
public class JavadocMethodTest extends BaseCheckTestSupport {
|
||||
|
||||
private static ConfigurationBuilder builder;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue